code
stringlengths 2.5k
150k
| kind
stringclasses 1
value |
---|---|
css Logical properties for sizing Logical properties for sizing
=============================
In this guide we will explain the flow-relative mappings between physical dimension properties and logical properties used for sizing elements on our pages.
When specifying the size of an item, the [Logical Properties and Values](https://drafts.csswg.org/css-logical/) specification gives you the ability to indicate sizing as it relates to the flow of text (inline and block) rather than physical sizing which relates to the physical dimensions of horizontal and vertical (e.g. left and right). While these flow relative mappings may well become the default for many of us, in a design you may well use both physical and logical sizing. You might want some features to always relate to the physical dimensions whatever the writing mode.
Mappings for dimensions
-----------------------
The table below provides mappings between logical and physical properties. These mappings assume that you are in a `horizontal-tb` writing mode, such as English or Arabic, in which case [`width`](../width) would be mapped to [`inline-size`](../inline-size).
If you were in a vertical writing mode then [`inline-size`](../inline-size) would be mapped to [`height`](../height).
| Logical Property | Physical Property |
| --- | --- |
| [`inline-size`](../inline-size) | [`width`](../width) |
| [`block-size`](../block-size) | [`height`](../height) |
| [`min-inline-size`](../min-inline-size) | [`min-width`](../min-width) |
| [`min-block-size`](../min-block-size) | [`min-height`](../min-height) |
| [`max-inline-size`](../max-inline-size) | [`max-width`](../max-width) |
| [`max-block-size`](../max-block-size) | [`max-height`](../max-height) |
Width and height example
------------------------
The logical mappings for [`width`](../width) and [`height`](../height) are [`inline-size`](../inline-size), which sets the length in the inline dimension and [`block-size`](../block-size), which sets the length in the block dimension. When working in English, replacing `width` with `inline-size` and `height` with `block-size` will give the same layout.
In the live example below I have set the Writing Mode to `horizontal-tb`. Change it to `vertical-rl` and you will see that the first example — which uses `width` and `height` — remains the same size in each dimension, despite the text becoming vertical. The second example — which uses `inline-size` and `block-size` — will follow the text direction as if the entire block has rotated.
Min-width and min-height example
--------------------------------
There are also mappings for [`min-width`](../min-width) and [`min-height`](../min-height) — these are [`min-inline-size`](../min-inline-size) and [`min-block-size`](../min-block-size). These work in the same way as the `inline-size` and `block-size` properties, but setting a minimum rather than a fixed size.
Try changing the example below to `vertical-rl`, as with the first example, to see the effect it has. I am using `min-height` in the first example and `min-block-size` in the second.
Max-width and max-height example
--------------------------------
Finally you can use [`max-inline-size`](../max-inline-size) and [`max-block-size`](../max-block-size) as logical replacements for [`max-width`](../max-width) and [`max-height`](../max-height). Try playing with the below example in the same way as before.
Logical keywords for resize
---------------------------
The [`resize`](../resize) property sets whether or not an item can be resized and has physical values of `horizontal` and `vertical`. The `resize` property also has logical keyword values. Using `resize: inline` allows resizing in the inline dimension and `resize: block` allow resizing in the block dimension.
The keyword value of `both` for the resize property works whether you are thinking physically or logically. It sets both dimensions at once. Try playing with the below example.
css Using CSS transitions Using CSS transitions
=====================
**CSS transitions** provide a way to control animation speed when changing CSS properties. Instead of having property changes take effect immediately, you can cause the changes in a property to take place over a period of time. For example, if you change the color of an element from white to black, usually the change is instantaneous. With CSS transitions enabled, changes occur at time intervals that follow an acceleration curve, all of which can be customized.
Animations that involve transitioning between two states are often called *implicit transitions* as the states in between the start and final states are implicitly defined by the browser.
CSS transitions let you decide which properties to animate (by *listing them explicitly*), when the animation will start (by setting a *delay)*, how long the transition will last (by setting a *duration*), and how the transition will run (by defining a *timing function*, e.g., linearly or quick at the beginning, slow at the end).
Which CSS properties can be transitioned?
-----------------------------------------
The Web author can define which property has to be animated and in which way. This allows the creation of complex transitions. As it doesn't make sense to animate some properties, the [list of animatable properties](../css_animated_properties) is limited to a finite set.
**Note:** The set of properties that can be animated is changing as the specification develops.
**Note:** The `auto` value is often a very complex case. The specification recommends not animating from and to `auto`. Some user agents, like those based on Gecko, implement this requirement and others, like those based on WebKit, are less strict. Using animations with `auto` may lead to unpredictable results, depending on the browser and its version, and should be avoided.
Defining transitions
--------------------
CSS Transitions are controlled using the shorthand [`transition`](../transition) property. This is the best way to configure transitions, as it makes it easier to avoid out of sync parameters, which can be very frustrating to have to spend lots of time debugging in CSS.
You can control the individual components of the transition with the following sub-properties:
[`transition-property`](../transition-property) Specifies the name or names of the CSS properties to which transitions should be applied. Only properties listed here are animated during transitions; changes to all other properties occur instantaneously as usual.
[`transition-duration`](../transition-duration) Specifies the duration over which transitions should occur. You can specify a single duration that applies to all properties during the transition, or multiple values to allow each property to transition over a different period of time.
[`transition-timing-function`](../transition-timing-function) Specifies a function to define how intermediate values for properties are computed. *Timing functions* determine how intermediate values of the transition are calculated. Most [timing functions](../easing-function) can be specified by providing the graph of the corresponding function, as defined by four points defining a cubic bezier. You can also choose easing from [Easing Functions Cheat Sheet](https://easings.net/).
[`transition-delay`](../transition-delay) Defines how long to wait between the time a property is changed and the transition actually begins.
The `transition` shorthand CSS syntax is written as follows:
```
div {
transition: <property> <duration> <timing-function> <delay>;
}
```
Examples
--------
### Simple example
This example performs a four-second font size transition with a two-second delay between the time the user mouses over the element and the beginning of the animation effect:
```
#delay {
font-size: 14px;
transition-property: font-size;
transition-duration: 4s;
transition-delay: 2s;
}
#delay:hover {
font-size: 36px;
}
```
### Multiple animated properties example
#### CSS Content
```
.box {
border-style: solid;
border-width: 1px;
display: block;
width: 100px;
height: 100px;
background-color: #0000ff;
transition: width 2s, height 2s, background-color 2s, transform 2s;
}
.box:hover {
background-color: #ffcccc;
width: 200px;
height: 200px;
rotate: 180deg;
}
```
### When property value lists are of different lengths
If any property's list of values is shorter than the others, its values are repeated to make them match. For example:
```
div {
transition-property: opacity, left, top, height;
transition-duration: 3s, 5s;
}
```
This is treated as if it were:
```
div {
transition-property: opacity, left, top, height;
transition-duration: 3s, 5s, 3s, 5s;
}
```
Similarly, if any property's value list is longer than that for [`transition-property`](../transition-property), it's truncated, so if you have the following CSS:
```
div {
transition-property: opacity, left;
transition-duration: 3s, 5s, 2s, 1s;
}
```
This gets interpreted as:
```
div {
transition-property: opacity, left;
transition-duration: 3s, 5s;
}
```
### Using transitions when highlighting menus
A common use of CSS is to highlight items in a menu as the user hovers the mouse cursor over them. It's easy to use transitions to make the effect even more attractive.
First, we set up the menu using HTML:
```
<nav>
<a href="#">Home</a>
<a href="#">About</a>
<a href="#">Contact Us</a>
<a href="#">Links</a>
</nav>
```
Then we build the CSS to implement the look and feel of our menu:
```
nav {
display: flex;
gap: 0.5rem;
}
a {
flex: 1;
background-color: #333;
color: #fff;
border: 1px solid;
padding: 0.5rem;
text-align: center;
text-decoration: none;
transition: all 0.5s ease-out;
}
a:hover,
a:focus {
background-color: #fff;
color: #333;
}
```
This CSS establishes the look of the menu, with the background and text colors both changing when the element is in its [`:hover`](../:hover) and [`:focus`](../:focus) states:
JavaScript examples
-------------------
**Note:** Care should be taken when using a transition immediately after:
* adding the element to the DOM using `.appendChild()`
* removing an element's `display: none;` property.
This is treated as if the initial state had never occurred and the element was always in its final state. The easy way to overcome this limitation is to apply a `setTimeout()` of a handful of milliseconds before changing the CSS property you intend to transition to.
### Using transitions to make JavaScript functionality smooth
Transitions are a great tool to make things look much smoother without having to do anything to your JavaScript functionality. Take the following example.
```
<p>Click anywhere to move the ball</p>
<div id="foo" class="ball"></div>
```
Using JavaScript you can make the effect of moving the ball to a certain position happen:
```
const f = document.getElementById('foo');
document.addEventListener('click', (ev) => {
f.style.transform = `translateY(${ev.clientY - 25}px)`;
f.style.transform += `translateX(${ev.clientX - 25}px)`;
}, false);
```
With CSS you can make it smooth without any extra effort. Add a transition to the element and any change will happen smoothly:
```
.ball {
border-radius: 25px;
width: 50px;
height: 50px;
background: #c00;
position: absolute;
top: 0;
left: 0;
transition: transform 1s;
}
```
### Detecting the start and completion of a transition
You can use the [`transitionend`](https://developer.mozilla.org/en-US/docs/Web/API/Element/transitionend_event) event to detect that an animation has finished running. This is a [`TransitionEvent`](https://developer.mozilla.org/en-US/docs/Web/API/TransitionEvent) object, which has two added properties beyond a typical [`Event`](https://developer.mozilla.org/en-US/docs/Web/API/Event) object:
`propertyName` A string indicating the name of the CSS property whose transition completed.
`elapsedTime` A float indicating the number of seconds the transition had been running at the time the event fired. This value isn't affected by the value of [`transition-delay`](../transition-delay).
As usual, you can use the [`addEventListener()`](https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener) method to monitor for this event:
```
el.addEventListener("transitionend", updateTransition, true);
```
You detect the beginning of a transition using [`transitionrun`](https://developer.mozilla.org/en-US/docs/Web/API/Element/transitionrun_event) (fires before any delay) and [`transitionstart`](https://developer.mozilla.org/en-US/docs/Web/API/Element/transitionstart_event) (fires after any delay), in the same kind of fashion:
```
el.addEventListener("transitionrun", signalStart, true);
el.addEventListener("transitionstart", signalStart, true);
```
**Note:** The `transitionend` event doesn't fire if the transition is aborted before the transition is completed because either the element is made [`display`](../display)`: none` or the animating property's value is changed.
Specifications
--------------
| Specification |
| --- |
| [CSS Transitions](https://drafts.csswg.org/css-transitions/) |
See also
--------
* The [`TransitionEvent`](https://developer.mozilla.org/en-US/docs/Web/API/TransitionEvent) interface and the [`transitionend`](https://developer.mozilla.org/en-US/docs/Web/API/Element/transitionend_event) event
* [Using CSS animations](../css_animations/using_css_animations)
css Mastering margin collapsing Mastering margin collapsing
===========================
The [top](../margin-top) and [bottom](../margin-bottom) margins of blocks are sometimes combined (collapsed) into a single margin whose size is the largest of the individual margins (or just one of them, if they are equal), a behavior known as **margin collapsing**. Note that the margins of [floating](../float) and [absolutely positioned](../position#types_of_positioning) elements never collapse.
Margin collapsing occurs in three basic cases:
Adjacent siblings The margins of adjacent siblings are collapsed (except when the latter sibling needs to be [cleared](../clear) past floats).
No content separating parent and descendants If there is no border, padding, inline part, [block formatting context](https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Block_formatting_context) created, or *[clearance](../clear)* to separate the [`margin-top`](../margin-top) of a block from the [`margin-top`](../margin-top) of one or more of its descendant blocks; or no border, padding, inline content, [`height`](../height), or [`min-height`](../min-height) to separate the [`margin-bottom`](../margin-bottom) of a block from the [`margin-bottom`](../margin-bottom) of one or more of its descendant blocks, then those margins collapse. The collapsed margin ends up outside the parent.
Empty blocks If there is no border, padding, inline content, [`height`](../height), or [`min-height`](../min-height) to separate a block's [`margin-top`](../margin-top) from its [`margin-bottom`](../margin-bottom), then its top and bottom margins collapse.
Some things to note:
* More complex margin collapsing (of more than two margins) occurs when the above cases are combined.
* These rules apply even to margins that are zero, so the margin of a descendant ends up outside its parent (according to the rules above) whether or not the parent's margin is zero.
* When negative margins are involved, the size of the collapsed margin is the sum of the largest positive margin and the smallest (most negative) negative margin.
* When all margins are negative, the size of the collapsed margin is the smallest (most negative) margin. This applies to both adjacent elements and nested elements.
* Collapsing margins is only relevant in the vertical direction.
* Margins don't collapse in a container with `display` set to `flex`.
Examples
--------
### HTML
```
<p>The bottom margin of this paragraph is collapsed …</p>
<p>
… with the top margin of this paragraph, yielding a margin of
<code>1.2rem</code> in between.
</p>
<div>
This parent element contains two paragraphs!
<p>
This paragraph has a <code>.4rem</code> margin between it and the text
above.
</p>
<p>
My bottom margin collapses with my parent, yielding a bottom margin of
<code>2rem</code>.
</p>
</div>
<p>I am <code>2rem</code> below the element above.</p>
```
### CSS
```
div {
margin: 2rem 0;
background: lavender;
}
p {
margin: 0.4rem 0 1.2rem 0;
background: yellow;
}
```
### Result
Specifications
--------------
| Specification |
| --- |
| [Cascading Style Sheets Level 2 Revision 2 (CSS 2.2) Specification # collapsing-margins](https://www.w3.org/TR/CSS22/box.html#collapsing-margins) |
See also
--------
* CSS key concepts:
+ [CSS syntax](../syntax)
+ [At-rules](../at-rule)
+ [Comments](../comments)
+ [Specificity](../specificity)
+ [Inheritance](../inheritance)
+ [Box model](introduction_to_the_css_box_model)
+ [Layout modes](../layout_mode)
+ [Visual formatting models](../visual_formatting_model)
+ Values
- [Initial values](../initial_value)
- [Computed values](../computed_value)
- [Used values](../used_value)
- [Actual values](../actual_value)
+ [Value definition syntax](../value_definition_syntax)
+ [Shorthand properties](../shorthand_properties)
+ [Replaced elements](../replaced_element)
css Introduction to the CSS basic box model Introduction to the CSS basic box model
=======================================
When laying out a document, the browser's rendering engine represents each element as a rectangular box according to the standard **CSS basic box model**. CSS determines the size, position, and properties (color, background, border size, etc.) of these boxes.
Every box is composed of four parts (or *areas*), defined by their respective edges: the *content edge*, *padding edge*, *border edge*, and *margin edge*.
Content area
------------
The **content area**, bounded by the content edge, contains the "real" content of the element, such as text, an image, or a video player. Its dimensions are the *content width* (or *content-box width*) and the *content height* (or *content-box height*). It often has a background color or background image.
If the [`box-sizing`](../box-sizing) property is set to `content-box` (default) and if the element is a block element, the content area's size can be explicitly defined with the [`width`](../width), [`min-width`](../min-width), [`max-width`](../max-width), [`height`](../height), [`min-height`](../min-height), and [`max-height`](../max-height) properties.
Padding area
------------
The **padding area**, bounded by the padding edge, extends the content area to include the element's padding. Its dimensions are the *padding-box width* and the *padding-box height*.
The thickness of the padding is determined by the [`padding-top`](../padding-top), [`padding-right`](../padding-right), [`padding-bottom`](../padding-bottom), [`padding-left`](../padding-left), and shorthand [`padding`](../padding) properties.
Border area
-----------
The **border area**, bounded by the border edge, extends the padding area to include the element's borders. Its dimensions are the *border-box width* and the *border-box height*.
The thickness of the borders are determined by the [`border-width`](../border-width) and shorthand [`border`](../border) properties. If the [`box-sizing`](../box-sizing) property is set to `border-box`, the border area's size can be explicitly defined with the [`width`](../width), [`min-width`](../min-width), [`max-width`](../max-width), [`height`](../height), [`min-height`](../min-height), and [`max-height`](../max-height) properties. When there is a background ([`background-color`](../background-color) or [`background-image`](../background-image)) set on a box, it extends to the outer edge of the border (i.e. extends underneath the border in z-ordering). This default behavior can be altered with the [`background-clip`](../background-clip) CSS property.
Margin area
-----------
The **margin area**, bounded by the margin edge, extends the border area to include an empty area used to separate the element from its neighbors. Its dimensions are the *margin-box width* and the *margin-box height*.
The size of the margin area is determined by the [`margin-top`](../margin-top), [`margin-right`](../margin-right), [`margin-bottom`](../margin-bottom), [`margin-left`](../margin-left), and shorthand [`margin`](../margin) properties. When [margin collapsing](mastering_margin_collapsing) occurs, the margin area is not clearly defined since margins are shared between boxes.
Finally, note that for non-replaced inline elements, the amount of space taken up (the contribution to the height of the line) is determined by the [`line-height`](../line-height) property, even though the borders and padding are still displayed around the content.
Specifications
--------------
| Specification |
| --- |
| [CSS Box Model Module Level 3 # intro](https://drafts.csswg.org/css-box/#intro) |
See also
--------
* [Layout and the containing block](../containing_block)
* [Introducing the CSS Cascade](../cascade)
* [Cascade, specificity, and inheritance](https://developer.mozilla.org/en-US/docs/Learn/CSS/Building_blocks/Cascade_and_inheritance)
* CSS key concepts:
+ [CSS syntax](../syntax)
+ [At-rules](../at-rule)
+ [Comments](../comments)
+ [Specificity](../specificity)
+ [Inheritance](../inheritance)
+ [Layout modes](../layout_mode)
+ [Visual formatting models](../visual_formatting_model)
+ [Margin collapsing](mastering_margin_collapsing)
+ Values
- [Initial values](../initial_value)
- [Computed values](../computed_value)
- [Used values](../used_value)
- [Actual values](../actual_value)
+ [Value definition syntax](../value_definition_syntax)
+ [Shorthand properties](../shorthand_properties)
+ [Replaced elements](../replaced_element)
| programming_docs |
css Box alignment in Multi-column Layout Box alignment in Multi-column Layout
====================================
The [Box Alignment](../css_box_alignment) Specification details how alignment works in various layout methods; on this page we explore how Box Alignment works in the context of [Multi-column Layout](../css_columns). As this page aims to detail things which are specific to Multi-column Layout and Box Alignment, it should be read in conjunction with the main [Box Alignment](../css_box_alignment) page which details the common features of Box Alignment across layout methods.
In multi-column layout the alignment container is the content box of the multicol container. The alignment subject is the column box. The properties which apply to multi-column layouts are detailed below.
**Note:** Multi-column Layout predates the Box Alignment specification. And the properties listed here, while specified for Multicol, may not be supported in browsers.
align-content and justify-content
---------------------------------
The [`align-content`](../align-content) property applies to the block axis and [`justify-content`](../justify-content) to the inline axis. Any spacing added to the columns due to use of space distribution will be added to the gap between the columns, therefore making the gap larger than might be specified by the [`column-gap`](../column-gap) property.
Using a value of `justify-content` other than `normal` or `stretch` will cause column boxes to display at the [`column-width`](../column-width) specified on the multicol container, and the remaining space distributed according to the value of justify-content.
column-gap
----------
The [`column-gap`](../column-gap) property was specified in earlier versions of the multiple-column layout specification, and has now been unified with the gap properties for other layout methods in box alignment. While other layout methods treat the initial value of column-gap as 0 multicol treats it as 1em, as in general you would not want to have no gap between columns.
Reference
---------
### CSS Properties
* [`justify-content`](../justify-content)
* [`align-content`](../align-content)
* [`column-gap`](../column-gap)
### Glossary Entries
* [Alignment subject](https://developer.mozilla.org/en-US/docs/Glossary/Alignment_Subject)
* [Alignment container](https://developer.mozilla.org/en-US/docs/Glossary/Alignment_Container)
* [Fallback alignment](https://developer.mozilla.org/en-US/docs/Glossary/Fallback_Alignment)
css Box alignment in grid layout Box alignment in grid layout
============================
The [Box Alignment](../css_box_alignment) specification details how alignment works in various layout methods. On this page we explore how box alignment works in the context of [CSS Grid Layout](../css_grid_layout).
As this page aims to detail things which are specific to CSS Grid Layout and Box Alignment, it should be read in conjunction with the main [Box Alignment](../css_box_alignment) page which details the common features of box alignment across layout methods.
Basic example
-------------
In this example using grid layout, there is extra space in the grid container after laying out the fixed width tracks on the inline (main) axis. This space is distributed using `justify-content`. On the block (cross) axis the alignment of the items inside their grid areas is controlled with `align-items`. The first item overrides the `align-items` value set on the group by setting `align-self` to `center`.
Grid axes
---------
As a two-dimensional layout method, when working with grid layout we always have two axes on which to align our items. We have access to all of the box alignment properties to help us achieve this.
The inline axis is the axis that corresponds to the direction that words in a sentence would run in the writing mode used. Therefore, in a horizontal language such as English or Arabic the inline direction runs horizontally. Should you be in a vertical writing mode the inline axis will run vertically.
To align things on the inline axis you use the properties that start with `justify-`, [`justify-content`](../justify-content), [`justify-items`](../justify-items) and [`justify-self`](../justify-self).
The block axis crosses the inline axis in the direction that blocks are displayed down the page — for example paragraphs in English are displayed one below the other vertically. This, therefore is the block dimension.
To align things on the block axis you use the properties that start with `align-`, [`align-content`](../align-content), [`align-items`](../align-items) and [`align-self`](../align-self).
Self alignment
--------------
* [`justify-self`](../justify-self)
* [`align-self`](../align-self)
* [`place-self`](../place-self)
* [`justify-items`](../justify-items)
* [`align-items`](../align-items)
* [`place-items`](../place-items)
These properties deal with aligning the item inside the grid area it is placed into. The properties `align-items` and `justify-items` are applied to the grid container and set the `align-self` and `justify-self` properties as a group. This means that you can set alignment for all of your grid Items at once, then override any items that need a different alignment by applying the `align-self` or `justify-self` property to the rules for the individual grid Items.
The initial value for `align-self` and `justify-self` is `stretch` so the item will stretch over the entire grid area. The exception to this rule is where the item has an intrinsic aspect ratio, for example an image. In this case the item will be aligned to `start` in both dimensions in order that the image is not distorted.
Content alignment
-----------------
* [`justify-content`](../justify-content)
* [`align-content`](../align-content)
* [`place-content`](../place-content)
These properties deal with aligning the tracks of the grid when there is extra space to distribute. This scenario will occur if the tracks that you have defined total less than the total width of the grid container.
Gap and legacy grid-gap properties
----------------------------------
* [`row-gap`](../row-gap)
* [`column-gap`](../column-gap)
* [`gap`](../gap)
The Grid specification originally contained the definition for the properties [`grid-row-gap`](../row-gap), [`grid-column-gap`](../column-gap) and [`grid-gap`](../gap). These have since been moved into the Box Alignment specification and renamed to [`row-gap`](../row-gap), [`column-gap`](../column-gap), and [`gap`](../gap). This allows them to be used for other layout methods where a gap between items makes sense.
The updated properties have not yet been implemented in all browsers. Therefore, to use the gap properties in grid layout, you should use the `grid-row-gap`, `grid-column-gap` and `grid-gap` versions to ensure full compatibility. You could double up the properties and use both as you would for vendor prefixes.
Reference
---------
### CSS Properties
* [`justify-content`](../justify-content)
* [`align-content`](../align-content)
* [`place-content`](../place-content)
* [`justify-items`](../justify-items)
* [`align-items`](../align-items)
* [`place-items`](../place-items)
* [`justify-self`](../justify-self)
* [`align-self`](../align-self)
* [`place-self`](../place-self)
* [`row-gap`](../row-gap)
* [`column-gap`](../column-gap)
* [`gap`](../gap)
### Glossary Entries
* [Cross Axis](https://developer.mozilla.org/en-US/docs/Glossary/Cross_Axis)
* [Main Axis](https://developer.mozilla.org/en-US/docs/Glossary/Main_Axis)
Guides
------
* [Alignment in grid layout](../css_grid_layout/box_alignment_in_css_grid_layout)
External Resources
------------------
* [Box alignment cheatsheet](https://rachelandrew.co.uk/css/cheatsheets/box-alignment)
* [CSS Grid, Flexbox and Box Alignment](https://www.smashingmagazine.com/2016/11/css-grids-flexbox-box-alignment-new-layout-standard/)
* [Thoughts on partial implementations of Box Alignment](https://blogs.igalia.com/jfernandez/2017/05/03/can-i-use-css-box-alignment/)
css Box alignment for block, absolutely positioned and table layout Box alignment for block, absolutely positioned and table layout
===============================================================
The [Box Alignment Specification](../css_box_alignment) details how alignment works in various layout methods. In this page we explore how box alignment works in the context of block layout, including floated, positioned, and table elements. As this page aims to detail things which are specific to block layout and box alignment, it should be read in conjunction with the main [Box Alignment](../css_box_alignment) page, which details the common features of box alignment across layout methods.
**Note:** At the time of writing (May 2018), there is no real support for the box alignment properties in block layout. This document details how the specification expects these properties to be implemented for completeness, and is likely to change as the specification and browser implementations develop.
align-content and justify-content
---------------------------------
The [`justify-content`](../justify-content) property does not apply to block containers or table cells.
The [`align-content`](../align-content) property applies to the block axis in order to align the contents of the box within its container. If a content distribution method such as `space-between`, `space-around` or `space-evenly` is requested then the fallback alignment will be used, as the content is treated as a single [alignment subject](https://developer.mozilla.org/en-US/docs/Glossary/Alignment_Subject).
justify-self
------------
The [`justify-self`](../justify-self) property is used to align an item inside its containing block on the inline axis.
This property does not apply to floated elements or table cells.
align-self
----------
The [`align-self`](../align-self) property does not apply to block-level boxes (including floats), because there is more than one item in the block axis. It also does not apply to table cells.
### Absolutely positioned elements
The alignment container is the positioned block, accounting for the offset values of top, left, bottom, and right. The normal keyword resolves to `stretch`, unless the positioned item is a replaced element, in which case it resolves to `start`.
Aligning in these layout methods today
--------------------------------------
As we do not currently have browser support for box alignment in block layout, your options for alignment are either to use one of the existing alignment methods or, to make even a single item inside a container a flex item in order to use the alignment properties as specified in flexbox.
Alignment of blocks horizontally prior to flexbox was typically achieved by way of setting auto margins on the block. A [`margin`](../margin) of `auto` will absorb all available space in that dimension, therefore setting a left and right margin of auto, you can push a block into the center:
```
.container {
width: 20em;
margin-left: auto;
margin-right: auto;
}
```
In table layout, you have access to the [`vertical-align`](../vertical-align) property to align the contents of a cell inside that cell.
For many use cases, turning the block container into a flex item will give you the alignment capability that you are looking for. In the example below, a container with a single item inside has been turned into a flex container for the purpose of being able to use the alignment properties.
Reference
---------
### CSS Properties
* [`justify-content`](../justify-content)
* [`align-content`](../align-content)
* [`justify-self`](../justify-self)
* [`align-self`](../align-self)
### Glossary Entries
* [Alignment subject](https://developer.mozilla.org/en-US/docs/Glossary/Alignment_Subject)
* [Alignment container](https://developer.mozilla.org/en-US/docs/Glossary/Alignment_Container)
* [Fallback alignment](https://developer.mozilla.org/en-US/docs/Glossary/Fallback_Alignment)
css Box alignment in Flexbox Box alignment in Flexbox
========================
The [Box Alignment](../css_box_alignment) Specification details how alignment works in various layout methods; on this page, we explore how box alignment works in the context of Flexbox. As this page aims to detail things which are specific to Flexbox and box alignment, it should be read in conjunction with the main [Box Alignment](../css_box_alignment) page which details the common features of box alignment across layout methods.
Basic example
-------------
In this example, three flex items are aligned on the main axis using [`justify-content`](../justify-content) and on the cross axis using [`align-items`](../align-items). The first item overrides the `align-items` values set on the group by setting [`align-self`](../align-self) to `center`.
The axes and flex-direction
---------------------------
Flexbox respects the writing mode of the document, therefore if you are working in English and set [`justify-content`](../justify-content) to `flex-end` this will align the items to the end of the flex container. If you are working with [`flex-direction`](../flex-direction) set to `row`, this alignment will be in the inline direction.
However, in Flexbox you can change the main axis by setting `flex-direction` to `column`. In this case, `justify-content` will align items in the block direction. Therefore it is easiest to think about the main and cross axis when working in Flexbox like so:
* The main axis = direction set by `flex-direction` = alignment via `justify-content`
* The cross axis = runs across the main axis = alignment via `align-content`, `align-self`/`align-items`
### Main Axis Alignment
* [`justify-content`](../justify-content)
### Cross Axis Alignment
* [`align-self`](../align-self)
* [`align-items`](../align-items)
* [`align-content`](../align-content)
### There is no justify-self in Flexbox
On the main axis, Flexbox deals with our content as a group. The amount of space required to lay out the items is calculated, and the leftover space is then available for distribution. The `justify-content` property controls how that leftover space is used. Set `justify-content: flex-end` and the extra space is placed before the items, `justify-content: space-around` and it is placed either side of the item in that dimension, etc.
This means that a `justify-self` property does not make sense in Flexbox as we are always dealing with moving the entire group of items around.
On the cross axis `align-self` makes sense as we potentially have additional space in the flex container in that dimension, in which a single item can be moved to the start and end.
Alignment and auto margins
--------------------------
There is a specific use case in Flexbox where we might think that a `justify-self` property is what we need, and this is when we want to split a set of flex items, perhaps to create a split navigation pattern. For this use case, we can use an `auto` margin. A margin set to `auto` will absorb all available space in its dimension. This is how centering a block with auto margins works. By setting the left and right margin to `auto`, both sides of our block try to take up all of the available space and so push the box into the center.
By setting a [`margin`](../margin) of `auto` on one item in a set of flex items all aligned to start, we can create a split navigation. This works well with Flexbox and the alignment properties. As soon as there is no space available for the auto margin, the item behaves in the same way as all the other flex items and shrinks to try to fit into space.
The `gap` properties
--------------------
* [`row-gap`](../row-gap)
* [`column-gap`](../column-gap)
* [`gap`](../gap)
### Creating fixed size gaps between items
On the main axis, the `column-gap` property creates fixed size gaps between adjacent items.
On the cross axis the `row-gap` property creates spacing between adjacent flex lines, therefore `flex-wrap` must also be set to `wrap` for this to have any effect.
Reference
---------
### CSS Properties
* [`justify-content`](../justify-content)
* [`align-content`](../align-content)
* [`place-content`](../place-content)
* [`justify-items`](../justify-items)
* [`align-items`](../align-items)
* [`place-items`](../place-items)
* [`align-self`](../align-self)
* [`row-gap`](../row-gap)
* [`column-gap`](../column-gap)
* [`gap`](../gap)
### Glossary Entries
* [Cross axis](https://developer.mozilla.org/en-US/docs/Glossary/Cross_Axis)
* [Main axis](https://developer.mozilla.org/en-US/docs/Glossary/Main_Axis)
Guides
------
* [Alignment in flexbox](../css_flexible_box_layout/aligning_items_in_a_flex_container)
External Resources
------------------
* [Box alignment cheatsheet](https://rachelandrew.co.uk/css/cheatsheets/box-alignment)
* [CSS Grid, Flexbox and Box Alignment](https://www.smashingmagazine.com/2016/11/css-grids-flexbox-box-alignment-new-layout-standard/)
* [Thoughts on partial implementations of Box Alignment](https://blogs.igalia.com/jfernandez/2017/05/03/can-i-use-css-box-alignment/)
css Mastering wrapping of flex items Mastering wrapping of flex items
================================
Flexbox was designed as a single dimensional layout, meaning that it deals with laying out items as a row or as a column — but not both at once. There is however the ability to wrap flex items onto new lines, creating new rows if [`flex-direction`](../flex-direction) is `row` and new columns if `flex-direction` is `column`. In this guide I will explain how this works, what it is designed for and what situations really require [CSS Grid Layout](../css_grid_layout) rather than flexbox.
Making things wrap
------------------
The initial value of the [`flex-wrap`](../flex-wrap) property is `nowrap`. This means that if you have a set of flex items that are too wide for their container, they will overflow it. If you want to cause them to wrap once they become too wide you must add the `flex-wrap` property with a value of `wrap`, or use the shorthand [`flex-flow`](../flex-flow) with values of `row wrap` or `column wrap`.
Items will then wrap in the container. In the next example I have ten items all with a `flex-basis` of `160px` and the ability to grow and shrink. Once the first row gets to a point where there is not enough space to place another 160 pixel item, a new flex line is created for the items and so on until all of the items are placed. As the items can grow, they will expand larger than 160 px in order to fill each row completely. If there is only one item on the final line it will stretch to fill the entire line.
We can see the same thing happening with columns. The container will need to have a height in order that the items will start wrapping and creating new columns, and items will stretch taller to fill each column completely.
Wrapping and flex-direction
---------------------------
Wrapping works as you might expect when combined with `flex-direction`. If `flex-direction` is set to `row-reverse` then the items will start from the end edge of the container and lay themselves out in reverse ordered lines.
Note that the reversing is only happening in the inline, row direction. We start on the right then go onto the second line and again start from the right. We aren't reversing in both directions, starting from the bottom coming up the container!
Single-dimensional layout explained
-----------------------------------
As we have seen from the above examples if our items are allowed to grow and shrink, when there are fewer items in the last row or column then those items grow to fill the available space.
There is no method in flexbox to tell items in one row to line up with items in the row above — each flex line acts like a new flex container. It deals with space distribution across the main axis. If there is only one item, and that item is allowed to grow, it will fill the axis just as if you had a single item flex container.
If you want layout in two dimensions then you probably want Grid Layout. We can compare our wrapped row example above with the CSS Grid version of that layout to see the difference. The following live sample uses CSS Grid Layout to create a layout that has as many columns of at least 160 pixels as will fit, distributing the extra space between all columns. However, in this case the items stay in their grid and don't stretch out when there are fewer of them on the final row.
This is the difference between one and two-dimensional layout. In a one dimensional method like flexbox, we only control the row or column. In two dimensional layout like grid we control both at the same time. If you want the space distribution row by row, use flexbox. If you don't, use Grid.
How do flexbox-based grid systems work?
---------------------------------------
Typically flexbox-based grid systems work by taking flexbox back to the familiar world of float-based layouts. If you assign percentage widths to flex items — either as `flex-basis` or by adding a width to the item itself leaving the value of `flex-basis` as `auto` — you can get the impression of a two dimensional layout. You can see this working in the example below.
Here I have set `flex-grow` and `flex-shrink` to `0` to make inflexible flex items and I'm then controlling flexibility using percentages, just like we used to do in float layouts.
If you need flex items to line up in the cross axis, controlling the width in this way will achieve that. In most cases however, adding widths to flex items in this way demonstrates that you would probably be better served by switching to grid layout for that component.
Creating gutters between items
------------------------------
When wrapping flex items, the need to space them out is likely to arise. You can see from the live example below that in order to create gaps that do not also create a gap at the edges of the container, we need to use negative margins on the flex container itself. Any border on the flex container is then moved to a second wrapper in order that the negative margin can pull the items up to that wrapper element.
It is this requirement that the gap properties, once implemented, will solve for us. Proper gaps only happen on the inside edges of items.
Collapsed items
---------------
The flexbox specification details what should happen if a flex item is collapsed by setting `visibility: collapse` on an item. See the MDN documentation for the [`visibility`](../visibility) property. The specification describes the behavior as follows:
> "Specifying visibility:collapse on a flex item causes it to become a collapsed flex item, producing an effect similar to visibility:collapse on a table-row or table-column: the collapsed flex item is removed from rendering entirely, but leaves behind a "strut" that keeps the flex line's cross-size stable. Thus, if a flex container has only one flex line, dynamically collapsing or uncollapsing items may change the flex container's main size, but is guaranteed to have no effect on its cross size and won't cause the rest of the page's layout to "wobble". Flex line wrapping is re-done after collapsing, however, so the cross-size of a flex container with multiple lines might or might not change." - [Collapsed items](https://www.w3.org/TR/css-flexbox-1/#visibility-collapse)
>
>
This behavior is useful if you want to target flex items using JavaScript to show and hide content for example. The example in the specification demonstrates one such pattern.
In the following live example I have a non-wrapped flex container. The third item has more content than the others yet is set to `visibility: collapse` and therefore the flex container is retaining a *strut* of the height required to display this item. If you remove `visibility: collapse` from the CSS or change the value to `visible`, you will see the item disappear and the space redistribute between non-collapsed items; the height of the flex container should not change.
**Note:** Use Firefox for the below two examples as Chrome and Safari treat collapse as hidden.
When dealing with multiple-line flex containers however you need to understand that the wrapping is re-done *after* collapsing. So the browser needs to re-do the wrapping behavior to account for the new space that the collapsed item has left in the inline direction.
This means that items might end up on a different line to the one they started on. In the case of an item being shown and hidden it could well cause the items to end up in a different row.
I have created this behavior in the next live example. You can see how the stretching changes row based on the location of the collapsed item. If you add more content to the second item, it changes row once it gets long enough. That top row then only becomes as tall as a single line of text.
If this causes a problem for your layout it may require a rethinking of the structure, for example putting each row into a separate flex container in order that they can't shift rows.
### The difference between `visibility: hidden` and `display: none`
When you set an item to `display: none` in order to hide it, the item is removed from the formatting structure of the page. What this means in practice is that counters ignore it, and things like transitions do not run. Using `visibility: hidden` keeps the box in the formatting structure which is useful in that it still behaves as if it were part of the layout even though the user can't see it.
| programming_docs |
css Controlling ratios of flex items along the main axis Controlling ratios of flex items along the main axis
====================================================
In this guide we will be exploring the three properties that are applied to flex items, which enable us to control the size and flexibility of the items along the main axis — [`flex-grow`](../flex-grow), [`flex-shrink`](../flex-shrink), and [`flex-basis`](../flex-basis). Fully understanding how these properties work with growing and shrinking items is the real key to mastering flexbox.
A first look
------------
Our three properties control the following aspects of a flex item's flexibility:
* `flex-grow`: How much of the positive free space does this item get?
* `flex-shrink`: How much negative free space can be removed from this item?
* `flex-basis`: What is the size of the item before growing and shrinking happens?
The properties are usually expressed as the shorthand [`flex`](../flex) property. The following code would set the `flex-grow` property to `2`, `flex-shrink` to `1` and `flex-basis` to `auto`.
```
.item {
flex: 2 1 auto;
}
```
If you have read the article [Basic Concepts of Flexbox](basic_concepts_of_flexbox), then you will have already had an introduction to the properties. Here we will explore them in depth in order that you can fully understand what the browser is doing when you use them.
Important concepts when working on the main axis
------------------------------------------------
There are a few concepts worth digging into before looking at how the flex properties work to control ratios along the main axis. These relate to the *natural* size of flex items before any growing or shrinking takes place, and to the concept of free space.
### Flex item sizing
In order to work out how much space there is available to lay out flex items, the browser needs to know how big the item is to start with. How is this worked out for items that don't have a width or a height applied using an absolute length unit?
There is a concept in CSS of [`min-content`](../width#min-content) and [`max-content`](../width#max-content) — these keywords are [defined in the CSS Intrinsic and Extrinsic Sizing Specification](https://drafts.csswg.org/css-sizing-3/#width-height-keywords), and can be used in place of a [length unit](../length).
In the live example below for instance I have two paragraph elements that contain a string of text. The first paragraph has a width of `min-content`. You should be able to see that the text has taken all of the soft wrapping opportunities available to it, becoming as small as it can be without overflowing. This then, is the `min-content` size of that string. Essentially, the longest word in the string is dictating the size.
The second paragraph has a value of `max-content` and so it does the opposite. It gets as big as it possibly can be, taking no soft-wrapping opportunities. It would overflow the box it is in if that container was too narrow.
Remember this behavior and what effects `min-content` and `max-content` have as we explore `flex-grow` and `flex-shrink` later in this article.
### Positive and negative free space
To talk about these properties we need to understand the concept of **positive and negative free space**. When a flex container has positive free space, it has more space than is required to display the flex items inside the container. For example, if I have a 500 pixel-wide container, [`flex-direction`](../flex-direction) is `row`, and I have three flex items each 100 pixels wide, then I have 200 pixels of positive free space, which could be distributed between the items if I wanted them to fill the container.
We have negative free space when the natural size of the items adds up to larger than the available space in the flex container. If I have a 500 pixel-wide container like the one above, but the three flex items are each 200 pixels wide, the total space I need will be 600 pixels, so I have 100 pixels of negative free space. This could be removed from the items in order to make them fit the container.
It is this distribution of positive free space and removal of negative free space that we need to understand in order to understand the flex properties.
In the following examples I am working with [`flex-direction`](../flex-direction) set to row, therefore the size of items will always come from their width. We will be calculating the positive and negative free space created by comparing the total width of all the items with the container width. You could equally try out each example with `flex-direction: column`. The main axis would then be the column, and you would then need to compare the height of the items and that of the container they are in to work out the positive and negative free space.
The flex-basis property
-----------------------
The [`flex-basis`](../flex-basis) property specifies the initial size of the flex item before any space distribution happens. The initial value for this property is `auto`. If `flex-basis` is set to `auto` then to work out the initial size of the item the browser first checks if the main size of the item has an absolute size set. This would be the case if you had given your item a width of 200 pixels. In that case `200px` would be the `flex-basis` for this item.
If your item is instead auto-sized, then `auto` resolves to the size of its content. At this point your knowledge of `min-` and `max-content` sizing becomes useful, as flexbox will take the `min-content` size of the item as the `flex-basis`. The following live example can help to demonstrate this.
In this example I have created a series of inflexible boxes, with both `flex-grow` and `flex-shrink` set to `0`. Here we can see how the first item — which has an explicit width of 150 pixels set as the main size — takes a `flex-basis` of `150px`, whereas the other two items have no width and so are sized according to their content width.
In addition to the `auto` keyword, you can use the `content` keyword as the `flex-basis`. This will result in the `flex-basis` being taken from the content size even if there is a width set on the item. You can also get the same effect by using `auto` as the flex-basis and ensuring that your item does not have a width set, in order that it will be auto-sized.
If you want flexbox to completely ignore the size of the item when doing space distribution then set `flex-basis` to `0`. This essentially tells flexbox that all the space is up for grabs, and to share it out in proportion. We will see examples of this as we move on to look at `flex-grow`.
The flex-grow property
----------------------
The [`flex-grow`](../flex-grow) property specifies the **flex grow factor**, which determines how much the flex item will grow relative to the rest of the flex items in the flex container when the positive free space is distributed.
If all of your items have the same `flex-grow` factor then space will be distributed evenly between all of them. If this is the situation that you want then typically you would use `1` as the value, however you could give them all a `flex-grow` of `88`, or `100`, or `1.2` if you like — it is a ratio. If the factor is the same for all, and there is positive free space in the flex container then it will be distributed equally to all.
### Combining `flex-grow` and `flex-basis`
Things can get confusing in terms of how `flex-grow` and `flex-basis` interact. Let's consider the case of three flex items of differing content lengths and the following `flex` rules applied to them:
`flex: 1 1 auto;`
In this case the `flex-basis` value is `auto` and the items don't have a width set, and so are auto-sized. This means that flexbox is looking at the `max-content` size of the items. After laying the items out we have some positive free space in the flex container, shown in this image as the hatched area:
We are working with a `flex-basis` equal to the content size so the available space to distribute is subtracted from the total available space (the width of the flex container), and the leftover space is then shared out equally among each item. Our bigger item ends up bigger because it started from a bigger size, even though it has the same amount of spare space assigned to it as the others:
If what you actually want is three equally-sized items, even if they start out at different sizes, you should use this:
`flex: 1 1 0;`
Here we are saying that the size of the item for the purposes of our space distribution calculation is `0` — all the space is up for grabs and as all of the items have the same `flex-grow` factor, they each get an equal amount of space distributed. The end result is three equal width, flexible items.
Try changing the `flex-grow` factor from 1 to 0 in this live example to see the different behavior:
### Giving items different flex-grow factors
Our understanding of how `flex-grow` works with `flex-basis` allows us to have further control over our individual item sizes by assigning items different `flex-grow` factors. If we keep our `flex-basis` at `0` so all of the space can be distributed, we could assign each of the three flex items a different `flex-grow` factor. In the example below I am using the following values:
* `1` for the first item.
* `1` for the second item.
* `2` for the third item.
Working from a `flex-basis` of `0` this means that the available space is distributed as follows. We need to add up the flex grow factors, then divide the total amount of positive free space in the flex container by that number, which in this case is 4. We then share out the space according to the individual values — the first item gets one part, the second one part, the third two parts. This means that the third item is twice the size of the first and second items.
Remember that you can use any positive value here. It is the ratio between one item and the others that matters. You can use large numbers, or decimals — it is up to you. To test that out change the values assigned in the above example to `.25`, `.25`, and `.50` — you should see the same result.
The flex-shrink property
------------------------
The [`flex-shrink`](../flex-shrink) property specifies the **flex shrink factor**, which determines how much the flex item will shrink relative to the rest of the flex items in the flex container when negative free space is distributed.
This property deals with situations where the browser calculates the `flex-basis` values of the flex items, and finds that they are too large to fit into the flex container. As long as `flex-shrink` has a positive value the items will shrink in order that they do not overflow the container.
So where `flex-grow` deals with adding available space, `flex-shrink` manages taking away space to make boxes fit into their container without overflowing.
In the next live example I have three items in a flex container; I've given each a width of 200 pixels, and the container is 500 pixels wide. With `flex-shrink` set to `0` the items are not allowed to shrink and so they overflow the box.
Change the `flex-shrink` value to `1` and you will see each item shrink by the same amount, in order that all of the items now fit in the box. They have become smaller than their initial width in order to do so.
### Combining `flex-shrink` and `flex-basis`
You could say that `flex-shrink` works in pretty much the same way as `flex-grow`. However there are two reasons why it isn't *quite* the same.
While it is usually subtle, defined in the specification is one reason why `flex-shrink` isn't quite the same for negative space as `flex-grow` is for positive space:
> "Note: The flex shrink factor is multiplied by the flex base size when distributing negative space. This distributes negative space in proportion to how much the item is able to shrink, so that e.g. a small item won't shrink to zero before a larger item has been noticeably reduced."
>
>
The second reason is that flexbox prevents small items from shrinking to zero size during this removal of negative free space. The items will be floored at their `min-content` size — the size that they become if they take advantage of any soft wrapping opportunities available to them.
You can see this `min-content` flooring happen in the below example, where the `flex-basis` is resolving to the size of the content. If you change the width on the flex container — increasing it to 700px for example — and then reduce the flex item width, you can see that the first two items will wrap, however they will never become smaller than that `min-content` size. As the box gets smaller space is then just removed from the third item.
In practice the shrinking behavior does tend to give you reasonable results. You don't usually want your content to disappear completely or for boxes to get smaller than their minimum content, so the above rules make sense in terms of sensible behavior for content that needs to be shrunk in order to fit into a container.
### Giving items different `flex-shrink` factors
In the same way as `flex-grow`, you can give flex-items different `flex-shrink` factors. This can help change the default behavior if, for example, you want an item to shrink more or less rapidly than its siblings or not shrink at all.
In the following live example the first item has a `flex-shrink` factor of 1, the second `0` (so it won't shrink at all), and the third `4`. The third item therefore shrinks more rapidly than the first. Play around with the different values — as for `flex-grow` you can use decimals or larger numbers here. Choose whatever makes most sense to you.
Mastering sizing of flex items
------------------------------
The key to really understanding how flex item sizing works is in understanding the number of things that come into play. Consider the following aspects, which we have already discussed in these guides:
### What sets the base size of the item?
1. Is `flex-basis` set to `auto`, and does the item have a width set? If so, the size will be based on that width.
2. Is `flex-basis` set to `auto` or `content`? If so, the size is based on the item size.
3. Is `flex-basis` a length unit, but not zero? If so this is the size of the item.
4. Is `flex-basis` set to `0`? if so then the item size is not taken into consideration for the space-sharing calculation.
### Do we have available space?
Items can't grow with no positive free space, and they won't shrink unless there is negative free space.
1. If we took all of the items and added up their widths (or heights if working in a column), is that total **less** than the total width (or height) of the container? If so, then you have positive free space and `flex-grow` comes into play.
2. If we took all of the items and added up their widths (or heights if working in a column), is that total **more** than the total width (or height) of the container? If so, you have negative free space and `flex-shrink` comes into play.
### Other ways to distribute space
If you do not want space added to the items, remember that you can deal with free space between or around items using the alignment properties described in the guide to aligning items in a flex container. The [`justify-content`](../justify-content) property will enable the distribution of free space between or around items. You can also use auto margins on flex items to absorb space and create gaps between items.
With all the flex tools at your disposal you will find that most tasks can be achieved, although it might take a little bit of experimentation at first.
css Typical use cases of flexbox Typical use cases of flexbox
============================
In this guide, we will take a look at some of the common use cases for flexbox — those places where it makes more sense than another layout method.
Why choose flexbox?
-------------------
In a perfect world of browser support, the reason you'd choose to use flexbox is because you want to lay a collection of items out in one direction or another. As you lay out your items you want to control the dimensions of the items in that one dimension, or control the spacing between items. These are the uses that flexbox was designed for. You can read more about the difference between flexbox and CSS Grid Layout in [Relationship of Flexbox to other layout methods](relationship_of_flexbox_to_other_layout_methods), where we discuss how flexbox fits into the overall picture of CSS Layout.
In reality we also often use Flexbox for jobs that might be better done by Grid Layout, as a fallback for Grid, and also in order to get alignment capabilities. This is something that may well change once Box Alignment is implemented in Block Layout. In this guide we'll look at some of the typical things you might use flexbox for today.
Navigation
----------
A common pattern for navigation is to have a list of items displayed as a horizontal bar. This pattern, as basic as it seems, was difficult to achieve before flexbox. It forms the most simple of flexbox examples, and could be considered the ideal flexbox use case.
When we have a set of items that we want to display horizontally, we may well end up with additional space. We need to decide what to do with that space, and have a couple of options. We either display the space outside of the items — therefore spacing them out with white space between or around them — or we absorb the extra space inside the items and therefore need a method of allowing the items to grow and take up this space.
### Space distributed outside the items
To distribute the space between or around the items we use the alignment properties in flexbox, and the [`justify-content`](../justify-content) property. You can read more about this property in [Aligning Items in a flex container](aligning_items_in_a_flex_container), which deals with aligning items on the main axis.
In the below live example we display the items at their natural size and by using `justify-content: space-between` make equal amounts of space between the items. You can change how the space is distributed using the `space-around` value, or where supported, `space-evenly`. You could also use `flex-start` to place the space at the end of the items, `flex-end` to place it before them, or `center` to center the navigation items.
### Space distributed within the items
A different pattern for navigation would be to distribute the available space within the items themselves, rather than create space between them. In this case we would use the [`flex`](../flex) properties to allow items to grow and shrink in proportion to one another as described in [Controlling ratios of flex items along the main axis](controlling_ratios_of_flex_items_along_the_main_ax).
If you wanted to respect the size property of my navigation items but have the available space shared out equally among them, then you might use `flex: auto`, which is the shorthand for `flex: 1 1 auto` — all items grow and shrink from a flex-basis of auto. This would mean that the longer item would have more space because it started from a larger size, even though the same amount of available space is assigned to it as the others.
In the live example below try changing `flex: auto` to `flex: 1`. This is the shorthand for `flex: 1 1 0` and causes all of the items to become the same width, as they are working from a flex-basis of 0 allowing all of the space to be distributed evenly.
Split navigation
----------------
Another way to align items on the main axis is to use auto margins. This enables the design pattern of a navigation bar where one group of items are aligned left and another group aligned right.
Here we are using the auto margins technique described in [Using auto margins for main axis alignment](aligning_items_in_a_flex_container#using_auto_margins_for_main_axis_alignment). The items are aligned on the main axis with `flex-start` as this is the initial behavior of flexbox, and we are aligning the item on the right by giving it a left margin of auto. You can move the class from one item to another to change where the split happens.
Also in this example we are using margins on the flex items to create a gap between items, and a negative margin on the container in order that the items still remain flush with the right and left edges. Until the `gap` properties from the Box Alignment specification are implemented in flexbox, we have to use margins in this way if we want to create a gutter between items.
Center item
-----------
Before flexbox, developers would joke that the hardest problem in web design was vertical centering. This has now been made straightforward using the alignment properties in flexbox, as the following live example shows.
You can play with the alignment, aligning the item to the start with `flex-start` or end with `flex-end`.
In the future we may not need to make a container a flex container just to center a single item, as the Box Alignment properties will ultimately be implemented in Block layout. For now however, if you need to properly center one thing inside another, flexbox is the way to do it. As in the example above, make a container into a flex container, and then use either `align-items` on the parent element or target the flex item itself with `align-self`.
Card layout pushing footer down
-------------------------------
Whether you use flexbox or CSS Grid to lay out a list of card components, these layout methods only work on direct children of the flex or grid component. This means that if you have variable amounts of content, the card will stretch to the height of the grid area or flex container. Any content inside uses regular block layout, meaning that on a card with less content the footer will rise up to the bottom of the content rather than stick to the bottom of the card.
Flexbox can solve this. We make the card a flex container, with [`flex-direction`](../flex-direction)`: column`. We then set the content area to `flex: 1`, which is the shorthand for `flex: 1 1 0` — the item can grow and shrink from a flex basis of `0`. As this is the only item that can grow, it takes up all available space in the flex container and pushes the footer to the bottom. If you remove the `flex` property from the live example you will see how the footer then moves up to sit directly under the content.
Media objects
-------------
The media object is a common pattern in web design — this pattern has an image or other element to one side and text to the right. Ideally a media object should be able to be flipped — moving the image from left to right.
We see this pattern everywhere, used for comments, and anywhere we need to display images and descriptions. With flexbox we can allow the part of the media object containing the image to take its sizing information from the image, and then the body of the media object flexes to take up the remaining space.
In the live example below you can see our media object. I have used the alignment properties to align the items on the cross axis to `flex-start`, and then set the `.content` flex item to `flex: 1`. As with our column layout card pattern above, using `flex: 1` means this part of the card can grow.
Some things that you might want to try in this live example relate to the different ways you might want to constrain the media object in your design.
To prevent the image growing too large, add a [`max-width`](../max-width) to the image. As that side of the media object is using the initial values of flexbox it can shrink but not grow, and uses a `flex-basis` of auto. Any [`width`](../width) or max-width applied to the image will become the `flex-basis`.
```
.image img {
max-width: 100px;
}
```
You could also allow both sides to grow and shrink in proportion. If you set both sides to `flex: 1`, they will grow and shrink from a [`flex-basis`](../flex-basis) of 0, so you will end up with two equal-sized columns. You could either take the content as a guide and set both to `flex: auto`, in which case they would grow and shrink from the size of the content or any size applied directly to the flex items such as a width on the image.
```
.media .content {
flex: 1;
padding: 10px;
}
.image {
flex: 1;
}
```
You could also give each side different [`flex-grow`](../flex-grow) factors, for example setting the side with the image to `flex: 1` and the content side to `flex: 3`. This will mean they use a `flex-basis` of `0` but distribute that space at different rates according to the `flex-grow` factor you have assigned. The flex properties we use to do this are described in detail in the guide [Controlling ratios of flex items along the main axis](controlling_ratios_of_flex_items_along_the_main_ax).
```
.media .content {
flex: 3;
padding: 10px;
}
.image {
flex: 1;
}
```
### Flipping the media object
To switch the display of the media object so that the image is on the right and the content is on the left we can use the `flex-direction` property set to `row-reverse`. The media object now displays the other way around. I have achieved this in the live example by adding a class of `flipped` alongside the existing `.media` class. This means you can see how the display changes by removing that class from the HTML.
Form controls
-------------
Flexbox is particularly useful when it comes to styling form controls. Forms have lots of markup and lots of small elements that we typically want to align with each other. A common pattern is to have an [`<input>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input) element paired with a [`<button>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button), perhaps for a search form or where you want your visitor to enter an email address.
Flexbox makes this type of layout easy to achieve. I have contained my `<button>` and `<input>` field in a wrapper which I have given a border and set to `display: flex`. I then use the flex properties to allow the `<input>` field to grow, while the button does not grow. This means we have a pair of fields, with the text field growing and shrinking as the available space changes.
You could add a label or icon to the left as easily as we popped the button onto the right. I have added a label, and other than some styling for background color I didn't need to change the layout. The stretchy input field now has a little less space to play with but it uses the space left after the two items are accounted for.
Patterns like this can make it much easier to create a library of form elements for your design, which easily accommodate additional elements being added. You are taking advantage of the flexibility of flexbox by mixing items that do not grow with those that do.
Conclusion
----------
While exploring the above patterns you have hopefully started to see how you can think through the best way to use flexbox to achieve the result that you want. Quite often you have more than one choice. Mix items that cannot stretch with those that can, use the content to inform the size, or allow flexbox to share out space in proportion. It's up to you.
Think about the best way to present the content that you have and then see how flexbox or other layout methods can help you achieve it.
| programming_docs |
css Relationship of flexbox to other layout methods Relationship of flexbox to other layout methods
===============================================
In this article we will take a look at how Flexbox fits in with all the other CSS modules. We'll find out which specifications you also need to take notice of if you want to learn flexbox, and find out why flexbox is different to some other modules.
**Note:** CSS versions 1 and 2 were a single monolithic specification where all of CSS was defined in one large document. As CSS became a more feature rich language, maintaining one huge specification became problematic, with different parts of CSS moving on at different speeds. CSS was therefore modularized, and the various CSS Specifications are different modules that make up CSS today. These modules relate to each other, and are at different stages of development.
The box alignment module
------------------------
For many people the first reason they start to look at flexbox is because of the ability to properly align flex items inside a flex container. Flexbox provides access to properties that allow the alignment of items on their cross axis and justification of items on the main axis.
These properties started life in the flexbox specification, but are now also part of the [Box Alignment Specification](https://www.w3.org/TR/css-align-3/). This specification details how alignment works in all layout — not just flexbox. Box alignment deals with alignment and justification, including creating gaps or gutters between flex items.
The reason that the Box alignment properties remain detailed in the flexbox specification as well as being in box alignment is to ensure that completion of the flexbox spec is not held up by box alignment, which has to detail these methods for all layout types. There is a note in the flexbox spec stating that in the future, once it is completed, the definitions in Box Alignment Level 3 will supersede those of flexbox:
> "Note: While the alignment properties are defined in CSS Box Alignment [CSS-ALIGN-3], Flexible Box Layout reproduces the definitions of the relevant ones here so as to not create a normative dependency that may slow down advancement of the spec. These properties apply only to flex layout until CSS Box Alignment Level 3 is finished and defines their effect for other layout modes. Additionally, any new values defined in the Box Alignment module will apply to Flexible Box Layout; in other words, the Box Alignment module, once completed, will supersede the definitions here."
>
>
In a later article in this series — [Aligning items in a flex container](aligning_items_in_a_flex_container) — we will take a thorough look at how the Box Alignment properties apply to flex items.
Writing Modes
-------------
In the [Basic concepts of flexbox](basic_concepts_of_flexbox) article, I explained that flexbox is **writing mode aware**. Writing modes are fully detailed in the CSS [Writing Modes specification](https://www.w3.org/TR/css-writing-modes-3/), which details how CSS supports the various different writing modes that exist internationally. We need to be aware of how this will impact our flex layouts as writing mode changes the direction that blocks are laid out in our document. Understanding **block** and **inline** directions is key to new layout methods.
It is worth noting that we might want to change the writing mode of our document for reasons other than publishing content in a language that uses a different writing mode. See [this article](https://24ways.org/2016/css-writing-modes/) for a full description of writing modes and ways to use them, both for content in other languages and for creative reasons.
### The writing modes
The writing modes specification defines the following values of the [`writing-mode`](../writing-mode) property, which serve to change the direction that blocks are laid out on the page, to match the direction that blocks lay out when content is formatted in that particular writing mode. You can change the live example below to these modes in order to see what happens to the flex layout.
* `horizontal-tb`
* `vertical-rl`
* `vertical-lr`
* `sideways-rl`
* `sideways-lr`
Note that `sideways-rl` and `sideways-lr` have support only in Firefox currently. There are also some known issues with regard to `writing-mode` and flexbox. You can see more information on browser support in the [MDN documentation for writing-mode](../writing-mode). However if you are planning on using writing modes in your layout, carefully testing the results is advisable — not least because it would be easy to make things hard to read!
Note that you would not normally use CSS and the `writing-mode` property to change an entire document to another writing mode. This would be done via HTML, by adding a `dir` and `lang` attribute to the `html` element to indicate the document language and default text direction. This would mean that the document would display correctly even if CSS did not load.
Flexbox and other layout methods
--------------------------------
The flexbox specification contains a [definition of what happens](https://www.w3.org/TR/css-flexbox-1/#flex-containers) if an item uses another layout method and then becomes a flex item. For example, if an item is floated and then its parent becomes a flex container. Or, how a flex container behaves as part of layout.
An element set to `display: flex` behaves in most ways like any other block level container that establishes a containing block. Floats will not intrude, and the containers' margins will not collapse.
With regard to flex items, if an item was floated or cleared and then becomes a flex item due to the parent having `display: flex` applied, the floating and clearing will no longer happen, and the item will not be taken out of normal flow in the way that floats are. If you have used the [`vertical-align`](../vertical-align) property, as used with `inline-block` or table layout for alignment, this will no longer affect the item and you can use the alignment properties of flexbox instead.
In this next live example the child elements have been floated, and then their container has had `display: flex` added. If you remove `display: flex`, you should see that the `.box` element collapses as we have no clearing applied. This demonstrates that the float is happening. Re-apply `display: flex` and the collapsing does not happen. This is because the items no longer have a float applied, as they have been transformed into flex items.
Flexbox and Grid Layout
-----------------------
[CSS Grid Layout](../css_grid_layout) and Flexbox generally act in the same way with regards to overwriting other methods. You might however want to use flexbox as a fallback for grid layout, as there is better support for flexbox in older browsers. This approach works very well. If a flex item becomes a grid item, then the `flex` properties that may have been assigned to the child elements will be ignored.
You can use the Box Alignment properties across both layout methods, so using flexbox as a fallback for grid layout can work very well.
### Flex and grid — what's the difference?
A common question is to ask what the difference is between Flexbox and CSS Grid Layout — why do we have two specifications that sometimes appear to be doing the same thing?
The most straightforward answer to this question is defined in the specifications themselves. Flexbox is a one-dimensional layout method whereas Grid Layout is a two-dimensional layout method. The example below has a flex layout. As already described in the Basic concepts article, flex items can be allowed to wrap but, once they do so, each line becomes a flex container of its own. When space is distributed flexbox does not look at the placement of items in other rows and tries to line things up with each other.
If we create a very similar layout using Grid, we can control the layout in both rows and columns.
These examples point to another key difference between these layout methods. In Grid Layout you do the majority of sizing specification on the container, setting up tracks and then placing items into them. In flexbox, while you create a flex container and set the direction at that level, any control over item sizing needs to happen on the items themselves.
In some cases you could happily use either layout method, but as you become confident with both you will find each one suiting different layout needs, and you will end up with both methods in your CSS. There is rarely a right or wrong answer.
As a ground rule, if you are adding widths to flex items in order to make items in one row of a wrapped flex container line up with the items above them you really want two-dimensional layout. In this case it is likely that the component would be better laid out using CSS Grid Layout. It isn't the case that you should use flexbox for small components and grid layout for larger ones; a tiny component can be two dimensional, and a large layout can be represented better with layout in one dimension. Try things out — we have a choice in layout method for the first time, so take advantage of it.
For more comparisons of grid and flexbox see the article [Relationship of Grid Layout to other layout methods](../css_grid_layout/relationship_of_grid_layout). This article details many of the ways that Grid Layout differs from flex layout, and demonstrates some of the extra functionality you get when using Grid Layout such as layering of items on the grid. This may also help in your decision as to which layout method to use.
Flexbox and display: contents
-----------------------------
The `contents` value of the [`display`](../display) property is a new value that is described in the spec as follows:
> "The element itself does not generate any boxes, but its children and pseudo-elements still generate boxes as normal. For the purposes of box generation and layout, the element must be treated as if it had been replaced with its children and pseudo-elements in the document tree."
>
>
This value of `display` controls box generation, and whether the element should generate a box that we can style and see on the page, or whether instead the box it would normally create should be removed and the child elements essentially moved up to participate in whatever layout method the parent would have been part of. This is much easier to see with an example.
In the following live example I have a flex container with three child elements. One of these flex items has two elements nested inside it, which would not ordinarily participate in flex layout. Flex layout only applies to the direct children of a flex container.
By adding `display: contents` to the wrapper around the nested elements, you can see that the item has disappeared from the layout, allowing the two sub-children to be laid out as if they were direct children of the flex container. You can try removing the `display: contents` line to see it return.
Note that this only removes the box from the layout; the sub-children don't become direct children in any other way. You can see that as I have used a direct child selector to add the background and borders to the flex items, this has not been applied to our nested children. They have been laid out as flex items, but as they are not direct children they do not get the other styling.
**Warning:** Current implementations in most browsers will remove any element with `display: contents` from the accessibility tree (but descendants will remain). This will cause the element itself to no longer be announced by screen reading technology. This is incorrect behavior according to the specification, see [`display: contents`](../display#display_contents).
Also, having removed the box you cannot then use it to — for example — add a background color behind the nested sub children. If you remove `display: contents` in this live example you will see that the direct child we are removing has an orange background color. This also disappears when the box disappears.
Browser support for `display:contents` is limited and required for this demo to work. Firefox supports `display: contents` already, and the value is being implemented in Chrome. Once there is better browser support this feature will be very useful in circumstances where you need the markup for semantic reasons but do not want to display the box that it would generate by default.
css Basic concepts of flexbox Basic concepts of flexbox
=========================
The Flexible Box Module, usually referred to as flexbox, was designed as a one-dimensional layout model, and as a method that could offer space distribution between items in an interface and powerful alignment capabilities. This article gives an outline of the main features of flexbox, which we will be exploring in more detail in the rest of these guides.
When we describe flexbox as being one dimensional we are describing the fact that flexbox deals with layout in one dimension at a time — either as a row or as a column. This can be contrasted with the two-dimensional model of [CSS Grid Layout](../css_grid_layout), which controls columns and rows together.
The two axes of flexbox
-----------------------
When working with flexbox you need to think in terms of two axes — the main axis and the cross axis. The main axis is defined by the [`flex-direction`](../flex-direction) property, and the cross axis runs perpendicular to it. Everything we do with flexbox refers back to these axes, so it is worth understanding how they work from the outset.
### The main axis
The main axis is defined by `flex-direction`, which has four possible values:
* `row`
* `row-reverse`
* `column`
* `column-reverse`
Should you choose `row` or `row-reverse`, your main axis will run along the row in the **inline direction**.
Choose `column` or `column-reverse` and your main axis will run from the top of the page to the bottom — in the **block direction**.
### The cross axis
The cross axis runs perpendicular to the main axis, therefore if your `flex-direction` (main axis) is set to `row` or `row-reverse` the cross axis runs down the columns.
If your main axis is `column` or `column-reverse` then the cross axis runs along the rows.
Start and end lines
-------------------
Another vital area of understanding is how flexbox makes no assumption about the writing mode of the document. In the past, CSS was heavily weighted towards horizontal and left-to-right writing modes. Modern layout methods encompass the range of writing modes and so we no longer assume that a line of text will start at the top left of a document and run towards the right-hand side, with new lines appearing one under the other.
You can [read more about the relationship between flexbox and the Writing Modes specification](relationship_of_flexbox_to_other_layout_methods#writing_modes) in a later article; however, the following description should help explain why we do not talk about left and right and top and bottom when we describe the direction that our flex items flow in.
If the `flex-direction` is `row` and I am working in English, then the start edge of the main axis will be on the left, the end edge on the right.
If I were to work in Arabic, then the start edge of my main axis would be on the right and the end edge on the left.
In both cases the start edge of the cross axis is at the top of the flex container and the end edge at the bottom, as both languages have a horizontal writing mode.
After a while, thinking about start and end rather than left and right becomes natural, and will be useful to you when dealing with other layout methods such as CSS Grid Layout which follow the same patterns.
The flex container
------------------
An area of a document laid out using flexbox is called a **flex container**. To create a flex container, we set the value of the area's container's [`display`](../display) property to `flex` or `inline-flex`. As soon as we do this the direct children of that container become **flex items**. As with all properties in CSS, some initial values are defined, so when creating a flex container all of the contained flex items will behave in the following way.
* Items display in a row (the `flex-direction` property's default is `row`).
* The items start from the start edge of the main axis.
* The items do not stretch on the main dimension, but can shrink.
* The items will stretch to fill the size of the cross axis.
* The [`flex-basis`](../flex-basis) property is set to `auto`.
* The [`flex-wrap`](../flex-wrap) property is set to `nowrap`.
The result of this is that your items will all line up in a row, using the size of the content as their size in the main axis. If there are more items than can fit in the container, they will not wrap but will instead overflow. If some items are taller than others, all items will stretch along the cross axis to fill its full size.
You can see in the live example below how this looks. Try editing the items or adding additional items in order to test the initial behavior of flexbox.
### Changing flex-direction
Adding the [`flex-direction`](../flex-direction) property to the flex container allows us to change the direction in which our flex items display. Setting `flex-direction: row-reverse` will keep the items displaying along the row, however the start and end lines are switched.
If we change `flex-direction` to `column` the main axis switches and our items now display in a column. Set `column-reverse` and the start and end lines are again switched.
The live example below has `flex-direction` set to `row-reverse`. Try the other values — `row`, `column` and `column-reverse` — to see what happens to the content.
Multi-line flex containers with flex-wrap
-----------------------------------------
While flexbox is a one dimensional model, it is possible to cause our flex items to wrap onto multiple lines. In doing so, you should consider each line as a new flex container. Any space distribution will happen across that line, without reference to the lines on either side.
To cause wrapping behavior add the property [`flex-wrap`](../flex-wrap) with a value of `wrap`. Now, should your items be too large to all display in one line, they will wrap onto another line. The live sample below contains items that have been given a width, the total width of the items being too wide for the flex container. As `flex-wrap` is set to `wrap`, the items wrap. Set it to `nowrap`, which is also the initial value, and they will instead shrink to fit the container because they are using initial flexbox values that allows items to shrink. Using `nowrap` would cause an overflow if the items were not able to shrink, or could not shrink small enough to fit.
Find out more about wrapping flex items in the guide [Mastering Wrapping of Flex Items](mastering_wrapping_of_flex_items).
The flex-flow shorthand
-----------------------
You can combine the two properties `flex-direction` and `flex-wrap` into the [`flex-flow`](../flex-flow) shorthand. The first value specified is `flex-direction` and the second value is `flex-wrap`.
In the live example below try changing the first value to one of the allowable values for `flex-direction` - `row`, `row-reverse`, `column` or `column-reverse`, and also change the second to `wrap` and `nowrap`.
Properties applied to flex items
--------------------------------
To have more control over flex items we can target them directly. We do this by way of three properties:
* [`flex-grow`](../flex-grow)
* [`flex-shrink`](../flex-shrink)
* [`flex-basis`](../flex-basis)
We will take a brief look at these properties in this overview, and you can gain a fuller understanding in the guide [Controlling Ratios of Flex Items on the Main Axis](controlling_ratios_of_flex_items_along_the_main_ax).
Before we can make sense of these properties we need to consider the concept of **available space**. What we are doing when we change the value of these flex properties is to change the way that available space is distributed amongst our items. This concept of available space is also important when we come to look at aligning items.
If we have three 100 pixel-wide items in a container which is 500 pixels wide, then the space we need to lay out our items is 300 pixels. This leaves 200 pixels of available space. If we don't change the initial values then flexbox will put that space after the last item.
If we instead would like the items to grow and fill the space, then we need to have a method of distributing the leftover space between the items. This is what the `flex` properties that we apply to the items themselves, will do.
### The flex-basis property
The `flex-basis` is what defines the size of that item in terms of the space it leaves as available space. The initial value of this property is `auto` — in this case the browser looks to see if the items have a size. In the example above, all of the items have a width of 100 pixels and so this is used as the `flex-basis`.
If the items don't have a size then the content's size is used as the flex-basis. This is why when we just declare `display: flex` on the parent to create flex items, the items all move into a row and take only as much space as they need to display their contents.
### The flex-grow property
With the `flex-grow` property set to a positive integer, flex items can grow along the main axis from their `flex-basis`. This will cause the item to stretch and take up any available space on that axis, or a proportion of the available space if other items are allowed to grow too.
If we gave all of our items in the example above a `flex-grow` value of 1 then the available space in the flex container would be equally shared between our items and they would stretch to fill the container on the main axis.
The flex-grow property can be used to distribute space in proportion. If we give our first item a `flex-grow` value of 2, and the other items a value of 1 each, 2 parts of the available space will be given to the first item (100px out of 200px in the case of the example above), 1 part each the other two (50px each out of the 200px total).
### The flex-shrink property
Where the `flex-grow` property deals with adding space in the main axis, the `flex-shrink` property controls how it is taken away. If we do not have enough space in the container to lay out our items, and `flex-shrink` is set to a positive integer, then the item can become smaller than the `flex-basis`. As with `flex-grow`, different values can be assigned in order to cause one item to shrink faster than others — an item with a higher value set for `flex-shrink` will shrink faster than its siblings that have lower values.
The minimum size of the item will be taken into account while working out the actual amount of shrinkage that will happen, which means that flex-shrink has the potential to appear less consistent than flex-grow in behavior. We'll therefore take a more detailed look at how this algorithm works in the article [Controlling Ratios of items along the main axis](controlling_ratios_of_flex_items_along_the_main_ax).
**Note:** These values for `flex-grow` and `flex-shrink` are proportions. Typically if we had all of our items set to `flex: 1 1 200px` and then wanted one item to grow at twice the rate, we would set that item to `flex: 2 1 200px`. However you could also use `flex: 10 1 200px` and `flex: 20 1 200px` if you wanted.
### Shorthand values for the flex properties
You will very rarely see the `flex-grow`, `flex-shrink`, and `flex-basis` properties used individually; instead they are combined into the [`flex`](../flex) shorthand. The `flex` shorthand allows you to set the three values in this order — `flex-grow`, `flex-shrink`, `flex-basis`.
The live example below allows you to test out the different values of the flex shorthand; remember that the first value is `flex-grow`. Giving this a positive value means the item can grow. The second is `flex-shrink` — with a positive value the items can shrink, but only if their total values overflow the main axis. The final value is `flex-basis`; this is the value the items are using as their base value to grow and shrink from.
There are also some predefined shorthand values which cover most of the use cases. You will often see these used in tutorials, and in many cases these are all you will need to use. The predefined values are as follows:
* `flex: initial`
* `flex: auto`
* `flex: none`
* `flex: <positive-number>`
Setting `flex: initial` resets the item to the initial values of Flexbox. This is the same as `flex: 0 1 auto`. In this case the value of `flex-grow` is 0, so items will not grow larger than their `flex-basis` size. The value of `flex-shrink` is 1, so items can shrink if they need to rather than overflowing. The value of `flex-basis` is `auto`. Items will either use any size set on the item in the main dimension, or they will get their size from the content size.
Using `flex: auto` is the same as using `flex: 1 1 auto`; everything is as with `flex:initial` but in this case the items can grow and fill the container as well as shrink if required.
Using `flex: none` will create fully inflexible flex items. It is as if you wrote `flex: 0 0 auto`. The items cannot grow or shrink but will be laid out using flexbox with a `flex-basis` of `auto`.
The shorthand you often see in tutorials is `flex: 1` or `flex: 2` and so on. This is as if you used `flex: 1 1 0` or `flex: 2 1 0` and so on, respectively. The items can grow and shrink from a `flex-basis` of 0.
Try these shorthand values in the live example below.
Alignment, justification and distribution of free space between items
---------------------------------------------------------------------
A key feature of flexbox is the ability to align and justify items on the main- and cross-axes, and to distribute space between flex items. Note that these properties are to be set on the flex container, not on the items themselves.
### align-items
The [`align-items`](../align-items) property will align the items on the cross axis.
The initial value for this property is `stretch` and this is why flex items stretch to the height of the flex container by default. This might be dictated by the height of the tallest item in the container, or by a size set on the flex container itself.
You could instead set `align-items` to `flex-start` in order to make the items line up at the start of the flex container, `flex-end` to align them to the end, or `center` to align them in the center. Try this in the live example — I have given the flex container a height in order that you can see how the items can be moved around inside the container. See what happens if you set the value of align-items to:
* `stretch`
* `flex-start`
* `flex-end`
* `center`
### justify-content
The [`justify-content`](../justify-content) property is used to align the items on the main axis, the direction in which `flex-direction` has set the flow. The initial value is `flex-start` which will line the items up at the start edge of the container, but you could also set the value to `flex-end` to line them up at the end, or `center` to line them up in the center.
You can also use the value `space-between` to take all the spare space after the items have been laid out, and share it out evenly between the items so there will be an equal amount of space between each item. To cause an equal amount of space on the right and left of each item use the value `space-around`. With `space-around`, items have a half-size space on either end. Or, to cause items to have equal space around them use the value `space-evenly`. With `space-evenly`, items have a full-size space on either end.
Try the following values of `justify-content` in the live example:
* `flex-start`
* `flex-end`
* `center`
* `space-around`
* `space-between`
* `space-evenly`
In the article [Aligning Items in a Flex Container](aligning_items_in_a_flex_container) we will explore these properties in more depth, in order to have a better understanding of how they work. These simple examples however will be useful in the majority of use cases.
### justify-items
The [`justify-items`](../justify-items) property is ignored in flexbox layouts.
Next steps
----------
After reading this article you should have an understanding of the basic features of Flexbox. In the next article we will look at [how this specification relates to other parts of CSS](relationship_of_flexbox_to_other_layout_methods).
| programming_docs |
css Aligning items in a flex container Aligning items in a flex container
==================================
One of the reasons that flexbox quickly caught the interest of web developers is that it brought proper alignment capabilities to the web for the first time. It enabled proper vertical alignment, so we can at last easily center a box. In this guide, we will take a thorough look at how the alignment and justification properties work in Flexbox.
To center our box we use the `align-items` property to align our item on the cross axis, which in this case is the block axis running vertically. We use `justify-content` to align the item on the main axis, which in this case is the inline axis running horizontally.
You can take a look at the code of this example below. Change the size of the container or nested element and the nested element always remains centered.
Properties that control alignment
---------------------------------
The properties we will look at in this guide are as follows.
* [`justify-content`](../justify-content) — controls alignment of all items on the main axis.
* [`align-items`](../align-items) — controls alignment of all items on the cross axis.
* [`align-self`](../align-self) — controls alignment of an individual flex item on the cross axis.
* [`align-content`](../align-content) — described in the spec as for "packing flex lines"; controls space between flex lines on the cross axis.
* [`gap`](../gap), [`column-gap`](../column-gap), and [`row-gap`](../row-gap) — used to create gaps or gutters between flex items.
We will also discover how auto margins can be used for alignment in flexbox.
The Cross Axis
--------------
The `align-items` and `align-self` properties control alignment of our flex items on the cross axis, down the columns if `flex-direction` is `row` and along the row if `flex-direction` is `column`.
We are making use of cross-axis alignment in the most simple flex example. If we add `display: flex` to a container, the child items all become flex items arranged in a row. They will all stretch to be as tall as the tallest item, as that item is defining the height of the items on the cross axis. If your flex container has a height set, then the items will stretch to that height, regardless of how much content is in the item.
The reason the items become the same height is that the initial value of `align-items`, the property that controls alignment on the cross axis, is set to `stretch`.
We can use other values to control how the items align:
* `align-items: flex-start`
* `align-items: flex-end`
* `align-items: center`
* `align-items: stretch`
* `align-items: baseline`
In the live example below, the value of `align-items` is `stretch`. Try the other values and see how all of the items align against each other in the flex container.
### Aligning one item with `align-self`
The `align-items` property sets the `align-self` property on all of the flex items as a group. This means you can explicitly declare the `align-self` property to target a single item. The `align-self` property accepts all of the same values as `align-items` plus a value of `auto`, which will reset the value to that which is defined on the flex container.
In this next live example, the flex container has `align-items: flex-start`, which means the items are all aligned to the start of the cross axis. I have targeted the first item using a `first-child` selector and set that item to `align-self: stretch`; another item has been selected using its class of `selected` and given `align-self: center`. You can change the value of `align-items` or change the values of `align-self` on the individual items to see how this works.
### Changing the main axis
So far we have looked at the behavior when our `flex-direction` is `row`, and while working in a language written top to bottom. This means that the main axis runs along the row horizontally, and our cross axis alignment moves the items up and down.
If we change our `flex-direction` to column, `align-items` and `align-self` will align the items to the left and right.
You can try this out in the example below, which has a flex container with `flex-direction: column` yet otherwise is exactly the same as the previous example.
Aligning content on the cross axis — the align-content property
---------------------------------------------------------------
So far we have been aligning the items, or an individual item inside the area defined by the flex-container. If you have a wrapped multiple-line flex container then you might also want to use the `align-content` property to control the distribution of space between the rows. In the specification this is described as [packing flex lines](https://drafts.csswg.org/css-flexbox/#align-content-property).
For `align-content` to work you need more height in your flex container than is required to display the items. It then works on all the items as a set, and dictates what happens with that free space, and the alignment of the entire set of items within it.
The `align-content` property takes the following values:
* `align-content: flex-start`
* `align-content: flex-end`
* `align-content: center`
* `align-content: space-between`
* `align-content: space-around`
* `align-content: stretch`
* `align-content: space-evenly` (not defined in the Flexbox specification)
In the live example below, the flex container has a height of 400 pixels, which is more than needed to display our items. The value of `align-content` is `space-between`, which means that the available space is shared out *between* the flex lines, which are placed flush with the start and end of the container on the cross axis.
Try out the other values to see how the `align-content` property works.
Once again we can switch our `flex-direction` to `column` in order to see how this property behaves when we are working by column. As before, we need enough space in the cross axis to have some free space after displaying all of the items.
**Note:** The value `space-evenly` is not defined in the flexbox specification and is a later addition to the Box Alignment specification. Browser support for this value is not as good as that of the values defined in the flexbox spec.
Aligning content on the main axis
---------------------------------
Now that we have seen how alignment works on the cross axis, we can take a look at the main axis. Here we only have one property available to us — `justify-content`. This is because we are only dealing with items as a group on the main axis. With `justify-content` we control what happens with available space, should there be more space than is needed to display the items.
In our initial example with `display: flex` on the container, the items display as a row and all line up at the start of the container. This is due to the initial value of `justify-content` being `flex-start`. Any available space is placed at the end of the items.
The `justify-content` property accepts the same values as `align-content`.
* `justify-content: flex-start`
* `justify-content: flex-end`
* `justify-content: center`
* `justify-content: space-between`
* `justify-content: space-around`
* `justify-content: space-evenly` (not defined in the Flexbox specification)
In the example below, the value of `justify-content` is `space-between`. The available space after displaying the items is distributed between the items. The left and right item line up flush with the start and end.
If the main axis is in the block direction because `flex-direction` is set to `column`, then `justify-content` will distribute space between items in that dimension as long as there is space in the flex container to distribute.
### Alignment and Writing Modes
Remember that with all of these alignment methods, the values of `flex-start` and `flex-end` are writing mode-aware. If the value of `justify-content` is `flex-start` and the writing mode is left-to-right as in English, the items will line up starting at the left side of the container.
However if the writing mode is right-to-left as in Arabic, the items will line up starting at the right side of the container.
The live example below has the `direction` property set to `rtl` to force a right-to-left flow for our items. You can remove this, or change the values of `justify-content` to see how flexbox behaves when the start of the inline direction is on the right.
Alignment and flex-direction
----------------------------
The start line will also change if you change the `flex-direction` property — for example using `row-reverse` instead of `row`.
In this next example I have items laid out with `flex-direction: row-reverse` and `justify-content: flex-end`. In a left to right language the items all line up on the left. Try changing `flex-direction: row-reverse` to `flex-direction: row`. You will see that the items now move to the right-hand side.
While this may all seem a little confusing, the rule to remember is that unless you do something to change it, flex items lay themselves out in the direction that words are laid out in the language of your document along the inline, row axis. `flex-start` will be where the start of a sentence of text would begin.
You can switch them to display in the block direction for the language of your document by selecting `flex-direction: column`. Then `flex-start` will then be where the top of your first paragraph of text would start.
If you change `flex-direction` to one of the reverse values, then they will lay themselves out from the end axis and in the reverse order to the way words are written in the language of your document. `flex-start` will then change to the end of that axis — so to the location where your lines would wrap if working in rows, or at the end of your last paragraph of text in the block direction.
Using auto margins for main axis alignment
------------------------------------------
We don't have a `justify-items` or `justify-self` property available to us on the main axis as our items are treated as a group on that axis. However it is possible to do some individual alignment in order to separate an item or a group of items from others by using auto margins along with flexbox.
A common pattern is a navigation bar where some key items are aligned to the right, with the main group on the left. You might think that this should be a use case for a `justify-self` property, however consider the image below. I have three items on one side and two on the other. If I were able to use `justify-self` on item *d*, it would also change the alignment of item *e* that follows, which may or may not be my intention.
Instead we can target item 4 and separate it from the first three items by giving it a `margin-left` value of `auto`. Auto margins will take up all of the space that they can in their axis — it is how centering a block with margin auto left and right works. Each side tries to take as much space as it can, and so the block is pushed into the middle.
In this live example, I have flex items arranged into a row with the basic flex values, and the class `push` has `margin-left: auto`. You can try removing this, or adding the class to another item to see how it works.
Creating gaps between items
---------------------------
To create a gap between flex items, use the [`gap`](../gap), [`column-gap`](../column-gap), and [`row-gap`](../row-gap) properties. The [`column-gap`](../column-gap) property creates gaps between items on the main axis. The [`row-gap`](../row-gap) property creates gaps between flex lines, when you have [`flex-wrap`](../flex-wrap) set to `wrap`. The [`gap`](../gap) property is a shorthand that sets both together.
See also
--------
* [Box Alignment](../css_box_alignment)
* [Box Alignment in Flexbox](../css_box_alignment/box_alignment_in_flexbox)
* [Box Alignment in Grid Layout](../css_box_alignment/box_alignment_in_grid_layout)
css Ordering flex items Ordering flex items
===================
New layout methods such as Flexbox and Grid bring with them the possibility of controlling the order of content. In this article, we will take a look at ways in which you can change the visual order of your content when using Flexbox. We will also consider the implications of reordering items from an accessibility point of view.
Reverse the display of the items
--------------------------------
the [`flex-direction`](../flex-direction) property can take one of four values:
* `row`
* `column`
* `row-reverse`
* `column-reverse`
The first two values keep the items in the same order that they appear in the document source order and display them sequentially from the start line.
The second two values reverse the items by switching the start and end lines.
Remember that the start line relates to writing modes. The row-related examples above demonstrate how `row` and `row-reverse` work in a left-to-right language such as English. If you are working in a right-to-left language like Arabic then `row` would start on the right, `row-reverse` on the left.
This can seem like a neat way to display things in reverse order however you should be mindful that the items are only *visually* displayed in reverse order. The specification says the following on this matter:
> "Note: The reordering capabilities of flex layout intentionally affect only the visual rendering, leaving speech order and navigation based on the source order. This allows authors to manipulate the visual presentation while leaving the source order intact for non-CSS UAs and for linear models such as speech and sequential navigation." - [Ordering and Orientation](https://www.w3.org/TR/css-flexbox-1/#flow-order)
>
>
If your items were links or some other element that the user could tab to, then the tabbing order would be the order that these items appear in the document source — not your visual order.
If you are using a reverse value, or otherwise reordering your items, you should consider whether you actually need to change the logical order in the source. The specification continues with a warning not to use reordering to fix issues in your source:
> "Authors *must not* use order or the \*-reverse values of flex-flow/flex-direction as a substitute for correct source ordering, as that can ruin the accessibility of the document."
>
>
**Note:** For some years Firefox had a bug whereby it would attempt to follow the visual order and not the source order, making it behave differently from other browsers. This has now been fixed. You should always take the source order as the logical order of the document as all up-to-date user agents will be following the specification and doing so.
In the live example below I have added a focus style in order that as you tab from link to link you can see which is highlighted. If you change the order using `flex-direction` you can see how the tab order continues to follow the order that the items are listed in the source.
In the same way that changing the value of `flex-direction` does not change the order in which items are navigated to, changing this value does not change paint order. It is a visual reversal of the items only.
The order property
------------------
In addition to reversing the order in which flex items are visually displayed, you can target individual items and change where they appear in the visual order with the [`order`](../order) property.
The `order` property is designed to lay the items out in *ordinal groups*. What this means is that items are assigned an integer that represents their group. The items are then placed in the visual order according to that integer, lowest values first. If more than one item has the same integer value, then within that group the items are laid out as per source order.
As an example, I have 5 flex items, and assign `order` values as follows:
* Source item 1: `order: 2`
* Source item 2: `order: 3`
* Source item 3: `order: 1`
* Source item 4: `order: 3`
* Source item 5: `order: 1`
These items would be displayed on the page in the following order:
* Source item 3: `order: 1`
* Source item 5: `order: 1`
* Source item 1: `order: 2`
* Source item 2: `order: 3`
* Source item 4: `order: 3`
You can play around with the values in this live example below and see how that changes the order. Also, try changing `flex-direction` to `row-reverse` and see what happens — the start line is switched so the ordering begins from the opposite side.
Flex items have a default `order` value of `0`, therefore items with an integer value greater than 0 will be displayed after any items that have not been given an explicit `order` value.
You can also use negative values with `order`, which can be quite useful. If you want to make one item display first and leave the order of all other items unchanged, you can give that item order of `-1`. As this is lower than 0 the item will always be displayed first.
In the live code example below I have items laid out using Flexbox. By changing which item has the class `active` assigned to it in the HTML, you can change which item displays first and therefore becomes full width at the top of the layout, with the other items displaying below it.
The items are displayed in what is described in the specification as *order-modified document order*. The value of the order property is taken into account before the items are displayed.
Order also changes the paint order of the items; items with a lower value for `order` will be painted first and those with a higher value for `order` painted afterwards.
The order property and accessibility
------------------------------------
Use of the `order` property has exactly the same implications for accessibility as changing the direction with `flex-direction`. Using `order` changes the order in which items are painted, and the order in which they appear visually. It does not change the sequential navigation order of the items. Therefore if a user is tabbing between the items, they could find themselves jumping around your layout in a very confusing way.
By tabbing around any of the live examples on this page, you can see how `order` is potentially creating a strange experience for anyone not using a pointing device of some kind. To read more about this disconnect of visual order and logical order and some of the potential problems it raises for accessibility, see the following resources.
* [Flexbox and the keyboard navigation disconnect](https://tink.uk/flexbox-the-keyboard-navigation-disconnect/)
* [HTML Source Order vs CSS Display Order](https://adrianroselli.com/2015/10/html-source-order-vs-css-display-order.html)
* [The Responsive Order Conflict for Keyboard Focus](https://alastairc.uk/2017/06/the-responsive-order-conflict/)
Use cases for order
-------------------
There are sometimes places where the fact that the logical and therefore reading order of flex items is separate from the visual order, is helpful. Used carefully the `order` property can allow for some useful common patterns to be easily implemented.
You might have a design, perhaps a card that will display a news item. The heading of the news item is the key thing to highlight and would be the element that a user might jump to if they were tabbing between headings to find the content they wanted to read. The card also has a date; the finished design we want to create is something like this.
Visually the date appears above the heading, in the source. However, if the card was read out by a screen reader I would prefer that the title was announced first and then the publication date. We can make this so using the `order` property.
The card is going to be our flex container, with `flex-direction` set to column. I then give the date an `order` of `-1`. This pulls it up above the heading.
These small tweaks are the sort of cases where the `order` property makes sense. Keep the logical order as the reading and tab order of the document, and maintain that in the most accessible and structured fashion. Then use `order` for purely visual design tweaks. When doing so take care that you are not reordering items that could be accessed by the keyboard as a user is tabbing around. Especially when using newer layout methods you should ensure that your browser testing includes testing the site using only a keyboard, rather than a mouse or a touchscreen. You will quickly see if your development choices make getting around the content difficult.
| programming_docs |
css skewY() skewY()
=======
The `skewY()` [CSS](https://developer.mozilla.org/en-US/docs/Web/CSS) [function](../css_functions) defines a transformation that skews an element in the vertical direction on the 2D plane. Its result is a [`<transform-function>`](../transform-function) data type.
Try it
------
This transformation is a shear mapping ([transvection](https://en.wikipedia.org/wiki/Shear_mapping)) that distorts each point within an element by a certain angle in the vertical direction. The ordinate coordinate of each point is modified by a value proportionate to the specified angle and the distance to the origin; thus, the farther from the origin a point is, the greater will be the value added it.
Syntax
------
```
skewY(a)
```
### Values
`a` Is an [`<angle>`](../angle) representing the angle to use to distort the element along the ordinate.
| Cartesian coordinates on ℝ^2 | Homogeneous coordinates on ℝℙ^2 | Cartesian coordinates on ℝ^3 | Homogeneous coordinates on ℝℙ^3 |
| --- | --- | --- | --- |
| ( 1 0 tan ( a ) 1 ) | ( 1 0 0 tan ( a ) 1 0 0 0 1 ) | ( 1 0 0 tan ( a ) 1 0 0 0 1 ) | ( 1 0 0 0 tan ( a ) 1 0 0 0 0 1 0 0 0 0 1 ) |
| `[1 tan(a) 0 1 0 0]` |
Examples
--------
### HTML
```
<div>Normal</div>
<div class="skewed">Skewed</div>
```
### CSS
```
div {
width: 80px;
height: 80px;
background-color: skyblue;
}
.skewed {
transform: skewY(40deg);
background-color: pink;
}
```
### Result
Specifications
--------------
| Specification |
| --- |
| [CSS Transforms Module Level 1 # funcdef-transform-skewy](https://w3c.github.io/csswg-drafts/css-transforms/#funcdef-transform-skewy) |
Browser compatibility
---------------------
| | Desktop | Mobile |
| --- | --- | --- |
| | Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet |
| `skewY` | 1 | 12 | 3.5 | 9 | 10.5 | 3.1 | 2 | 18 | 4 | 11 | 3.2 | 1.0 |
See also
--------
* [`transform`](../transform)
* [`<transform-function>`](../transform-function)
* Individual transform properties:
+ [`translate`](../translate)
+ [`scale`](../scale)
+ [`rotate`](../rotate)
+ Note: there is no `skew` property
css translateX() translateX()
============
The `translateX()` [CSS](https://developer.mozilla.org/en-US/docs/Web/CSS) [function](../css_functions) repositions an element horizontally on the 2D plane. Its result is a [`<transform-function>`](../transform-function) data type.
Try it
------
**Note:** `translateX(tx)` is equivalent to `translate(tx, 0)` or `translate3d(tx, 0, 0)`.
Syntax
------
```
/\* <length-percentage> values \*/
transform: translateX(200px);
transform: translateX(50%);
```
### Values
`<length-percentage>` Is a [`<length>`](../length) or [`<percentage>`](../percentage) representing the abscissa of the translating vector. A percentage value refers to the width of the reference box defined by the [`transform-box`](../transform-box) property.
| Cartesian coordinates on ℝ^2 | Homogeneous coordinates on ℝℙ^2 | Cartesian coordinates on ℝ^3 | Homogeneous coordinates on ℝℙ^3 |
| --- | --- | --- | --- |
| A translation is not a linear transformation in ℝ^2 and can't be represented using a Cartesian-coordinate matrix. | ( 1 0 t 0 1 0 0 0 1 ) | ( 1 0 t 0 1 0 0 0 1 ) | ( 1 0 0 t 0 1 0 0 0 0 1 0 0 0 0 1 ) |
| `[1 0 0 1 t 0]` |
### Formal syntax
```
translateX(<length-percentage>)
```
Examples
--------
### HTML
```
<div>Static</div>
<div class="moved">Moved</div>
<div>Static</div>
```
### CSS
```
div {
width: 60px;
height: 60px;
background-color: skyblue;
}
.moved {
transform: translateX(10px); /\* Equal to translate(10px) \*/
background-color: pink;
}
```
### Result
Specifications
--------------
| Specification |
| --- |
| [CSS Transforms Module Level 1 # funcdef-transform-translatex](https://w3c.github.io/csswg-drafts/css-transforms/#funcdef-transform-translatex) |
Browser compatibility
---------------------
| | Desktop | Mobile |
| --- | --- | --- |
| | Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet |
| `translateX` | 1 | 12 | 3.5 | 9 | 10.5 | 3.1 | 2 | 18 | 4 | 11 | 3.2 | 1.0 |
See also
--------
* [`translate()`](translate)
* [`translateY()`](translatey)
* [`transform`](../transform)
* [`<transform-function>`](../transform-function)
* [`translate`](../translate)
css rotateY() rotateY()
=========
The `rotateY()` [CSS](https://developer.mozilla.org/en-US/docs/Web/CSS) [function](../css_functions) defines a transformation that rotates an element around the ordinate (vertical axis) without deforming it. Its result is a [`<transform-function>`](../transform-function) data type.
Try it
------
The axis of rotation passes through an origin, defined by the [`transform-origin`](../transform-origin) CSS property.
**Note:** `rotateY(a)` is equivalent to `rotate3d(0, 1, 0, a)`.
**Note:** Unlike rotations in the 2D plane, the composition of 3D rotations is usually not commutative. In other words, the order in which the rotations are applied impacts the result.
Syntax
------
The amount of rotation created by `rotateY()` is specified by an [`<angle>`](../angle). If positive, the movement will be clockwise; if negative, it will be counter-clockwise.
```
rotateY(a)
```
### Values
`a` Is an [`<angle>`](../angle) representing the angle of the rotation. A positive angle denotes a clockwise rotation, a negative angle a counter-clockwise one.
| Cartesian coordinates on ℝ^2 | Homogeneous coordinates on ℝℙ^2 | Cartesian coordinates on ℝ^3 | Homogeneous coordinates on ℝℙ^3 |
| --- | --- | --- | --- |
| This transformation applies to the 3D space and can't be represented on the plane. | ( cos ( a ) 0 sin ( a ) 0 1 0 - sin ( a ) 0 cos ( a ) ) | ( cos ( a ) 0 sin ( a ) 0 0 1 0 0 - sin ( a ) 0 cos ( a ) 0 0 0 0 1 ) |
Examples
--------
### HTML
```
<div>Normal</div>
<div class="rotated">Rotated</div>
```
### CSS
```
div {
width: 80px;
height: 80px;
background-color: skyblue;
}
.rotated {
transform: rotateY(60deg);
background-color: pink;
}
```
### Result
Specifications
--------------
| Specification |
| --- |
| [CSS Transforms Module Level 2 # funcdef-rotatey](https://w3c.github.io/csswg-drafts/css-transforms-2/#funcdef-rotatey) |
Browser compatibility
---------------------
| | Desktop | Mobile |
| --- | --- | --- |
| | Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet |
| `rotateY` | 12 | 12 | 10 | 10 | 15 | 4 | 3 | 18 | 10 | 14 | 3.2 | 1.0 |
See also
--------
* [`transform`](../transform) property
* [`rotate`](../rotate) property
* [`<transform-function>`](../transform-function)
css rotateX() rotateX()
=========
The `rotateX()` [CSS](https://developer.mozilla.org/en-US/docs/Web/CSS) [function](../css_functions) defines a transformation that rotates an element around the abscissa (horizontal axis) without deforming it. Its result is a [`<transform-function>`](../transform-function) data type.
Try it
------
The axis of rotation passes through an origin, defined by the [`transform-origin`](../transform-origin) CSS property.
**Note:** `rotateX(a)` is equivalent to `rotate3d(1, 0, 0, a)`.
**Note:** Unlike rotations in the 2D plane, the composition of 3D rotations is usually not commutative. In other words, the order in which the rotations are applied impacts the result.
Syntax
------
The amount of rotation created by `rotateX()` is specified by an [`<angle>`](../angle). If positive, the movement will be clockwise; if negative, it will be counter-clockwise.
```
rotateX(a)
```
### Values
`a` Is an [`<angle>`](../angle) representing the angle of the rotation. A positive angle denotes a clockwise rotation, a negative angle a counter-clockwise one.
| Cartesian coordinates on ℝ^2 | Homogeneous coordinates on ℝℙ^2 | Cartesian coordinates on ℝ^3 | Homogeneous coordinates on ℝℙ^3 |
| --- | --- | --- | --- |
| This transformation applies to the 3D space and can't be represented on the plane. | ( 1 0 0 0 cos ( a ) - sin ( a ) 0 sin ( a ) cos ( a ) ) | ( 1 0 0 0 0 cos ( a ) - sin ( a ) 0 0 sin ( a ) cos ( a ) 0 0 0 0 1 ) |
Examples
--------
### HTML
```
<div>Normal</div>
<div class="rotated">Rotated</div>
```
### CSS
```
div {
width: 80px;
height: 80px;
background-color: skyblue;
}
.rotated {
transform: rotateX(45deg);
background-color: pink;
}
```
### Result
Specifications
--------------
| Specification |
| --- |
| [CSS Transforms Module Level 2 # funcdef-rotatex](https://w3c.github.io/csswg-drafts/css-transforms-2/#funcdef-rotatex) |
Browser compatibility
---------------------
| | Desktop | Mobile |
| --- | --- | --- |
| | Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet |
| `rotateX` | 12 | 12 | 10 | 10 | 15 | 4 | 3 | 18 | 10 | 14 | 3.2 | 1.0 |
See also
--------
* [`transform`](../transform) property
* [`rotate`](../rotate) property
* [`<transform-function>`](../transform-function)
css translateY() translateY()
============
The `translateY()` [CSS](https://developer.mozilla.org/en-US/docs/Web/CSS) [function](../css_functions) repositions an element vertically on the 2D plane. Its result is a [`<transform-function>`](../transform-function) data type.
Try it
------
**Note:** `translateY(ty)` is equivalent to `translate(0, ty)` or `translate3d(0, ty, 0)`.
Syntax
------
```
/\* <length-percentage> values \*/
transform: translateY(200px);
transform: translateY(50%);
```
### Values
`<length-percentage>` The value is a [`<length>`](../length) or [`<percentage>`](../percentage) representing the ordinate of the translating vector. A percentage value refers to the height of the reference box defined by the [`transform-box`](../transform-box) property.
| Cartesian coordinates on ℝ^2 | Homogeneous coordinates on ℝℙ^2 | Cartesian coordinates on ℝ^3 | Homogeneous coordinates on ℝℙ^3 |
| --- | --- | --- | --- |
| A translation is not a linear transformation in ℝ^2 and can't be represented using a Cartesian-coordinate matrix. | ( 1 0 0 0 1 t 0 0 1 ) | ( 1 0 0 0 1 t 0 0 1 ) | ( 1 0 0 0 0 1 0 t 0 0 1 0 0 0 0 1 ) |
| `[1 0 0 1 0 t]` |
### Formal syntax
```
translateY(<length-percentage>)
```
Examples
--------
### HTML
```
<div>Static</div>
<div class="moved">Moved</div>
<div>Static</div>
```
### CSS
```
div {
width: 60px;
height: 60px;
background-color: skyblue;
}
.moved {
transform: translateY(10px);
background-color: pink;
}
```
### Result
Specifications
--------------
| Specification |
| --- |
| [CSS Transforms Module Level 1 # funcdef-transform-translatey](https://w3c.github.io/csswg-drafts/css-transforms/#funcdef-transform-translatey) |
Browser compatibility
---------------------
| | Desktop | Mobile |
| --- | --- | --- |
| | Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet |
| `translateY` | 1 | 12 | 3.5 | 9 | 10.5 | 3.1 | 2 | 18 | 4 | 11 | 3.2 | 1.0 |
See also
--------
* [`transform`](../transform)
* [`<transform-function>`](../transform-function)
* [`translate`](../translate)
css skewX() skewX()
=======
The `skewX()` [CSS](https://developer.mozilla.org/en-US/docs/Web/CSS) [function](../css_functions) defines a transformation that skews an element in the horizontal direction on the 2D plane. Its result is a [`<transform-function>`](../transform-function) data type.
Try it
------
This transformation is a shear mapping ([transvection](https://en.wikipedia.org/wiki/Shear_mapping)) that distorts each point within an element by a certain angle in the horizontal direction. The abscissa coordinate of each point is modified by a value proportionate to the specified angle and the distance to the origin; thus, the farther from the origin a point is, the greater will be the value added it.
**Note:** `skewX(a)` is equivalent to `skew(a)`.
Syntax
------
```
skewX(a)
```
### Values
`a` Is an [`<angle>`](../angle) representing the angle to use to distort the element along the abscissa.
| Cartesian coordinates on ℝ^2 | Homogeneous coordinates on ℝℙ^2 | Cartesian coordinates on ℝ^3 | Homogeneous coordinates on ℝℙ^3 |
| --- | --- | --- | --- |
| ( 1 tan ( a ) 0 1 ) | ( 1 tan ( a ) 0 0 1 0 0 0 1 ) | ( 1 tan ( a ) 0 0 1 0 0 0 1 ) | ( 1 tan ( a ) 0 0 0 1 0 0 0 0 1 0 0 0 0 1 ) |
| `[1 0 tan(a) 1 0 0]` |
Examples
--------
### HTML
```
<div>Normal</div>
<div class="skewed">Skewed</div>
```
### CSS
```
div {
width: 80px;
height: 80px;
background-color: skyblue;
}
.skewed {
transform: skewX(10deg); /\* Equal to skew(10deg) \*/
background-color: pink;
}
```
### Result
Specifications
--------------
| Specification |
| --- |
| [CSS Transforms Module Level 1 # funcdef-transform-skewx](https://w3c.github.io/csswg-drafts/css-transforms/#funcdef-transform-skewx) |
Browser compatibility
---------------------
| | Desktop | Mobile |
| --- | --- | --- |
| | Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet |
| `skewX` | 1 | 12 | 3.5 | 9 | 10.5 | 3.1 | 2 | 18 | 4 | 11 | 3.2 | 1.0 |
See also
--------
* [`transform`](../transform)
* [`<transform-function>`](../transform-function)
* Individual transform properties:
+ [`translate`](../translate)
+ [`scale`](../scale)
+ [`rotate`](../rotate)
+ Note: there is no `skew` property
css scaleY() scaleY()
========
The `scaleY()` [CSS](https://developer.mozilla.org/en-US/docs/Web/CSS) [function](../css_functions) defines a transformation that resizes an element along the y-axis (vertically). Its result is a [`<transform-function>`](../transform-function) data type.
Try it
------
It modifies the ordinate of each element point by a constant factor, except when the scale factor is 1, in which case the function is the identity transform. The scaling is not isotropic, and the angles of the element are not conserved. `scaleY(-1)` defines an [axial symmetry](https://en.wikipedia.org/wiki/Axial_symmetry), with a horizontal axis passing through the origin (as specified by the [`transform-origin`](../transform-origin) property).
**Note:** `scaleY(sy)` is equivalent to `scale(1, sy)` or `scale3d(1, sy, 1)`.
`transform: rotateX(180deg);` === `transform: scaleY(-1);`
Syntax
------
```
scaleY(s)
```
### Values
`s` Is a [`<number>`](../number) representing the scaling factor to apply on the ordinate of each point of the element.
| Cartesian coordinates on ℝ^2 | Homogeneous coordinates on ℝℙ^2 | Cartesian coordinates on ℝ^3 | Homogeneous coordinates on ℝℙ^3 |
| --- | --- | --- | --- |
| ( 1 0 0 s ) | ( 1 0 0 0 s 0 0 0 1 ) | ( 1 0 0 0 s 0 0 0 1 ) | ( 1 0 0 0 0 s 0 0 0 0 1 0 0 0 0 1 ) |
| `[1 0 0 s 0 0]` |
Examples
--------
### HTML
```
<div>Normal</div>
<div class="scaled">Scaled</div>
```
### CSS
```
div {
width: 80px;
height: 80px;
background-color: skyblue;
}
.scaled {
transform: scaleY(0.6);
background-color: pink;
}
```
### Result
Specifications
--------------
| Specification |
| --- |
| [CSS Transforms Module Level 1 # funcdef-transform-scaley](https://w3c.github.io/csswg-drafts/css-transforms/#funcdef-transform-scaley) |
Browser compatibility
---------------------
| | Desktop | Mobile |
| --- | --- | --- |
| | Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet |
| `scaleY` | 1 | 12 | 3.5 | 9 | 10.5 | 3.1 | 2 | 18 | 4 | 11 | 3.2 | 1.0 |
See also
--------
* [`scaleX()`](scalex)
* [`scaleZ()`](scalez)
* [`transform`](../transform)
* [`<transform-function>`](../transform-function)
* [`transform-origin`](../transform-origin)
* Individual transform properties:
+ [`translate`](../translate)
+ [`scale`](../scale)
+ [`rotate`](../rotate)
+ Note: there is no `skew` property
css translate3d() translate3d()
=============
The `translate3d()` [CSS](https://developer.mozilla.org/en-US/docs/Web/CSS) [function](../css_functions) repositions an element in 3D space. Its result is a [`<transform-function>`](../transform-function) data type.
Try it
------
This transformation is characterized by a three-dimensional vector. Its coordinates define how much the element moves in each direction.
Syntax
------
```
translate3d(tx, ty, tz)
```
### Values
`tx` Is a [`<length>`](../length) or [`<percentage>`](../percentage) representing the abscissa of the translating vector.
`ty` Is a [`<length>`](../length) or [`<percentage>`](../percentage) representing the ordinate of the translating vector.
`tz` Is a [`<length>`](../length) representing the z component of the translating vector. It can't be a [`<percentage>`](../percentage) value; in that case the property containing the transform is considered invalid.
| Cartesian coordinates on ℝ^2 | Homogeneous coordinates on ℝℙ^2 | Cartesian coordinates on ℝ^3 | Homogeneous coordinates on ℝℙ^3 |
| --- | --- | --- | --- |
| This transformation applies to the 3D space and can't be represented on the plane. | A translation is not a linear transformation in ℝ^3 and can't be represented using a Cartesian-coordinate matrix. | ( 1 0 0 tx 0 1 0 ty 0 0 1 tz 0 0 0 1 ) |
Examples
--------
### Using a single axis translation
#### HTML
```
<div>Static</div>
<div class="moved">Moved</div>
<div>Static</div>
```
#### CSS
```
div {
width: 60px;
height: 60px;
background-color: skyblue;
}
.moved {
/\* Equivalent to perspective(500px) translateX(10px) \*/
transform: perspective(500px) translate3d(10px, 0, 0px);
background-color: pink;
}
```
#### Result
### Combining z-axis and x-axis translation
#### HTML
```
<div>Static</div>
<div class="moved">Moved</div>
<div>Static</div>
```
#### CSS
```
div {
width: 60px;
height: 60px;
background-color: skyblue;
}
.moved {
transform: perspective(500px) translate3d(10px, 0, 100px);
background-color: pink;
}
```
#### Result
Specifications
--------------
| Specification |
| --- |
| [CSS Transforms Module Level 2 # funcdef-translate3d](https://w3c.github.io/csswg-drafts/css-transforms-2/#funcdef-translate3d) |
Browser compatibility
---------------------
| | Desktop | Mobile |
| --- | --- | --- |
| | Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet |
| `translate3d` | 12 | 12 | 10 | 10 | 15 | 4 | 3 | 18 | 10 | 14 | 3.2 | 1.0 |
See also
--------
* [`transform`](../transform)
* [`<transform-function>`](../transform-function)
* [`translate`](../translate)
| programming_docs |
css matrix() matrix()
========
The `matrix()` [CSS](https://developer.mozilla.org/en-US/docs/Web/CSS) [function](../css_functions) defines a homogeneous 2D transformation matrix. Its result is a [`<transform-function>`](../transform-function) data type.
Try it
------
**Note:** `matrix(a, b, c, d, tx, ty)` is a shorthand for `matrix3d(a, b, 0, 0, c, d, 0, 0, 0, 0, 1, 0, tx, ty, 0, 1)`.
Syntax
------
The `matrix()` function is specified with six values. The constant values are implied and not passed as parameters; the other parameters are described in the column-major order.
```
matrix(a, b, c, d, tx, ty)
```
### Values
*a* *b* *c* *d*
Are [`<number>`](../number)s describing the linear transformation.
*tx* *ty*
Are [`<number>`](../number)s describing the translation to apply.
| Cartesian coordinates on ℝ^2 | Homogeneous coordinates on ℝℙ^2 | Cartesian coordinates on ℝ^3 | Homogeneous coordinates on ℝℙ^3 |
| --- | --- | --- | --- |
| ( a c b d ) | ( a c tx b d ty 0 0 1 ) | ( a c tx b d ty 0 0 1 ) | ( a c 0 tx b d 0 ty 0 0 1 0 0 0 0 1 ) |
| `[a b c d tx ty]` |
The values represent the following functions: `matrix(scaleX(), skewY(), skewX(), scaleY(), translateX(), translateY())`
Examples
--------
### HTML
```
<div>Normal</div>
<div class="changed">Changed</div>
```
### CSS
```
div {
width: 80px;
height: 80px;
background-color: skyblue;
}
.changed {
transform: matrix(1, 2, -1, 1, 80, 80);
background-color: pink;
}
```
### Result
Specifications
--------------
| Specification |
| --- |
| [CSS Transforms Module Level 1 # funcdef-transform-matrix](https://w3c.github.io/csswg-drafts/css-transforms/#funcdef-transform-matrix) |
Browser compatibility
---------------------
| | Desktop | Mobile |
| --- | --- | --- |
| | Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet |
| `matrix` | 1 | 12 | 3.5
Before Firefox 16, the translation values of `matrix()` could be [`<length>`](https://developer.mozilla.org/docs/Web/CSS/length)s, in addition to the standard [`<number>`](https://developer.mozilla.org/docs/Web/CSS/number). | 9 | 10.5 | 3.1 | 2 | 18 | 4 | 11 | 3.2 | 1.0 |
See also
--------
* [`transform`](../transform)
* Individual transform properties:
+ [`translate`](../translate)
+ [`scale`](../scale)
+ [`rotate`](../rotate)
* [`<transform-function>`](../transform-function)
* [`matrix3d()`](matrix3d)
* [Understanding the CSS Transforms Matrix](https://dev.opera.com/articles/understanding-the-css-transforms-matrix/)
css skew() skew()
======
The `skew()` [CSS](https://developer.mozilla.org/en-US/docs/Web/CSS) [function](../css_functions) defines a transformation that skews an element on the 2D plane. Its result is a [`<transform-function>`](../transform-function) data type.
Try it
------
This transformation is a shear mapping ([transvection](https://en.wikipedia.org/wiki/Shear_mapping)) that distorts each point within an element by a certain angle in the horizontal and vertical directions. The effect is as if you grabbed each corner of the element and pulled them along a certain angle.
The coordinates of each point are modified by a value proportionate to the specified angle and the distance to the origin. Thus, the farther from the origin a point is, the greater the value added to it.
Syntax
------
The `skew()` function is specified with either one or two values, which represent the amount of skewing to be applied in each direction. If you only specify one value it is used for the x-axis and there will be no skewing on the y-axis.
```
skew(ax)
skew(ax, ay)
```
### Values
`ax` Is an [`<angle>`](../angle) representing the angle to use to distort the element along the x-axis (or abscissa).
`ay` Is an [`<angle>`](../angle) representing the angle to use to distort the element along the y-axis (or ordinate). If not defined, its default value is `0`, resulting in a purely horizontal skewing.
| Cartesian coordinates on ℝ^2 | Homogeneous coordinates on ℝℙ^2 | Cartesian coordinates on ℝ^3 | Homogeneous coordinates on ℝℙ^3 |
| --- | --- | --- | --- |
| ( 1 tan ( ax ) tan ( ay ) 1 ) | ( 1 tan ( ax ) 0 tan ( ay ) 1 0 0 0 1 ) | ( 1 tan ( ax ) 0 tan ( ay ) 1 0 0 0 1 ) | ( 1 tan ( ax ) 0 0 tan ( ay ) 1 0 0 0 0 1 0 0 0 0 1 ) |
| `[1 tan(ay) tan(ax) 1 0 0]` |
Examples
--------
### Skewing on the x-axis only
#### HTML
```
<div>Normal</div>
<div class="skewed">Skewed</div>
```
#### CSS
```
body {
margin: 20px;
}
div {
width: 80px;
height: 80px;
background-color: skyblue;
}
.skewed {
transform: skew(10deg); /\* Equal to skewX(10deg) \*/
background-color: pink;
}
```
#### Result
### Skewing on both axes
#### HTML
```
<div>Normal</div>
<div class="skewed">Skewed</div>
```
#### CSS
```
body {
margin: 20px;
}
div {
width: 80px;
height: 80px;
background-color: skyblue;
}
.skewed {
transform: skew(10deg, 10deg);
background-color: pink;
}
```
#### Result
Specifications
--------------
| Specification |
| --- |
| [CSS Transforms Module Level 1 # funcdef-transform-skew](https://w3c.github.io/csswg-drafts/css-transforms/#funcdef-transform-skew) |
Browser compatibility
---------------------
| | Desktop | Mobile |
| --- | --- | --- |
| | Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet |
| `skew` | 1 | 12 | 3.5
Firefox 14 removed experimental support for `skew()`, but it was reintroduced in Firefox 15. | 9 | 10.5 | 3.1 | 2 | 18 | 4 | 11 | 3.2 | 1.0 |
See also
--------
* [`transform`](../transform)
* [`<transform-function>`](../transform-function)
* [skewX()](skewx)
* [skewY()](skewy)
* Individual transform properties:
+ [`translate`](../translate)
+ [`scale`](../scale)
+ [`rotate`](../rotate)
+ Note: there is no `skew` property
css scaleX() scaleX()
========
The `scaleX()` [CSS](https://developer.mozilla.org/en-US/docs/Web/CSS) [function](../css_functions) defines a transformation that resizes an element along the x-axis (horizontally). Its result is a [`<transform-function>`](../transform-function) data type.
Try it
------
It modifies the abscissa of each element point by a constant factor, except when the scale factor is 1, in which case the function is the identity transform. The scaling is not isotropic, and the angles of the element are generally not conserved, except for multiples of 90 degrees. `scaleX(-1)` defines an [axial symmetry](https://en.wikipedia.org/wiki/Axial_symmetry), with a vertical axis passing through the origin (as specified by the [`transform-origin`](../transform-origin) property).
**Note:** `scaleX(sx)` is equivalent to `scale(sx, 1)` or `scale3d(sx, 1, 1)`.
Syntax
------
```
scaleX(s)
```
### Values
`s` Is a [`<number>`](../number) representing the scaling factor to apply on the abscissa of each point of the element.
| Cartesian coordinates on ℝ^2 | Homogeneous coordinates on ℝℙ^2 | Cartesian coordinates on ℝ^3 | Homogeneous coordinates on ℝℙ^3 |
| --- | --- | --- | --- |
| ( s 0 0 1 ) | ( s 0 0 0 1 0 0 0 1 ) | ( s 0 0 0 1 0 0 0 1 ) | ( s 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 ) |
| `[s 0 0 1 0 0]` |
Examples
--------
### HTML
```
<div>Normal</div>
<div class="scaled">Scaled</div>
```
### CSS
```
div {
width: 80px;
height: 80px;
background-color: skyblue;
}
.scaled {
transform: scaleX(0.6);
background-color: pink;
}
```
### Result
Specifications
--------------
| Specification |
| --- |
| [CSS Transforms Module Level 1 # funcdef-transform-scalex](https://w3c.github.io/csswg-drafts/css-transforms/#funcdef-transform-scalex) |
Browser compatibility
---------------------
| | Desktop | Mobile |
| --- | --- | --- |
| | Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet |
| `scaleX` | 1 | 12 | 3.5 | 9 | 10.5 | 3.1 | 2 | 18 | 4 | 11 | 3.2 | 1.0 |
See also
--------
* [`scaleY()`](scaley)
* [`scaleZ()`](scalez)
* [`transform`](../transform)
* [`scale`](../scale)
* [`<transform-function>`](../transform-function)
* [`transform-origin`](../transform-origin)
* Other individual transform properties:
+ [`translate`](../translate)
+ [`rotate`](../rotate)
+ Note: there is no `skew` property
css rotate3d() rotate3d()
==========
The `rotate3d()` [CSS](https://developer.mozilla.org/en-US/docs/Web/CSS) [function](../css_functions) defines a transformation that rotates an element around a fixed axis in 3D space, without deforming it. Its result is a [`<transform-function>`](../transform-function) data type.
Try it
------
In 3D space, rotations have three degrees of liberty, which together describe a single axis of rotation. The axis of rotation is defined by an [x, y, z] vector and pass by the origin (as defined by the [`transform-origin`](../transform-origin) property). If, as specified, the vector is not *normalized* (i.e., if the sum of the square of its three coordinates is not 1), the [user agent](https://developer.mozilla.org/en-US/docs/Glossary/User_agent) will normalize it internally. A non-normalizable vector, such as the null vector, [0, 0, 0], will cause the rotation to be ignored, but without invalidating the whole CSS property.
**Note:** Unlike rotations in the 2D plane, the composition of 3D rotations is usually not commutative. In other words, the order in which the rotations are applied impacts the result.
Syntax
------
The amount of rotation created by `rotate3d()` is specified by three [`<number>`](../number)s and one [`<angle>`](../angle). The `<number>`s represent the x-, y-, and z-coordinates of the vector denoting the axis of rotation. The `<angle>` represents the angle of rotation; if positive, the movement will be clockwise; if negative, it will be counter-clockwise.
```
rotate3d(x, y, z, a)
```
### Values
`x` Is a [`<number>`](../number) describing the x-coordinate of the vector denoting the axis of rotation which can be a positive or negative number.
`y` Is a [`<number>`](../number) describing the y-coordinate of the vector denoting the axis of rotation which can be a positive or negative number.
`z` Is a [`<number>`](../number) describing the z-coordinate of the vector denoting the axis of rotation which can be a positive or negative number.
`a` Is an [`<angle>`](../angle) representing the angle of the rotation. A positive angle denotes a clockwise rotation, a negative angle a counter-clockwise one.
| | |
| --- | --- |
| Cartesian coordinates on ℝ^2 | This transformation applies to the 3D space and can't be represented on the plane. |
| Homogeneous coordinates on ℝℙ^2 |
| Cartesian coordinates on ℝ^3 | ( 1 + ( 1 - cos ( a ) ) ( x 2 - 1 ) z · sin ( a ) + x y ( 1 - cos ( a ) ) - y · sin ( a ) + x z · ( 1 - cos ( a ) ) - z · sin ( a ) + x y · ( 1 - cos ( a ) ) 1 + ( 1 - cos ( a ) ) ( y2 - 1 ) x · sin ( a ) + y z · ( 1 - cos ( a ) ) y sin ( a ) + xz ( 1 - cos ( a ) ) - x sin ( a ) + yz ( 1 - cos ( a ) ) 1 + ( 1 - cos ( a ) ) ( z2 - 1 ) t 0 0 0 1 ) |
| Homogeneous coordinates on ℝℙ^3 | |
Examples
--------
### Rotating on the y-axis
#### HTML
```
<div>Normal</div>
<div class="rotated">Rotated</div>
```
#### CSS
```
body {
perspective: 800px;
}
div {
width: 80px;
height: 80px;
background-color: skyblue;
}
.rotated {
transform: rotate3d(0, 1, 0, 60deg);
background-color: pink;
}
```
#### Result
### Rotating on a custom axis
#### HTML
```
<div>Normal</div>
<div class="rotated">Rotated</div>
```
#### CSS
```
body {
perspective: 800px;
}
div {
width: 80px;
height: 80px;
background-color: skyblue;
}
.rotated {
transform: rotate3d(1, 2, -1, 192deg);
background-color: pink;
}
```
#### Result
Specifications
--------------
| Specification |
| --- |
| [CSS Transforms Module Level 2 # funcdef-rotate3d](https://w3c.github.io/csswg-drafts/css-transforms-2/#funcdef-rotate3d) |
Browser compatibility
---------------------
| | Desktop | Mobile |
| --- | --- | --- |
| | Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet |
| `rotate3d` | 12 | 12 | 10 | 10 | 15 | 4 | 3 | 18 | 10 | 14 | 3.2 | 1.0 |
See also
--------
* [`transform`](../transform) property
* [`rotate`](../rotate) property
* [`<transform-function>`](../transform-function)
css rotate() rotate()
========
The `rotate()` [CSS](https://developer.mozilla.org/en-US/docs/Web/CSS) [function](../css_functions) defines a transformation that rotates an element around a fixed point on the 2D plane, without deforming it. Its result is a [`<transform-function>`](../transform-function) data type.
Try it
------
The fixed point that the element rotates around — mentioned above — is also known as the **transform origin**. This defaults to the center of the element, but you can set your own custom transform origin using the [`transform-origin`](../transform-origin) property.
Syntax
------
The amount of rotation created by `rotate()` is specified by an [`<angle>`](../angle). If positive, the movement will be clockwise; if negative, it will be counter-clockwise. A rotation by 180° is called *point reflection*.
```
rotate(a)
```
### Values
*a* Is an [`<angle>`](../angle) representing the angle of the rotation. The direction of rotation depends on the writing direction. In a left-to-right context, a positive angle denotes a clockwise rotation, a negative angle a counter-clockwise one. In a right-to-left context, a positive angle denotes a counter-clockwise rotation, a negative angle a clockwise one.
| Cartesian coordinates on ℝ^2 | Homogeneous coordinates on ℝℙ^2 | Cartesian coordinates on ℝ^3 | Homogeneous coordinates on ℝℙ^3 |
| --- | --- | --- | --- |
| ( cos ( a ) - sin ( a ) sin ( a ) cos ( a ) ) | ( cos ( a ) - sin ( a ) 0 sin ( a ) cos ( a ) 0 0 0 1 ) | ( cos ( a ) - sin ( a ) 0 sin ( a ) cos ( a ) 0 0 0 1 ) | ( cos ( a ) - sin ( a ) 0 0 sin ( a ) cos ( a ) 0 0 0 0 1 0 0 0 0 1 ) |
| `[cos(a) sin(a) -sin(a) cos(a) 0 0]` |
Examples
--------
### Basic example
#### HTML
```
<div>Normal</div>
<div class="rotated">Rotated</div>
```
#### CSS
```
div {
width: 80px;
height: 80px;
background-color: skyblue;
}
.rotated {
transform: rotate(45deg); /\* Equal to rotateZ(45deg) \*/
background-color: pink;
}
```
#### Result
### Combining rotation with another transformation
If you want apply multiple transformations to an element, be careful about the order in which you specify your transformations. For example, if you rotate before translating, the translation will be along the new axis of rotation!
#### HTML
```
<div>Normal</div>
<div class="rotate">Rotated</div>
<div class="rotate-translate">Rotated + Translated</div>
<div class="translate-rotate">Translated + Rotated</div>
```
#### CSS
```
div {
position: absolute;
left: 40px;
top: 40px;
width: 100px;
height: 100px;
background-color: lightgray;
}
.rotate {
background-color: transparent;
outline: 2px dashed;
transform: rotate(45deg);
}
.rotate-translate {
background-color: pink;
transform: rotate(45deg) translateX(180px);
}
.translate-rotate {
background-color: gold;
transform: translateX(180px) rotate(45deg);
}
```
#### Result
Specifications
--------------
| Specification |
| --- |
| [CSS Transforms Module Level 1 # funcdef-transform-rotate](https://w3c.github.io/csswg-drafts/css-transforms/#funcdef-transform-rotate) |
Browser compatibility
---------------------
| | Desktop | Mobile |
| --- | --- | --- |
| | Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet |
| `rotate` | 1 | 12 | 3.5 | 9 | 10.5 | 3.1 | 2 | 18 | 4 | 11 | 3.2 | 1.0 |
See also
--------
* [`transform`](../transform) property
* [`rotate`](../rotate) property
* [`<transform-function>`](../transform-function)
* [`rotate3d()`](rotate3d)
css scaleZ() scaleZ()
========
The `scaleZ()` [CSS](https://developer.mozilla.org/en-US/docs/Web/CSS) [function](../css_functions) defines a transformation that resizes an element along the z-axis. Its result is a [`<transform-function>`](../transform-function) data type.
Try it
------
This scaling transformation modifies the z-coordinate of each element point by a constant factor, except when the scale factor is 1, in which case the function is the identity transform. The scaling is not isotropic, and the angles of the element are not conserved. `scaleZ(-1)` defines an [axial symmetry](https://en.wikipedia.org/wiki/Axial_symmetry), with the z-axis passing through the origin (as specified by the [`transform-origin`](../transform-origin) property).
In the above interactive examples, [`perspective: 550px;`](../perspective) (to create a 3D space) and [`transform-style: preserve-3d;`](../transform-style) (so the children, the 6 sides of the cube, are also positioned in the 3D space), have been set on the cube.
**Note:** `scaleZ(sz)` is equivalent to `scale3d(1, 1, sz)`.
Syntax
------
```
scaleZ(s)
```
### Values
`s` Is a [`<number>`](../number) representing the scaling factor to apply on the z-coordinate of each point of the element.
| Cartesian coordinates on ℝ^2 | Homogeneous coordinates on ℝℙ^2 | Cartesian coordinates on ℝ^3 | Homogeneous coordinates on ℝℙ^3 |
| --- | --- | --- | --- |
| This transformation applies to the 3D space and can't be represented on the plane. | ( 1 0 0 0 1 0 0 0 s ) | ( 1 0 0 0 0 1 0 0 0 0 s 0 0 0 0 1 ) |
Examples
--------
### HTML
```
<div>Normal</div>
<div class="perspective">Translated</div>
<div class="scaled-translated">Scaled</div>
```
### CSS
```
div {
width: 80px;
height: 80px;
background-color: skyblue;
}
.perspective {
/\* Includes a perspective to create a 3D space \*/
transform: perspective(400px) translateZ(-100px);
background-color: limegreen;
}
.scaled-translated {
/\* Includes a perspective to create a 3D space \*/
transform: perspective(400px) scaleZ(2) translateZ(-100px);
background-color: pink;
}
```
### Result
Specifications
--------------
| Specification |
| --- |
| [CSS Transforms Module Level 2 # funcdef-scalez](https://w3c.github.io/csswg-drafts/css-transforms-2/#funcdef-scalez) |
Browser compatibility
---------------------
| | Desktop | Mobile |
| --- | --- | --- |
| | Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet |
| `scaleZ` | 12 | 12 | 10 | 10 | 15 | 4 | 3 | 18 | 10 | 14 | 3.2 | 1.0 |
See also
--------
* [`scaleX()`](scalex)
* [`scaleY()`](scaley)
* [`transform`](../transform)
* [`<transform-function>`](../transform-function)
* [`transform-origin`](../transform-origin)
* Individual transform properties:
+ [`translate`](../translate)
+ [`scale`](../scale)
+ [`rotate`](../rotate)
+ Note: there is no `skew` property
| programming_docs |
css perspective() perspective()
=============
The `perspective()` [CSS](https://developer.mozilla.org/en-US/docs/Web/CSS) [function](../css_functions) defines a transformation that sets the distance between the user and the z=0 plane, the perspective from which the viewer would be if the 2-dimensional interface were 3-dimensional. Its result is a [`<transform-function>`](../transform-function) data type.
Try it
------
The `perspective()` transform function is part of the [`transform`](../transform) value applied on the element being transformed. This differs from the [`perspective`](../perspective) and [`perspective-origin`](../perspective-origin) properties which are attached to the parent of a child transformed in 3-dimensional space.
Syntax
------
The perspective distance used by `perspective()` is specified by a [`<length>`](../length) value, which represents the distance between the user and the z=0 plane, or by `none`. The z=0 plane is the plane where everything appears in a 2-dimensional view, or the screen. Negative values are syntax errors. Values smaller than `1px` (including zero) are clamped to `1px`. Values other than `none` cause elements with positive z positions to appear larger, and elements with negative z positions to appear smaller. Elements with z positions equal to or larger than the perspective value disappear as though they are behind the user. Large values of perspective represent a small transformation; small values of `perspective()` represent a large transformation; `perspective(none)` represents perspective from infinite distance and no transformation.
```
perspective(d)
```
### Values
*d* Is a [`<length>`](../length) representing the distance from the user to the z=0 plane. If it is 0 or a negative value, no perspective transform is applied.
| Cartesian coordinates on ℝ^2 | Homogeneous coordinates on ℝℙ^2 | Cartesian coordinates on ℝ^3 | Homogeneous coordinates on ℝℙ^3 |
| --- | --- | --- | --- |
| This transformation applies to the 3D space and can't be represented on the plane. | This transformation is not a linear transformation in ℝ^3, and can't be represented using a Cartesian-coordinate matrix. | ( 1 0 0 0 0 1 0 0 0 0 1 0 0 0 − 1 / d 1 ) |
Examples
--------
### HTML
```
<p>Without perspective:</p>
<div class="no-perspective-box">
<div class="face front">A</div>
<div class="face top">B</div>
<div class="face left">C</div>
</div>
<p>With perspective (9cm):</p>
<div class="perspective-box-far">
<div class="face front">A</div>
<div class="face top">B</div>
<div class="face left">C</div>
</div>
<p>With perspective (4cm):</p>
<div class="perspective-box-closer">
<div class="face front">A</div>
<div class="face top">B</div>
<div class="face left">C</div>
</div>
```
### CSS
```
.face {
position: absolute;
width: 100px;
height: 100px;
line-height: 100px;
font-size: 100px;
text-align: center;
}
p + div {
width: 100px;
height: 100px;
transform-style: preserve-3d;
margin-left: 100px;
}
.no-perspective-box {
transform: rotateX(-15deg) rotateY(30deg);
}
.perspective-box-far {
transform: perspective(9cm) rotateX(-15deg) rotateY(30deg);
}
.perspective-box-closer {
transform: perspective(4cm) rotateX(-15deg) rotateY(30deg);
}
.top {
background-color: skyblue;
transform: rotateX(90deg) translate3d(0, 0, 50px);
}
.left {
background-color: pink;
transform: rotateY(-90deg) translate3d(0, 0, 50px);
}
.front {
background-color: limegreen;
transform: translate3d(0, 0, 50px);
}
```
### Result
Specifications
--------------
| Specification |
| --- |
| [CSS Transforms Module Level 2 # funcdef-perspective](https://w3c.github.io/csswg-drafts/css-transforms-2/#funcdef-perspective) |
Browser compatibility
---------------------
| | Desktop | Mobile |
| --- | --- | --- |
| | Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet |
| `perspective` | 12 | 12 | 10 | 10 | 15 | 4 | 3 | 18 | 10 | 14 | 3.2 | 1.0 |
See also
--------
* [`transform`](../transform)
* [`<transform-function>`](../transform-function)
* Individual transform properties:
+ [`translate`](../translate)
+ [`scale`](../scale)
+ [`rotate`](../rotate)
css translateZ() translateZ()
============
The `translateZ()` [CSS](https://developer.mozilla.org/en-US/docs/Web/CSS) [function](../css_functions) repositions an element along the z-axis in 3D space, i.e., closer to or farther away from the viewer. Its result is a [`<transform-function>`](../transform-function) data type.
Try it
------
This transformation is defined by a [`<length>`](../length) which specifies how far inward or outward the element or elements move.
In the above interactive examples, [`perspective: 550px;`](../perspective) (to create a 3D space) and [`transform-style: preserve-3d;`](../transform-style) (so the children, the 6 sides of the cube, are also positioned in the 3D space), have been set on the cube.
**Note:** `translateZ(tz)` is equivalent to `translate3d(0, 0, tz)`.
Syntax
------
```
translateZ(tz)
```
### Values
`tz` A [`<length>`](../length) representing the z-component of the translating vector. A positive value moves the element towards the viewer, and a negative value farther away.
| Cartesian coordinates on ℝ^2 | Homogeneous coordinates on ℝℙ^2 | Cartesian coordinates on ℝ^3 | Homogeneous coordinates on ℝℙ^3 |
| --- | --- | --- | --- |
| This transformation applies to the 3D space and can't be represented on the plane. | A translation is not a linear transformation in ℝ^3 and can't be represented using a Cartesian-coordinate matrix. | ( 1 0 0 0 0 1 0 0 0 0 1 t 0 0 0 1 ) |
Examples
--------
In this example, two boxes are created. One is positioned normally on the page, without being translated at all. The second is altered by applying perspective to create a 3D space, then moved towards the user.
### HTML
```
<div>Static</div>
<div class="moved">Moved</div>
```
### CSS
```
div {
position: relative;
width: 60px;
height: 60px;
left: 100px;
background-color: skyblue;
}
.moved {
transform: perspective(500px) translateZ(200px);
background-color: pink;
}
```
What really matters here is the class "moved"; let's take a look at what it does. First, the [`perspective()`](perspective) function positions the viewer relative to the plane that lies where z=0 (in essence, the surface of the screen). A value of `500px` means the user is 500 pixels "in front of" the imagery located at z=0.
Then, the `translateZ()` function moves the element 200 pixels "outward" from the screen, toward the user. This has the effect of making the element appear larger when viewed on a 2D display, or closer when viewed using a VR headset or other 3D display device.
Note if the `perspective()` value is less than the `translateZ()` value, such as `transform: perspective(200px) translateZ(300px);` the transformed element will not be visible as it is further than the user's viewport. The smaller the difference between the perspective and translateZ values, the closer the user is to the element and the larger the translated element will seem.
**Note:** As the composition of transforms isn't commutative, the order you write the different functions is significant. In particular, in general, you want `perspective()` to be placed before `translateZ()`.
### Result
Specifications
--------------
| Specification |
| --- |
| [CSS Transforms Module Level 2 # funcdef-translatez](https://w3c.github.io/csswg-drafts/css-transforms-2/#funcdef-translatez) |
Browser compatibility
---------------------
| | Desktop | Mobile |
| --- | --- | --- |
| | Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet |
| `translateZ` | 12 | 12 | 10 | 10 | 15 | 4 | 3 | 18 | 10 | 14 | 3.2 | 1.0 |
See also
--------
* [`transform`](../transform)
* [`<transform-function>`](../transform-function)
* [`translate`](../translate)
css matrix3d() matrix3d()
==========
The `matrix3d()` [CSS](https://developer.mozilla.org/en-US/docs/Web/CSS) [function](../css_functions) defines a 3D transformation as a 4x4 homogeneous matrix. Its result is a [`<transform-function>`](../transform-function) data type.
Try it
------
Syntax
------
The `matrix3d()` function is specified with 16 values. They are described in the column-major order.
```
matrix3d(a1, b1, c1, d1, a2, b2, c2, d2, a3, b3, c3, d3, a4, b4, c4, d4)
```
### Values
*a1* *b1* *c1* *d1* *a2* *b2* *c2* *d2* *a3* *b3* *c3* *d3* Are [`<number>`](../number)s describing the linear transformation.
*a4* *b4* *c4 d4*
Are [`<number>`](../number)s describing the translation to apply.
| Cartesian coordinates on ℝ^2 | Homogeneous coordinates on ℝℙ^2 | Cartesian coordinates on ℝ^3 | Homogeneous coordinates on ℝℙ^3 |
| --- | --- | --- | --- |
| This transformation applies to the 3D space and can't be represented on the plane. | A generic 3D [affine transformation](https://en.wikipedia.org/wiki/Affine_transformation) can't be represented using a Cartesian-coordinate matrix, as translations are not linear transformations. | ( a1 a2 a3 a4 b1 b2 b3 b4 c1 c2 c3 c4 d1 d2 d3 d4 ) |
Examples
--------
### Cube squashing example
The following example shows a 3D cube created from DOM elements and transforms, which can be hovered/focused to apply a `matrix3d()` transform to it.
#### HTML
```
<section id="example-element" tabindex="0">
<div class="face front">1</div>
<div class="face back">2</div>
<div class="face right">3</div>
<div class="face left">4</div>
<div class="face top">5</div>
<div class="face bottom">6</div>
</section>
```
#### CSS
```
#example-element {
width: 100px;
height: 100px;
transform-style: preserve-3d;
transition: transform 1.5s;
transform: rotate3d(1, 1, 1, 30deg);
margin: 50px auto;
}
#example-element:hover,
#example-element:focus {
transform: rotate3d(1, 1, 1, 30deg) matrix3d(
1,
0,
0,
0,
0,
1,
6,
0,
0,
0,
1,
0,
50,
100,
0,
1.1
);
}
.face {
display: flex;
align-items: center;
justify-content: center;
width: 100%;
height: 100%;
position: absolute;
backface-visibility: inherit;
font-size: 60px;
color: #fff;
}
.front {
background: rgba(90, 90, 90, 0.7);
transform: translateZ(50px);
}
.back {
background: rgba(0, 210, 0, 0.7);
transform: rotateY(180deg) translateZ(50px);
}
.right {
background: rgba(210, 0, 0, 0.7);
transform: rotateY(90deg) translateZ(50px);
}
.left {
background: rgba(0, 0, 210, 0.7);
transform: rotateY(-90deg) translateZ(50px);
}
.top {
background: rgba(210, 210, 0, 0.7);
transform: rotateX(90deg) translateZ(50px);
}
.bottom {
background: rgba(210, 0, 210, 0.7);
transform: rotateX(-90deg) translateZ(50px);
}
```
#### Result
### Matrix translation and scale example
Another `transform3d()` example, which implements an animated combined translate and scale.
#### HTML
```
<div class="foo">
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Quos quaerat sit
soluta, quisquam exercitationem delectus qui unde in facere necessitatibus aut
quia porro dolorem nesciunt enim, at consequuntur aliquam esse?
</div>
```
#### CSS
```
html {
width: 100%;
}
body {
height: 100vh;
/\* Centering content \*/
display: flex;
flex-flow: row wrap;
justify-content: center;
align-content: center;
}
.foo {
width: 50%;
padding: 1em;
color: white;
background: #ff8c66;
border: 2px dashed black;
text-align: center;
font-family: system-ui, sans-serif;
font-size: 14px;
/\* Setting up animation for better demonstration \*/
animation: MotionScale 2s alternate linear infinite;
}
@keyframes MotionScale {
from {
/\*
Identity matrix is used as basis here.
The matrix below describes the
following transformations:
Translates every X point by -50px
Translates every Y point by -100px
Translates every Z point by 0
Scales down by 10%
\*/
transform: matrix3d(
1,0,0,0,
0,1,0,0,
0,0,1,0,
-50,-100,0,1.1
);
}
50% {
transform: matrix3d(
1,0,0,0,
0,1,0,0,
0,0,1,0,
0,0,0,0.9
);
}
to {
transform: matrix3d(
1,0,0,0,
0,1,0,0,
0,0,1,0,
50,100,0,1.1
)
}
}
```
#### Result
Specifications
--------------
| Specification |
| --- |
| [CSS Transforms Module Level 2 # funcdef-matrix3d](https://w3c.github.io/csswg-drafts/css-transforms-2/#funcdef-matrix3d) |
Browser compatibility
---------------------
| | Desktop | Mobile |
| --- | --- | --- |
| | Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet |
| `matrix3d` | 12 | 12 | 10
Before Firefox 16, the translation values of `matrix3d()` could be [`<length>`](https://developer.mozilla.org/docs/Web/CSS/length)s, in addition to the standard [`<number>`](https://developer.mozilla.org/docs/Web/CSS/number). | 10 | 15 | 4 | 3 | 18 | 10 | 14 | 3.2 | 1.0 |
See also
--------
* [`transform`](../transform)
* Individual transform properties:
+ [`translate`](../translate)
+ [`scale`](../scale)
+ [`rotate`](../rotate)
* [`<transform-function>`](../transform-function)
* [Understanding the CSS Transforms Matrix](https://dev.opera.com/articles/understanding-the-css-transforms-matrix/) (2012)
css rotateZ() rotateZ()
=========
The `rotateZ()` [CSS](https://developer.mozilla.org/en-US/docs/Web/CSS) [function](../css_functions) defines a transformation that rotates an element around the z-axis without deforming it. Its result is a [`<transform-function>`](../transform-function) data type.
Try it
------
The axis of rotation passes through an origin, defined by the [`transform-origin`](../transform-origin) CSS property.
**Note:** `rotateZ(a)` is equivalent to `rotate(a)` or `rotate3d(0, 0, 1, a)`.
**Note:** Unlike rotations in the 2D plane, the composition of 3D rotations is usually not commutative. In other words, the order in which the rotations are applied impacts the result.
Syntax
------
The amount of rotation created by `rotateZ()` is specified by an [`<angle>`](../angle). If positive, the movement will be clockwise; if negative, it will be counter-clockwise.
```
rotateZ(a)
```
### Values
`a` Is an [`<angle>`](../angle) representing the angle of the rotation. A positive angle denotes a clockwise rotation, a negative angle a counter-clockwise one.
| Cartesian coordinates on ℝ^2 | Homogeneous coordinates on ℝℙ^2 | Cartesian coordinates on ℝ^3 | Homogeneous coordinates on ℝℙ^3 |
| --- | --- | --- | --- |
| This transformation applies to the 3D space and can't be represented on the plane. | ( cos ( a ) - sin ( a ) 0 sin ( a ) cos ( a ) 0 0 0 1 ) | ( cos ( a ) - sin ( a ) 0 0 sin ( a ) cos ( a ) 0 0 0 0 1 0 0 0 0 1 ) |
Examples
--------
### HTML
```
<div>Normal</div>
<div class="rotated">Rotated</div>
```
### CSS
```
div {
width: 80px;
height: 80px;
background-color: skyblue;
}
.rotated {
transform: rotateZ(45deg);
background-color: pink;
}
```
### Result
Specifications
--------------
| Specification |
| --- |
| [CSS Transforms Module Level 2 # funcdef-rotatez](https://w3c.github.io/csswg-drafts/css-transforms-2/#funcdef-rotatez) |
Browser compatibility
---------------------
| | Desktop | Mobile |
| --- | --- | --- |
| | Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet |
| `rotateZ` | 12 | 12 | 10 | 10 | 15 | 4 | 3 | 18 | 10 | 14 | 3.2 | 1.0 |
See also
--------
* [`transform`](../transform) property
* [`rotate`](../rotate) property
* [`<transform-function>`](../transform-function)
css translate() translate()
===========
The `translate()` [CSS](https://developer.mozilla.org/en-US/docs/Web/CSS) [function](../css_functions) repositions an element in the horizontal and/or vertical directions. Its result is a [`<transform-function>`](../transform-function) data type.
Try it
------
This transformation is characterized by a two-dimensional vector. Its coordinates define how much the element moves in each direction.
Syntax
------
```
/\* Single <length-percentage> values \*/
transform: translate(200px);
transform: translate(50%);
/\* Double <length-percentage> values \*/
transform: translate(100px, 200px);
transform: translate(100px, 50%);
transform: translate(30%, 200px);
transform: translate(30%, 50%);
```
### Values
Single `<length-percentage>` values This value is a [`<length>`](../length) or [`<percentage>`](../percentage) representing the abscissa (horizontal, x-coordinate) of the translating vector. The ordinate (vertical, y-coordinate) of the translating vector will be set to `0`. For example, `translate(2px)` is equivalent to `translate(2px, 0)`. A percentage value refers to the width of the reference box defined by the [`transform-box`](../transform-box) property.
Double `<length-percentage>` values This value describes two [`<length>`](../length) or [`<percentage>`](../percentage) values representing both the abscissa (x-coordinate) and the ordinate (y-coordinate) of the translating vector. A percentage as first value refers to the width, as second part to the height of the reference box defined by the [`transform-box`](../transform-box) property.
| Cartesian coordinates on ℝ^2 | Homogeneous coordinates on ℝℙ^2 | Cartesian coordinates on ℝ^3 | Homogeneous coordinates on ℝℙ^3 |
| --- | --- | --- | --- |
| A translation is not a linear transformation in ℝ^2 and can't be represented using a Cartesian-coordinate matrix. | ( 1 0 tx 0 1 ty 0 0 1 ) | ( 1 0 tx 0 1 ty 0 0 1 ) | ( 1 0 0 tx 0 1 0 ty 0 0 1 0 0 0 0 1 ) |
| `[1 0 0 1 tx ty]` |
### Formal syntax
```
translate(<length-percentage>, <length-percentage>?)
```
Examples
--------
### Using a single-axis translation
#### HTML
```
<div>Static</div>
<div class="moved">Moved</div>
<div>Static</div>
```
#### CSS
```
div {
width: 60px;
height: 60px;
background-color: skyblue;
}
.moved {
/\* Equal to: translateX(10px) or translate(10px, 0) \*/
transform: translate(
10px
);
background-color: pink;
}
```
#### Result
### Combining y-axis and x-axis translation
#### HTML
```
<div>Static</div>
<div class="moved">Moved</div>
<div>Static</div>
```
#### CSS
```
div {
width: 60px;
height: 60px;
background-color: skyblue;
}
.moved {
transform: translate(10px, 10px);
background-color: pink;
}
```
#### Result
Specifications
--------------
| Specification |
| --- |
| [CSS Transforms Module Level 1 # funcdef-transform-translate](https://w3c.github.io/csswg-drafts/css-transforms/#funcdef-transform-translate) |
Browser compatibility
---------------------
| | Desktop | Mobile |
| --- | --- | --- |
| | Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet |
| `translate` | 1 | 12 | 3.5 | 9 | 10.5 | 3.1 | 2 | 18 | 4 | 11 | 3.2 | 1.0 |
See also
--------
* [`transform`](../transform)
* [`<transform-function>`](../transform-function)
* [`translate`](../translate)
| programming_docs |
css scale() scale()
=======
The `scale()` [CSS](https://developer.mozilla.org/en-US/docs/Web/CSS) [function](../css_functions) defines a transformation that resizes an element on the 2D plane. Because the amount of scaling is defined by a vector, it can resize the horizontal and vertical dimensions at different scales. Its result is a [`<transform-function>`](../transform-function) data type.
Try it
------
This scaling transformation is characterized by a two-dimensional vector. Its coordinates define how much scaling is done in each direction. If both coordinates are equal, the scaling is uniform (*isotropic*) and the aspect ratio of the element is preserved (this is a [homothetic transformation](https://en.wikipedia.org/wiki/Homothetic_transformation)).
When a coordinate value is outside the [-1, 1] range, the element grows along that dimension; when inside, it shrinks. A negative value results in a [point reflection](https://en.wikipedia.org/wiki/Point_reflection) in that dimension. The value `1` has no effect.
**Note:** The `scale()` function only scales in 2D. To scale in 3D, use [`scale3d()`](scale3d) instead.
Syntax
------
The `scale()` function is specified with either one or two values, which represent the amount of scaling to be applied in each direction.
```
scale(sx)
scale(sx, sy)
```
### Values
`sx` A [`<number>`](../number) or [`<percentage>`](../percentage) representing the abscissa of the scaling vector.
`sy` A [`<number>`](../number) or [`<percentage>`](../percentage) representing the ordinate of the scaling vector. If not defined, its default value is `sx`, resulting in a uniform scaling that preserves the element's aspect ratio.
| Cartesian coordinates on ℝ^2 | Homogeneous coordinates on ℝℙ^2 | Cartesian coordinates on ℝ^3 | Homogeneous coordinates on ℝℙ^3 |
| --- | --- | --- | --- |
| ( sx 0 0 sy ) | ( sx 0 0 0 sy 0 0 0 1 ) | ( sx 0 0 0 sy 0 0 0 1 ) | ( sx 0 0 0 0 sy 0 0 0 0 1 0 0 0 0 1 ) |
| `[sx 0 0 sy 0 0]` |
Accessibility concerns
----------------------
Scaling/zooming animations are problematic for accessibility, as they are a common trigger for certain types of migraine. If you need to include such animations on your website, you should provide a control to allow users to turn off animations, preferably site-wide.
Also, consider making use of the [`prefers-reduced-motion`](../@media/prefers-reduced-motion) media feature — use it to write a [media query](../media_queries) that will turn off animations if the user has reduced animation specified in their system preferences.
Find out more:
* [MDN Understanding WCAG, Guideline 2.3 explanations](https://developer.mozilla.org/en-US/docs/Web/Accessibility/Understanding_WCAG/Operable#guideline_2.3_%e2%80%94_seizures_and_physical_reactions_do_not_design_content_in_a_way_that_is_known_to_cause_seizures_or_physical_reactions)
* [Understanding Success Criterion 2.3.3 | W3C Understanding WCAG 2.1](https://www.w3.org/WAI/WCAG21/Understanding/animation-from-interactions)
Examples
--------
### Scaling the X and Y dimensions together
#### HTML
```
<div>Normal</div>
<div class="scaled">Scaled</div>
```
#### CSS
```
div {
width: 80px;
height: 80px;
background-color: skyblue;
}
.scaled {
transform: scale(0.7); /\* Equal to scaleX(0.7) scaleY(0.7) \*/
background-color: pink;
}
```
#### Result
### Scaling X and Y dimensions separately, and translating the origin
#### HTML
```
<div>Normal</div>
<div class="scaled">Scaled</div>
```
#### CSS
```
div {
width: 80px;
height: 80px;
background-color: skyblue;
}
.scaled {
transform: scale(2, 0.5); /\* Equal to scaleX(2) scaleY(0.5) \*/
transform-origin: left;
background-color: pink;
}
```
#### Result
Specifications
--------------
| Specification |
| --- |
| [CSS Transforms Module Level 1 # funcdef-transform-scale](https://w3c.github.io/csswg-drafts/css-transforms/#funcdef-transform-scale) |
Browser compatibility
---------------------
| | Desktop | Mobile |
| --- | --- | --- |
| | Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet |
| `scale` | 1 | 12 | 3.5 | 9 | 10.5 | 3.1 | 2 | 18 | 4 | 11 | 3.2 | 1.0 |
See also
--------
* [`transform`](../transform)
* [`scale`](../scale)
* [`<transform-function>`](../transform-function)
* [`scale3d()`](scale3d)
* Other individual transform properties [`translate`](../translate) and [`rotate`](../rotate)
css scale3d() scale3d()
=========
The `scale3d()` [CSS](https://developer.mozilla.org/en-US/docs/Web/CSS) [function](../css_functions) defines a transformation that resizes an element in 3D space. Because the amount of scaling is defined by a vector, it can resize different dimensions at different scales. Its result is a [`<transform-function>`](../transform-function) data type.
Try it
------
This scaling transformation is characterized by a three-dimensional vector. Its coordinates define how much scaling is done in each direction. If all three coordinates are equal, the scaling is uniform (*isotropic*) and the aspect ratio of the element is preserved (this is a [homothetic transformation](https://en.wikipedia.org/wiki/Homothetic_transformation)).
When a coordinate value is outside the [-1, 1] range, the element grows along that dimension; when inside, it shrinks. If it is negative, the result a [point reflection](https://en.wikipedia.org/wiki/Point_reflection) in that dimension. A value of 1 has no effect.
Syntax
------
The `scale3d()` function is specified with three values, which represent the amount of scaling to be applied in each direction.
```
scale3d(sx, sy, sz)
```
### Values
`sx` Is a [`<number>`](../number) representing the abscissa of the scaling vector.
`sy` Is a [`<number>`](../number) representing the ordinate of the scaling vector.
`sz` Is a [`<number>`](../number) representing the z-component of the scaling vector.
| Cartesian coordinates on ℝ^2 | Homogeneous coordinates on ℝℙ^2 | Cartesian coordinates on ℝ^3 | Homogeneous coordinates on ℝℙ^3 |
| --- | --- | --- | --- |
| This transformation applies to the 3D space and can't be represented on the plane. | ( sx 0 0 0 sy 0 0 0 sz ) | ( sx 0 0 0 0 sy 0 0 0 0 sz 0 0 0 0 1 ) |
Examples
--------
### Without changing the origin
#### HTML
```
<div>Normal</div>
<div class="scaled">Scaled</div>
```
#### CSS
```
div {
width: 80px;
height: 80px;
background-color: skyblue;
}
.scaled {
transform: perspective(500px) scale3d(2, 0.7, 0.2) translateZ(100px);
background-color: pink;
}
```
#### Result
### Translating the origin of the transformation
#### HTML
```
<div>Normal</div>
<div class="scaled">Scaled</div>
```
#### CSS
```
div {
width: 80px;
height: 80px;
background-color: skyblue;
}
.scaled {
transform: perspective(500px) scale3d(2, 0.7, 0.2) translateZ(100px);
transform-origin: left;
background-color: pink;
}
```
#### Result
Specifications
--------------
| Specification |
| --- |
| [CSS Transforms Module Level 2 # funcdef-scale3d](https://w3c.github.io/csswg-drafts/css-transforms-2/#funcdef-scale3d) |
Browser compatibility
---------------------
| | Desktop | Mobile |
| --- | --- | --- |
| | Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet |
| `scale3d` | 12 | 12 | 10 | 10 | 15 | 4 | 3 | 18 | 10 | 14 | 3.2 | 1.0 |
See also
--------
* [`transform`](../transform)
* [`<transform-function>`](../transform-function)
* [`scaleZ()`](scalez)
* [`translate3d()`](translate3d)
* [`rotate3d()`](rotate3d)
* Individual transform properties:
+ [`translate`](../translate)
+ [`scale`](../scale)
+ [`rotate`](../rotate)
css Implementing image sprites in CSS Implementing image sprites in CSS
=================================
**Image sprites** are used in numerous web apps where multiple images are used. Rather than include each image as a separate image file, it is much more memory- and bandwidth-friendly to send them as a single image; using background position as a way to distinguish between individual images in the same image file, so the number of HTTP requests is reduced.
**Note:** When using HTTP/2, it may in fact be more bandwidth-friendly to use multiple small requests.
Implementation
--------------
Suppose an image is given to every item with class `toolbtn`:
```
.toolbtn {
background: url(myfile.png);
display: inline-block;
height: 20px;
width: 20px;
}
```
A background position can be added either as two x, y values after the [`url()`](../url) in the background, or as [`background-position`](../background-position). For example:
```
#btn1 {
background-position: -20px 0px;
}
#btn2 {
background-position: -40px 0px;
}
```
This would slide the starting point of the background image for the element with the ID `btn1` 20 pixels to the left and the element with the ID `btn2` 40 pixels to the left (assuming they have the class `toolbtn` assigned and are affected by the image rule above).
Similarly, you can also make hover states with:
```
#btn:hover {
background-position: <pixels shifted right>px <pixels shifted down>px;
}
```
See also
--------
* [Full working demo at CSS Tricks](https://css-tricks.com/snippets/css/perfect-css-sprite-sliding-doors-button/)
css Using CSS gradients Using CSS gradients
===================
**CSS gradients** are represented by the [`<gradient>`](../gradient) data type, a special type of [`<image>`](../image) made of a progressive transition between two or more colors. You can choose between three types of gradients: *linear* (created with the [`linear-gradient()`](../gradient/linear-gradient) function), *radial* (created with the [`radial-gradient()`](../gradient/radial-gradient) function), and *conic* (created with the [`conic-gradient()`](../gradient/conic-gradient) function). You can also create repeating gradients with the [`repeating-linear-gradient()`](../gradient/repeating-linear-gradient), [`repeating-radial-gradient()`](../gradient/repeating-radial-gradient), and [`repeating-conic-gradient()`](../gradient/repeating-conic-gradient) functions.
Gradients can be used anywhere you would use an `<image>`, such as in backgrounds. Because gradients are dynamically generated, they can negate the need for the raster image files that traditionally were used to achieve similar effects. In addition, because gradients are generated by the browser, they look better than raster images when zoomed in, and can be resized on the fly.
We'll start by introducing linear gradients, then introduce features that are supported in all gradient types using linear gradients as the example, then move on to radial, conic and repeating gradients
Using linear gradients
----------------------
A linear gradient creates a band of colors that progress in a straight line.
### A basic linear gradient
To create the most basic type of gradient, all you need is to specify two colors. These are called *color stops*. You must have at least two, but you can have as many as you want.
```
.simple-linear {
background: linear-gradient(blue, pink);
}
```
### Changing the direction
By default, linear gradients run from top to bottom. You can change their rotation by specifying a direction.
```
.horizontal-gradient {
background: linear-gradient(to right, blue, pink);
}
```
### Diagonal gradients
You can even make the gradient run diagonally, from corner to corner.
```
.diagonal-gradient {
background: linear-gradient(to bottom right, blue, pink);
}
```
### Using angles
If you want more control over its direction, you can give the gradient a specific angle.
```
.angled-gradient {
background: linear-gradient(70deg, blue, pink);
}
```
When using an angle, `0deg` creates a vertical gradient running bottom to top, `90deg` creates a horizontal gradient running left to right, and so on in a clockwise direction. Negative angles run in the counterclockwise direction.
Declaring colors & creating effects
-----------------------------------
All CSS gradient types are a range of position-dependent colors. The colors produced by CSS gradients can vary continuously with position, producing smooth color transitions. It is also possible to create bands of solid colors, and hard transitions between two colors. The following are valid for all gradient functions:
### Using more than two colors
You don't have to limit yourself to two colors—you may use as many as you like! By default, colors are evenly spaced along the gradient.
```
.auto-spaced-linear-gradient {
background: linear-gradient(red, yellow, blue, orange);
}
```
### Positioning color stops
You don't have to leave your color stops at their default positions. To fine-tune their locations, you can give each one zero, one, or two percentage or, for radial and linear gradients, absolute length values. If you specify the location as a percentage, `0%` represents the starting point, while `100%` represents the ending point; however, you can use values outside that range if necessary to get the effect you want. If you leave a location unspecified, the position of that particular color stop will be automatically calculated for you, with the first color stop being at `0%` and the last color stop being at `100%`, and any other color stops being half way between their adjacent color stops.
```
.multicolor-linear {
background: linear-gradient(to left, lime 28px, red 77%, cyan);
}
```
### Creating hard lines
To create a hard line between two colors, creating a stripe instead of a gradual transition, adjacent color stops can be set to the same location. In this example, the colors share a color stop at the `50%` mark, halfway through the gradient:
```
.striped {
background: linear-gradient(to bottom left, cyan 50%, palegoldenrod 50%);
}
```
### Gradient hints
By default, the gradient transitions evenly from one color to the next. You can include a color-hint to move the midpoint of the transition value to a certain point along the gradient. In this example, we've moved the midpoint of the transition from the 50% mark to the 10% mark.
```
.color-hint {
background: linear-gradient(blue, 10%, pink);
}
.simple-linear {
background: linear-gradient(blue, pink);
}
```
### Creating color bands & stripes
To include a solid, non-transitioning color area within a gradient, include two positions for the color stop. Color stops can have two positions, which is equivalent to two consecutive color stops with the same color at different positions. The color will reach full saturation at the first color stop, maintain that saturation through to the second color stop, and transition to the adjacent color stop's color through the adjacent color stop's first position.
```
.multiposition-stops {
background: linear-gradient(
to left,
lime 20%,
red 30%,
red 45%,
cyan 55%,
cyan 70%,
yellow 80%
);
background: linear-gradient(
to left,
lime 20%,
red 30% 45%,
cyan 55% 70%,
yellow 80%
);
}
.multiposition-stop2 {
background: linear-gradient(
to left,
lime 25%,
red 25%,
red 50%,
cyan 50%,
cyan 75%,
yellow 75%
);
background: linear-gradient(
to left,
lime 25%,
red 25% 50%,
cyan 50% 75%,
yellow 75%
);
}
```
In the first example above, the lime goes from the 0% mark, which is implied, to the 20% mark, transitions from lime to red over the next 10% of the width of the gradient, reach solid red at the 30% mark, and staying solid red up until 45% through the gradient, where it fades to cyan, being fully cyan for 15% of the gradient, and so on.
In the second example, the second color stop for each color is at the same location as the first color stop for the adjacent color, creating a striped effect.
In both examples, the gradient is written twice: the first is the CSS Images Level 3 method of repeating the color for each stop and the second example is the CSS Images Level 4 multiple color stop method of including two color-stop-lengths in a linear-color-stop declaration.
### Controlling the progression of a gradient
By default, a gradient evenly progresses between the colors of two adjacent color stops, with the midpoint between those two color stops being the midpoint color value. You can control the [interpolation](https://developer.mozilla.org/en-US/docs/Glossary/Interpolation), or progression, between two color stops by including a color hint location. In this example, the color reaches the midpoint between lime and cyan 20% of the way through the gradient rather than 50% of the way through. The second example does not contain the hint to highlight the difference the color hint can make:
```
.colorhint-gradient {
background: linear-gradient(to top, lime, 20%, cyan);
}
.regular-progression {
background: linear-gradient(to top, lime, cyan);
}
```
### Overlaying gradients
Gradients support transparency, so you can stack multiple backgrounds to achieve some pretty fancy effects. The backgrounds are stacked from top to bottom, with the first specified being on top.
```
.layered-image {
background: linear-gradient(to right, transparent, mistyrose),
url("critters.png");
}
```
### Stacked gradients
You can even stack gradients with other gradients. As long as the top gradients aren't entirely opaque, the gradients below will still be visible.
```
.stacked-linear {
background: linear-gradient(
217deg,
rgba(255, 0, 0, 0.8),
rgba(255, 0, 0, 0) 70.71%
), linear-gradient(127deg, rgba(0, 255, 0, 0.8), rgba(0, 255, 0, 0) 70.71%),
linear-gradient(336deg, rgba(0, 0, 255, 0.8), rgba(0, 0, 255, 0) 70.71%);
}
```
Using radial gradients
----------------------
Radial gradients are similar to linear gradients, except that they radiate out from a central point. You can dictate where that central point is. You can also make them circular or elliptical.
### A basic radial gradient
As with linear gradients, all you need to create a radial gradient are two colors. By default, the center of the gradient is at the 50% 50% mark, and the gradient is elliptical matching the aspect ratio of it's box:
```
.simple-radial {
background: radial-gradient(red, blue);
}
```
### Positioning radial color stops
Again like linear gradients, you can position each radial color stop with a percentage or absolute length.
```
.radial-gradient {
background: radial-gradient(red 10px, yellow 30%, #1e90ff 50%);
}
```
### Positioning the center of the gradient
You can position the center of the gradient with keyterms, percentage, or absolute lengths, length and percentage values repeating if only one is present, otherwise in the order of position from the left and position from the top.
```
.radial-gradient {
background: radial-gradient(at 0% 30%, red 10px, yellow 30%, #1e90ff 50%);
}
```
### Sizing radial gradients
Unlike linear gradients, you can specify the size of radial gradients. Possible values include `closest-corner`, `closest-side`, `farthest-corner`, and `farthest-side`, with `farthest-corner` being the default. Circles can also be sized with a length, and ellipses a length or percentage.
#### Example: closest-side for ellipses
This example uses the `closest-side` size value, which means the size is set by the distance from the starting point (the center) to the closest side of the enclosing box.
```
.radial-ellipse-side {
background: radial-gradient(
ellipse closest-side,
red,
yellow 10%,
#1e90ff 50%,
beige
);
}
```
#### Example: farthest-corner for ellipses
This example is similar to the previous one, except that its size is specified as `farthest-corner`, which sets the size of the gradient by the distance from the starting point to the farthest corner of the enclosing box from the starting point.
```
.radial-ellipse-far {
background: radial-gradient(
ellipse farthest-corner at 90% 90%,
red,
yellow 10%,
#1e90ff 50%,
beige
);
}
```
#### Example: closest-side for circles
This example uses `closest-side`, which makes the circle's radius to be the distance between the center of the gradient and the closest side. In this case the radius is the distance between the center and the bottom edge, because the gradient is placed 25% from the left and 25% from the bottom, and the div element's height is smaller than the width.
```
.radial-circle-close {
background: radial-gradient(
circle closest-side at 25% 75%,
red,
yellow 10%,
#1e90ff 50%,
beige
);
}
```
#### Example: length or percentage for ellipses
For ellipses only, you can size the ellipse using a length or percentage. The first value represents the horizontal radius, the second the vertical radius, where you use a percentage this corresponds to the size of the box in that dimension. In the below example I have used a percentage for the horizontal radius.
```
.radial-ellipse-size {
background: radial-gradient(
ellipse 50% 50px,
red,
yellow 10%,
#1e90ff 50%,
beige
);
}
```
#### Example: length for circles
For circles the size may be given as a [<length>](../length), which is the size of the circle.
```
.radial-circle-size {
background: radial-gradient(circle 50px, red, yellow 10%, #1e90ff 50%, beige);
}
```
### Stacked radial gradients
Just like linear gradients, you can also stack radial gradients. The first specified is on top, the last on the bottom.
```
.stacked-radial {
background: radial-gradient(
circle at 50% 0,
rgba(255, 0, 0, 0.5),
rgba(255, 0, 0, 0) 70.71%
), radial-gradient(
circle at 6.7% 75%,
rgba(0, 0, 255, 0.5),
rgba(0, 0, 255, 0) 70.71%
),
radial-gradient(
circle at 93.3% 75%,
rgba(0, 255, 0, 0.5),
rgba(0, 255, 0, 0) 70.71%
) beige;
border-radius: 50%;
}
```
Using conic gradients
---------------------
The `conic-gradient()` [CSS](https://developer.mozilla.org/en-US/docs/Web/CSS) function creates an image consisting of a gradient with color transitions rotated around a center point (rather than radiating from the center). Example conic gradients include pie charts and [color wheels](https://developer.mozilla.org/en-US/docs/Glossary/Color_wheel), but they can also be used for creating checker boards and other interesting effects.
The conic-gradient syntax is similar to the radial-gradient syntax, but the color-stops are placed around a gradient arc, the circumference of a circle, rather than on the gradient line emerging from the center of the gradient, and the color-stops are percentages or degrees: absolute lengths are not valid.
In a radial gradient, the colors transition from the center of an ellipse, outward, in all directions. With conic gradients, the colors transition as if spun around the center of a circle, starting at the top and going clockwise. Similar to radial gradients, you can position the center of the gradient. Similar to linear gradients, you can change the gradient angle.
### A basic conic gradient
As with linear and radial gradients, all you need to create a conic gradient are two colors. By default, the center of the gradient is at the 50% 50% mark, with the start of the gradient facing up:
```
.simple-conic {
background: conic-gradient(red, blue);
}
```
### Positioning the conic center
Like radial gradients, you can position the center of the conic gradient with keyterms, percentage, or absolute lengths, with the keyword "at"
```
.conic-gradient {
background: conic-gradient(at 0% 30%, red 10%, yellow 30%, #1e90ff 50%);
}
```
### Changing the angle
By default, the different color stops you specify are spaced equidistantly around the circle. You can position the starting angle of the conic gradient using the "from" keyword at the beginning followed by an angle or a length, and you can specify different positions for the colors stops by including an angle or length after them.
```
.conic-gradient {
background: conic-gradient(from 45deg, red, orange 50%, yellow 85%, green);
}
```
Using repeating gradients
-------------------------
The [`linear-gradient()`](../gradient/linear-gradient), [`radial-gradient()`](../gradient/radial-gradient), and [`conic-gradient()`](../gradient/conic-gradient) functions don't support automatically repeated color stops. However, the [`repeating-linear-gradient()`](../gradient/repeating-linear-gradient), [`repeating-radial-gradient()`](../gradient/repeating-radial-gradient), and [`repeating-conic-gradient()`](../gradient/repeating-conic-gradient) functions are available to offer this functionality.
The size of the gradient line or arc that repeats is the length between the first color stop value and the last color stop length value. If the first color stop just has a color and no color stop length, the value defaults to 0. If the last color stop has just a color and no color stop length, the value defaults to 100%. If neither is declared, the gradient line is 100% meaning the linear and conic gradients will not repeat and the radial gradient will only repeat if the radius of the gradient is smaller than the length between the center of the gradient and the farthest corner. If the first color stop is declared, and the value is greater than 0, the gradient will repeat, as the size of the line or arc is the difference between the first color stop and last color stop is less than 100% or 360 degrees.
### Repeating linear gradients
This example uses [`repeating-linear-gradient()`](../gradient/repeating-linear-gradient) to create a gradient that progresses repeatedly in a straight line. The colors get cycled over again as the gradient repeats. In this case the gradient line is 10px long.
```
.repeating-linear {
background: repeating-linear-gradient(
-45deg,
red,
red 5px,
blue 5px,
blue 10px
);
}
```
### Multiple repeating linear gradients
Similar to regular linear and radial gradients, you can include multiple gradients, one on top of the other. This only makes sense if the gradients are partially transparent allowing subsequent gradients to show through the transparent areas, or if you include different [background-sizes](../background-size), optionally with different [background-position](../background-position) property values, for each gradient image. We are using transparency.
In this case the gradient lines are 300px, 230px, and 300px long.
```
.multi-repeating-linear {
background: repeating-linear-gradient(
190deg,
rgba(255, 0, 0, 0.5) 40px,
rgba(255, 153, 0, 0.5) 80px,
rgba(255, 255, 0, 0.5) 120px,
rgba(0, 255, 0, 0.5) 160px,
rgba(0, 0, 255, 0.5) 200px,
rgba(75, 0, 130, 0.5) 240px,
rgba(238, 130, 238, 0.5) 280px,
rgba(255, 0, 0, 0.5) 300px
), repeating-linear-gradient(
-190deg,
rgba(255, 0, 0, 0.5) 30px,
rgba(255, 153, 0, 0.5) 60px,
rgba(255, 255, 0, 0.5) 90px,
rgba(0, 255, 0, 0.5) 120px,
rgba(0, 0, 255, 0.5) 150px,
rgba(75, 0, 130, 0.5) 180px,
rgba(238, 130, 238, 0.5) 210px,
rgba(255, 0, 0, 0.5) 230px
), repeating-linear-gradient(23deg, red 50px, orange 100px, yellow 150px, green
200px, blue 250px, indigo 300px, violet 350px, red 370px);
}
```
### Plaid gradient
To create plaid we include several overlapping gradients with transparency. In the first background declaration we listed every color stop separately. The second background property declaration using the multiple position color stop syntax:
```
.plaid-gradient {
background: repeating-linear-gradient(
90deg,
transparent,
transparent 50px,
rgba(255, 127, 0, 0.25) 50px,
rgba(255, 127, 0, 0.25) 56px,
transparent 56px,
transparent 63px,
rgba(255, 127, 0, 0.25) 63px,
rgba(255, 127, 0, 0.25) 69px,
transparent 69px,
transparent 116px,
rgba(255, 206, 0, 0.25) 116px,
rgba(255, 206, 0, 0.25) 166px
), repeating-linear-gradient(
0deg,
transparent,
transparent 50px,
rgba(255, 127, 0, 0.25) 50px,
rgba(255, 127, 0, 0.25) 56px,
transparent 56px,
transparent 63px,
rgba(255, 127, 0, 0.25) 63px,
rgba(255, 127, 0, 0.25) 69px,
transparent 69px,
transparent 116px,
rgba(255, 206, 0, 0.25) 116px,
rgba(255, 206, 0, 0.25) 166px
), repeating-linear-gradient(
-45deg,
transparent,
transparent 5px,
rgba(143, 77, 63, 0.25) 5px,
rgba(143, 77, 63, 0.25) 10px
), repeating-linear-gradient(45deg, transparent, transparent 5px, rgba(
143,
77,
63,
0.25
) 5px, rgba(143, 77, 63, 0.25) 10px);
background: repeating-linear-gradient(
90deg,
transparent 0 50px,
rgba(255, 127, 0, 0.25) 50px 56px,
transparent 56px 63px,
rgba(255, 127, 0, 0.25) 63px 69px,
transparent 69px 116px,
rgba(255, 206, 0, 0.25) 116px 166px
), repeating-linear-gradient(
0deg,
transparent 0 50px,
rgba(255, 127, 0, 0.25) 50px 56px,
transparent 56px 63px,
rgba(255, 127, 0, 0.25) 63px 69px,
transparent 69px 116px,
rgba(255, 206, 0, 0.25) 116px 166px
), repeating-linear-gradient(
-45deg,
transparent 0 5px,
rgba(143, 77, 63, 0.25) 5px 10px
), repeating-linear-gradient(45deg, transparent 0 5px, rgba(
143,
77,
63,
0.25
) 5px 10px);
}
```
### Repeating radial gradients
This example uses [`repeating-radial-gradient()`](../gradient/repeating-radial-gradient) to create a gradient that radiates repeatedly from a central point. The colors get cycled over and over as the gradient repeats.
```
.repeating-radial {
background: repeating-radial-gradient(
black,
black 5px,
white 5px,
white 10px
);
}
```
### Multiple repeating radial gradients
```
.multi-target {
background: repeating-radial-gradient(
ellipse at 80% 50%,
rgba(0, 0, 0, 0.5),
rgba(0, 0, 0, 0.5) 15px,
rgba(255, 255, 255, 0.5) 15px,
rgba(255, 255, 255, 0.5) 30px
) top left no-repeat, repeating-radial-gradient(
ellipse at 20% 50%,
rgba(0, 0, 0, 0.5),
rgba(0, 0, 0, 0.5) 10px,
rgba(255, 255, 255, 0.5) 10px,
rgba(255, 255, 255, 0.5) 20px
) top left no-repeat yellow;
background-size: 200px 200px, 150px 150px;
}
```
See also
--------
* Gradient functions: [`linear-gradient()`](../gradient/linear-gradient), [`radial-gradient()`](../gradient/radial-gradient), [`conic-gradient()`](../gradient/conic-gradient), [`repeating-linear-gradient()`](../gradient/repeating-linear-gradient), [`repeating-radial-gradient()`](../gradient/repeating-radial-gradient), [`repeating-conic-gradient()`](../gradient/repeating-conic-gradient)
* Gradient-related CSS data types: [`<gradient>`](../gradient), [`<image>`](../image)
* Gradient-related CSS properties: [`background`](../background), [`background-image`](../background-image)
* [CSS Gradients Patterns Gallery, by Lea Verou](https://projects.verou.me/css3patterns/)
* [CSS Gradients Library, by Estelle Weyl](http://standardista.com/cssgradients/)
* [Gradient CSS Generator](https://cssgenerator.org/gradient-css-generator.html)
| programming_docs |
css hue-rotate() hue-rotate()
============
The `hue-rotate()` [CSS](https://developer.mozilla.org/en-US/docs/Web/CSS) [function](../css_functions) rotates the [hue](https://en.wikipedia.org/wiki/Hue) of an element and its contents. Its result is a [`<filter-function>`](../filter-function).
Try it
------
Syntax
------
```
hue-rotate(angle)
```
### Parameters
`angle` The relative change in hue of the input sample, specified as an [`<angle>`](../angle). A value of `0deg` leaves the input unchanged. A positive hue rotation increases the hue value, while a negative rotation decreases the hue value. The initial value for [interpolation](https://developer.mozilla.org/en-US/docs/Glossary/Interpolation) is `0`. There is no minimum or maximum value; `hue-rotate(Ndeg)` evaluates to `N` modulo 360.
Examples
--------
### Examples of correct values for hue-rotate
```
hue-rotate(-90deg) /\* Same as 270deg rotation \*/
hue-rotate(0deg) /\* No effect \*/
hue-rotate(90deg) /\* 90deg rotation \*/
hue-rotate(.5turn) /\* 180deg rotation \*/
hue-rotate(405deg) /\* Same as 45deg rotation \*/
```
Specifications
--------------
| Specification |
| --- |
| [Filter Effects Module Level 1 # funcdef-filter-hue-rotate](https://drafts.fxtf.org/filter-effects/#funcdef-filter-hue-rotate) |
Browser compatibility
---------------------
| | Desktop | Mobile |
| --- | --- | --- |
| | Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet |
| `hue-rotate` | 18 | 12 | 35 | No | 15 | 6 | 4.4 | 53 | 35 | 14 | 6 | 6.0 |
See also
--------
* [`<filter-function>`](../filter-function)
* [`blur()`](blur)
* [`brightness()`](brightness)
* [`contrast()`](contrast)
* [`drop-shadow()`](drop-shadow)
* [`grayscale()`](grayscale)
* [`invert()`](invert)
* [`opacity()`](opacity)
* [`saturate()`](saturate)
* [`sepia()`](sepia)
css brightness() brightness()
============
The `brightness()` [CSS](https://developer.mozilla.org/en-US/docs/Web/CSS) [function](../css_functions) applies a linear multiplier to the input image, making it appear brighter or darker. Its result is a [`<filter-function>`](../filter-function).
Try it
------
Syntax
------
```
brightness(amount)
```
### Parameters
`amount` The brightness of the result, specified as a [`<number>`](../number) or a [`<percentage>`](../percentage). A value under `100%` darkens the image, while a value over `100%` brightens it. A value of `0%` will create an image that is completely black, while a value of `100%` leaves the input unchanged. The initial value for [interpolation](https://developer.mozilla.org/en-US/docs/Glossary/Interpolation) is `1`.
Examples
--------
### Setting brightness using numbers and percentages
```
brightness(0%) /\* Completely black \*/
brightness(0.4) /\* 40% brightness \*/
brightness(1) /\* No effect \*/
brightness(200%) /\* Double brightness \*/
```
Specifications
--------------
| Specification |
| --- |
| [Filter Effects Module Level 1 # funcdef-filter-brightness](https://drafts.fxtf.org/filter-effects/#funcdef-filter-brightness) |
Browser compatibility
---------------------
| | Desktop | Mobile |
| --- | --- | --- |
| | Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet |
| `brightness` | 18 | 12 | 35 | No | 15 | 6 | 4.4 | 53 | 35 | 14 | 6 | 6.0 |
See also
--------
* [`<filter-function>`](../filter-function)
* [`blur()`](blur)
* [`contrast()`](contrast)
* [`drop-shadow()`](drop-shadow)
* [`grayscale()`](grayscale)
* [`hue-rotate()`](hue-rotate)
* [`invert()`](invert)
* [`opacity()`](opacity)
* [`saturate()`](saturate)
* [`sepia()`](sepia)
css blur() blur()
======
The `blur()` [CSS](https://developer.mozilla.org/en-US/docs/Web/CSS) [function](../css_functions) applies a [Gaussian blur](https://en.wikipedia.org/wiki/Gaussian_blur) to the input image. Its result is a [`<filter-function>`](../filter-function).
Try it
------
Syntax
------
```
blur(radius)
```
### Parameters
`radius` The radius of the blur, specified as a [`<length>`](../length). It defines the value of the standard deviation to the Gaussian function, i.e., how many pixels on the screen blend into each other; thus, a larger value will create more blur. A value of `0` leaves the input unchanged. The initial value for [interpolation](https://developer.mozilla.org/en-US/docs/Glossary/Interpolation) is `0`.
Examples
--------
### Setting a blur with pixels and with rem
```
blur(0) /\* No effect \*/
blur(8px) /\* Blur with 8px radius \*/
blur(1.17rem) /\* Blur with 1.17rem radius \*/
```
Specifications
--------------
| Specification |
| --- |
| [Filter Effects Module Level 1 # funcdef-filter-blur](https://drafts.fxtf.org/filter-effects/#funcdef-filter-blur) |
Browser compatibility
---------------------
| | Desktop | Mobile |
| --- | --- | --- |
| | Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet |
| `blur` | 18 | 12 | 35 | No | 15 | 6 | 4.4 | 53 | 35 | 14 | 6 | 6.0 |
See also
--------
* [`<filter-function>`](../filter-function)
* [`brightness()`](brightness)
* [`contrast()`](contrast)
* [`drop-shadow()`](drop-shadow)
* [`grayscale()`](grayscale)
* [`hue-rotate()`](hue-rotate)
* [`invert()`](invert)
* [`opacity()`](opacity)
* [`saturate()`](saturate)
* [`sepia()`](sepia)
css sepia() sepia()
=======
The `sepia()` [CSS](https://developer.mozilla.org/en-US/docs/Web/CSS) [function](../css_functions) converts the input image to sepia, giving it a warmer, more yellow/brown appearance. Its result is a [`<filter-function>`](../filter-function).
Try it
------
Syntax
------
```
sepia(amount)
```
### Parameters
`amount` The amount of the conversion, specified as a [`<number>`](../number) or a [`<percentage>`](../percentage). A value of `100%` is completely sepia, while a value of `0%` leaves the input unchanged. Values between `0%` and `100%` are linear multipliers on the effect. The initial value for [interpolation](https://developer.mozilla.org/en-US/docs/Glossary/Interpolation) is `0`.
Examples
--------
### Examples of correct values for sepia()
```
sepia(0) /\* No effect \*/
sepia(.65) /\* 65% sepia \*/
sepia(100%) /\* Completely sepia \*/
```
Specifications
--------------
| Specification |
| --- |
| [Filter Effects Module Level 1 # funcdef-filter-sepia](https://drafts.fxtf.org/filter-effects/#funcdef-filter-sepia) |
Browser compatibility
---------------------
| | Desktop | Mobile |
| --- | --- | --- |
| | Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet |
| `sepia` | 18 | 12 | 35 | No | 15 | 6 | 4.4 | 53 | 35 | 14 | 6 | 6.0 |
See also
--------
* [`<filter-function>`](../filter-function)
* [`blur()`](blur)
* [`brightness()`](brightness)
* [`contrast()`](contrast)
* [`drop-shadow()`](drop-shadow)
* [`grayscale()`](grayscale)
* [`hue-rotate()`](hue-rotate)
* [`invert()`](invert)
* [`opacity()`](opacity)
* [`saturate()`](saturate)
css saturate() saturate()
==========
The `saturate()` [CSS](https://developer.mozilla.org/en-US/docs/Web/CSS) [function](../css_functions) super-saturates or desaturates the input image. Its result is a [`<filter-function>`](../filter-function).
Try it
------
Syntax
------
```
saturate(amount)
```
### Parameters
`amount` The amount of the conversion, specified as a [`<number>`](../number) or a [`<percentage>`](../percentage). A value under `100%` desaturates the image, while a value over `100%` super-saturates it. A value of `0%` is completely unsaturated, while a value of `100%` leaves the input unchanged. The initial value for [interpolation](https://developer.mozilla.org/en-US/docs/Glossary/Interpolation) is `1`.
Examples
--------
### Examples of correct values for saturate()
```
saturate(0) /\* Completely unsaturated \*/
saturate(.4) /\* 40% saturated \*/
saturate(100%) /\* No effect \*/
saturate(200%) /\* Double saturation \*/
```
Specifications
--------------
| Specification |
| --- |
| [Filter Effects Module Level 1 # funcdef-filter-saturate](https://drafts.fxtf.org/filter-effects/#funcdef-filter-saturate) |
Browser compatibility
---------------------
| | Desktop | Mobile |
| --- | --- | --- |
| | Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet |
| `saturate` | 18 | 12 | 35 | No | 15 | 6 | 4.4 | 53 | 35 | 14 | 6 | 6.0 |
See also
--------
* [`<filter-function>`](../filter-function)
* [`blur()`](blur)
* [`brightness()`](brightness)
* [`contrast()`](contrast)
* [`drop-shadow()`](drop-shadow)
* [`grayscale()`](grayscale)
* [`hue-rotate()`](hue-rotate)
* [`invert()`](invert)
* [`opacity()`](opacity)
* [`sepia()`](sepia)
css contrast() contrast()
==========
The `contrast()` [CSS](https://developer.mozilla.org/en-US/docs/Web/CSS) [function](../css_functions) adjusts the contrast of the input image. Its result is a [`<filter-function>`](../filter-function).
Try it
------
Syntax
------
```
contrast(amount)
```
### Parameters
`amount` The contrast of the result, specified as a [`<number>`](../number) or a [`<percentage>`](../percentage). A value under `100%` decreases the contrast, while a value over `100%` increases it. A value of `0%` will create an image that is completely gray, while a value of `100%` leaves the input unchanged. The initial value for [interpolation](https://developer.mozilla.org/en-US/docs/Glossary/Interpolation) is `1`.
Examples
--------
### Setting contrast using numbers and percentages
```
contrast(0) /\* Completely gray \*/
contrast(65%) /\* 65% contrast \*/
contrast(1) /\* No effect \*/
contrast(200%) /\* Double contrast \*/
```
Specifications
--------------
| Specification |
| --- |
| [Filter Effects Module Level 1 # funcdef-filter-contrast](https://drafts.fxtf.org/filter-effects/#funcdef-filter-contrast) |
Browser compatibility
---------------------
| | Desktop | Mobile |
| --- | --- | --- |
| | Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet |
| `contrast` | 18 | 12 | 35 | No | 15 | 6 | 4.4 | 53 | 35 | 14 | 6 | 6.0 |
See also
--------
* [`<filter-function>`](../filter-function)
* [`blur()`](blur)
* [`brightness()`](brightness)
* [`drop-shadow()`](drop-shadow)
* [`grayscale()`](grayscale)
* [`hue-rotate()`](hue-rotate)
* [`invert()`](invert)
* [`opacity()`](opacity)
* [`saturate()`](saturate)
* [`sepia()`](sepia)
css drop-shadow() drop-shadow()
=============
The `drop-shadow()` [CSS](https://developer.mozilla.org/en-US/docs/Web/CSS) [function](../css_functions) applies a drop shadow effect to the input image. Its result is a [`<filter-function>`](../filter-function).
Try it
------
A drop shadow is effectively a blurred, offset version of the input image's alpha mask, drawn in a specific color and composited below the image.
**Note:** This function is somewhat similar to the [`box-shadow`](../box-shadow) property. The `box-shadow` property creates a rectangular shadow behind an element's *entire box*, while the `drop-shadow()` filter function creates a shadow that conforms to the shape (alpha channel) of the *image itself*.
Syntax
------
```
drop-shadow(offset-x offset-y blur-radius color)
```
The `drop-shadow()` function accepts a parameter of type `<shadow>` (defined in the [`box-shadow`](../box-shadow) property), with the exception that the `inset` keyword and `spread` parameters are not allowed.
### Parameters
`offset-x` (required) The horizontal offset for the shadow, specified as a [`<length>`](../length) value. Negative values place the shadow to the left of the element.
`offset-y` (required) The vertical offset for the shadow, specified as a [`<length>`](../length) value. Negative values place the shadow above the element.
`blur-radius` (optional) The shadow's blur radius, specified as a [`<length>`](../length). The larger the value, the larger and more blurred the shadow becomes. If unspecified, it defaults to `0`, resulting in a sharp, unblurred edge. Negative values are not allowed.
`color` (optional) The color of the shadow, specified as a [`<color>`](../color_value). If unspecified, the value of the [`color`](../color) property is used.
Examples
--------
### Setting a drop shadow using pixel offsets and blur radius
```
/\* Black shadow with 10px blur \*/
drop-shadow(16px 16px 10px black)
```
### Setting a drop shadow using rem offsets and blur radius
```
/\* Reddish shadow with 1rem blur \*/
drop-shadow(.5rem .5rem 1rem #e23)
```
Specifications
--------------
| Specification |
| --- |
| [Filter Effects Module Level 1 # funcdef-filter-drop-shadow](https://drafts.fxtf.org/filter-effects/#funcdef-filter-drop-shadow) |
Browser compatibility
---------------------
| | Desktop | Mobile |
| --- | --- | --- |
| | Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet |
| `drop-shadow` | 18 | 12 | 35 | No | 15 | 6 | 4.4 | 53 | 35 | 14 | 6 | 6.0 |
See also
--------
* [`<filter-function>`](../filter-function)
* [`blur()`](blur)
* [`brightness()`](brightness)
* [`contrast()`](contrast)
* [`grayscale()`](grayscale)
* [`hue-rotate()`](hue-rotate)
* [`invert()`](invert)
* [`opacity()`](opacity)
* [`saturate()`](saturate)
* [`sepia()`](sepia)
* [`box-shadow`](../box-shadow) property
* [`text-shadow`](../text-shadow) property
css grayscale() grayscale()
===========
The `grayscale()` [CSS](https://developer.mozilla.org/en-US/docs/Web/CSS) [function](../css_functions) converts the input image to grayscale. Its result is a [`<filter-function>`](../filter-function).
Try it
------
Syntax
------
```
grayscale(amount)
```
### Parameters
`amount` The amount of the conversion, specified as a [`<number>`](../number) or a [`<percentage>`](../percentage). A value of `100%` is completely grayscale, while a value of `0%` leaves the input unchanged. Values between `0%` and `100%` are linear multipliers on the effect. Default value when omitted is `1`. The initial value for [interpolation](https://developer.mozilla.org/en-US/docs/Glossary/Interpolation) is `0`.
Examples
--------
### Examples of correct values for grayscale()
```
grayscale(0) /\* No effect \*/
grayscale(.7) /\* 70% grayscale \*/
grayscale(100%) /\* Completely grayscale \*/
```
Specifications
--------------
| Specification |
| --- |
| [Filter Effects Module Level 1 # funcdef-filter-grayscale](https://drafts.fxtf.org/filter-effects/#funcdef-filter-grayscale) |
Browser compatibility
---------------------
| | Desktop | Mobile |
| --- | --- | --- |
| | Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet |
| `grayscale` | 18 | 12 | 35 | No | 15 | 6 | 4.4 | 53 | 35 | 14 | 6 | 6.0 |
See also
--------
* [`<filter-function>`](../filter-function)
* [`blur()`](blur)
* [`brightness()`](brightness)
* [`contrast()`](contrast)
* [`drop-shadow()`](drop-shadow)
* [`hue-rotate()`](hue-rotate)
* [`invert()`](invert)
* [`opacity()`](opacity)
* [`saturate()`](saturate)
* [`sepia()`](sepia)
css opacity() opacity()
=========
The `opacity()` [CSS](https://developer.mozilla.org/en-US/docs/Web/CSS) [function](../css_functions) applies transparency to the samples in the input image. Its result is a [`<filter-function>`](../filter-function).
Try it
------
**Note:** This function is similar to the more established [`opacity`](../opacity) property. The difference is that with filters, some browsers provide hardware acceleration for better performance.
Syntax
------
```
opacity(amount)
```
### Parameters
`amount` The amount of the conversion, specified as a [`<number>`](../number) or a [`<percentage>`](../percentage). A value of `0%` is completely transparent, while a value of `100%` leaves the input unchanged. Values between `0%` and `100%` are linear multipliers on the effect. The initial value for [interpolation](https://developer.mozilla.org/en-US/docs/Glossary/Interpolation) is `1`.
Examples
--------
### Examples of correct values for opacity()
```
opacity(0%) /\* Completely transparent \*/
opacity(50%) /\* 50% transparent \*/
opacity(1) /\* No effect \*/
```
Specifications
--------------
| Specification |
| --- |
| [Filter Effects Module Level 1 # funcdef-filter-opacity](https://drafts.fxtf.org/filter-effects/#funcdef-filter-opacity) |
Browser compatibility
---------------------
| | Desktop | Mobile |
| --- | --- | --- |
| | Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet |
| `opacity` | 18 | 12 | 35 | No | 15 | 6 | 4.4 | 53 | 35 | 14 | 6 | 6.0 |
See also
--------
* [`<filter-function>`](../filter-function)
* CSS [`opacity`](../opacity) property
* [`blur()`](blur)
* [`brightness()`](brightness)
* [`contrast()`](contrast)
* [`drop-shadow()`](drop-shadow)
* [`grayscale()`](grayscale)
* [`hue-rotate()`](hue-rotate)
* [`invert()`](invert)
* [`saturate()`](saturate)
* [`sepia()`](sepia)
css invert() invert()
========
The `invert()` [CSS](https://developer.mozilla.org/en-US/docs/Web/CSS) [function](../css_functions) inverts the color samples in the input image. Its result is a [`<filter-function>`](../filter-function).
Try it
------
Syntax
------
```
invert(amount)
```
### Parameters
`amount` The amount of the conversion, specified as a [`<number>`](../number) or a [`<percentage>`](../percentage). A value of `100%` is completely inverted, while a value of `0%` leaves the input unchanged. Values between `0%` and `100%` are linear multipliers on the effect. The initial value for [interpolation](https://developer.mozilla.org/en-US/docs/Glossary/Interpolation) is `0`.
Examples
--------
### Examples of correct values for invert()
```
invert(0) /\* No effect \*/
invert(.6) /\* 60% inversion \*/
invert(100%) /\* Completely inverted \*/
```
Specifications
--------------
| Specification |
| --- |
| [Filter Effects Module Level 1 # funcdef-filter-invert](https://drafts.fxtf.org/filter-effects/#funcdef-filter-invert) |
Browser compatibility
---------------------
| | Desktop | Mobile |
| --- | --- | --- |
| | Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet |
| `invert` | 18 | 12 | 35 | No | 15 | 6 | 4.4 | 53 | 35 | 14 | 6 | 6.0 |
See also
--------
* [`<filter-function>`](../filter-function)
* [`blur()`](blur)
* [`brightness()`](brightness)
* [`contrast()`](contrast)
* [`drop-shadow()`](drop-shadow)
* [`grayscale()`](grayscale)
* [`hue-rotate()`](hue-rotate)
* [`opacity()`](opacity)
* [`saturate()`](saturate)
* [`sepia()`](sepia)
css Border-radius generator Border-radius generator
=======================
This tool can be used to generate CSS [`border-radius`](../border-radius) effects.
css Border-image generator Border-image generator
======================
This tool can be used to generate CSS [`border-image`](../border-image) values.
css Box-shadow generator Box-shadow generator
====================
This tool lets you construct CSS [`box-shadow`](../box-shadow) effects, to add box shadow effects to your CSS objects.
The box-shadow generator enables you to add one or more box shadows to an element.
On opening the tool, you'll find a rectangle in the top-right section of the tool. That's the element you're going to be applying shadows to. When this element is selected (as it is, when you first load the page) you can apply some basic styling to it:
* Set the element's [`color`](../color) using the color picker tool.
* Give the element a [`border`](../border) using the "border" checkbox.
* Use the sliders to set the element's [`top`](../top), [`left`](../left), [`width`](../width), and [`height`](../height) properties.
To add a box shadow, click the "+" button at the top-left. This adds a shadow, and lists it in the column on the left. Now you can set the values of the new shadow:
* Set the shadow's [`color`](../color) using the color picker tool.
* Set the shadow to be inset using the "inset" checkbox.
* Use the sliders to set the element's position, blur, and spread.
To add another shadow, click "+" again. Now any values you set will apply to this new shadow. Change the order in which these two shadows are applied using the ↑ and ↓ buttons at the top-left. Select the first shadow again by clicking it in column on the left. To update the element's own styles, select it by clicking the button labelled "element" along the top.
You can add [`::before`](../::before) and [`::after`](../::after) pseudo-elements to the element, and give them box shadows as well. To switch between the element and its pseudo-elements, use the buttons along the top labeled "element", ":before", and ":after".
The box at the bottom-right contains the CSS for the element and any `before::` or `::after` pseudo-elements.
| programming_docs |
css Using multiple backgrounds Using multiple backgrounds
==========================
You can apply **multiple backgrounds** to elements. These are layered atop one another with the first background you provide on top and the last background listed in the back. Only the last background can include a background color.
Specifying multiple backgrounds is easy:
```
.myclass {
background: background1, background2, /\* … ,\*/ backgroundN;
}
```
You can do this with both the shorthand [`background`](../background) property and the individual properties thereof except for [`background-color`](../background-color). That is, the following background properties can be specified as a list, one per background: [`background`](../background), [`background-attachment`](../background-attachment), [`background-clip`](../background-clip), [`background-image`](../background-image), [`background-origin`](../background-origin), [`background-position`](../background-position), [`background-repeat`](../background-repeat), [`background-size`](../background-size).
Example
-------
In this example, three backgrounds are stacked: the Firefox logo, an image of bubbles, and a [linear gradient](../gradient/linear-gradient):
### HTML
```
<div class="multi-bg-example"></div>
```
### CSS
```
.multi-bg-example {
width: 100%;
height: 400px;
background-image: url(firefox.png), url(bubbles.png), linear-gradient(to right, rgba(30, 75, 115, 1), rgba(255, 255, 255, 0));
background-repeat: no-repeat, no-repeat, no-repeat;
background-position: bottom right, left, right;
}
```
### Result
(If image does not appear in CodePen, click the 'Tidy' button in the CSS section)
As you can see here, the Firefox logo (listed first within [`background-image`](../background-image)) is on top, directly above the bubbles graphic, followed by the gradient (listed last) sitting underneath all previous 'images'. Each subsequent sub-property ([`background-repeat`](../background-repeat) and [`background-position`](../background-position)) applies to the corresponding backgrounds. So the first listed value for [`background-repeat`](../background-repeat) applies to the first (frontmost) background, and so forth.
See also
--------
* [Using CSS gradients](../css_images/using_css_gradients)
css Resizing background images with background-size Resizing background images with background-size
===============================================
The **[`background-size`](../background-size)** CSS property lets you resize the background image of an element, overriding the default behavior of tiling the image at its full size by specifying the width and/or height of the image. By doing so, you can scale the image upward or downward as desired.
Tiling a large image
--------------------
Let's consider a large image, a 2982x2808 Firefox logo image. We want (for some reason likely involving horrifyingly bad site design) to tile four copies of this image into a 300x300-pixel element. To do this, we can use a fixed `background-size` value of 150 pixels.
### HTML
```
<div class="tiledBackground"></div>
```
### CSS
```
.tiledBackground {
background-image: url(https://www.mozilla.org/media/img/logos/firefox/logo-quantum.9c5e96634f92.png);
background-size: 150px;
width: 300px;
height: 300px;
border: 2px solid;
color: pink;
}
```
### Result
Stretching an image
-------------------
You can also specify both the horizontal and vertical sizes of the image, like this:
```
background-size: 300px 150px;
```
The result looks like this:
Scaling an image up
-------------------
On the other end of the spectrum, you can scale an image up in the background. Here we scale a 32x32 pixel favicon to 300x300 pixels:
```
.square2 {
background-image: url(favicon.png);
background-size: 300px;
width: 300px;
height: 300px;
border: 2px solid;
text-shadow: white 0px 0px 2px;
font-size: 16px;
}
```
As you can see, the CSS is actually essentially identical, save the name of the image file.
Special values: "contain" and "cover"
-------------------------------------
Besides [`<length>`](../length) values, the [`background-size`](../background-size) CSS property offers two special size values, `contain` and `cover`. Let's take a look at these.
### contain
The `contain` value specifies that, regardless of the size of the containing box, the background image should be scaled so that each side is as large as possible while not exceeding the length of the corresponding side of the container. Try resizing the example below to see this in action.
#### HTML
```
<div class="bgSizeContain">
<p>Try resizing this element!</p>
</div>
```
#### CSS
```
.bgSizeContain {
background-image: url(https://www.mozilla.org/media/img/logos/firefox/logo-quantum.9c5e96634f92.png);
background-size: contain;
width: 160px;
height: 160px;
border: 2px solid;
color: pink;
resize: both;
overflow: scroll;
}
```
#### Result
### cover
The `cover` value specifies that the background image should be sized so that it is as small as possible while ensuring that both dimensions are greater than or equal to the corresponding size of the container. Try resizing the example below to see this in action.
#### HTML
```
<div class="bgSizeCover">
<p>Try resizing this element!</p>
</div>
```
#### CSS
```
.bgSizeCover {
background-image: url(https://www.mozilla.org/media/img/logos/firefox/logo-quantum.9c5e96634f92.png);
background-size: cover;
width: 160px;
height: 160px;
border: 2px solid;
color: pink;
resize: both;
overflow: scroll;
}
```
#### Result
See also
--------
* [`background-size`](../background-size)
* [`background`](../background)
* [Scaling of SVG backgrounds](../scaling_of_svg_backgrounds)
css syntax syntax
======
**Experimental:** **This is an [experimental technology](https://developer.mozilla.org/en-US/docs/MDN/Writing_guidelines/Experimental_deprecated_obsolete#experimental)**
Check the [Browser compatibility table](#browser_compatibility) carefully before using this in production.
The `syntax` [CSS](https://developer.mozilla.org/en-US/docs/Web/CSS) descriptor is required when using the [`@property`](../@property) [at-rule](../at-rule) and describes the allowable syntax for the property.
Syntax
------
The following are all valid syntax strings:
```
syntax: "<color>"; /\* accepts a color \*/
syntax: "<length> | <percentage>"; /\* accepts lengths or percentages but not calc expressions with a combination of the two \*/
syntax: "small | medium | large"; /\* accepts one of these values set as custom idents. \*/
syntax: "\*"; /\* any valid token \*/
```
Values
------
A string with a supported syntax as defined by the specification. Supported syntaxes are a subset of [CSS types](../css_types). These may be used along, or a number of types can be used in combination.
`"<length>"` Any valid [`<length>`](../length) values.
`"<number>"` Any valid [`<number>`](../number) values.
`"<percentage>"` Any valid [`<percentage>`](../percentage) values.
`"<length-percentage>"` Any valid [`<length-percentage>`](../length-percentage) values.
`"<color>"` Any valid [`<color>`](../color_value) values.
`"<image>"` Any valid [`<image>`](../image) values.
`"<url>"` Any valid [`url()`](../url) values.
`"<integer>"` Any valid [`<integer>`](../integer) values.
`"<angle>"` Any valid [`<angle>`](../angle) values.
`"<time>"` Any valid [`<time>`](../time) values.
`"<resolution>"` Any valid [`<resolution>`](../resolution) values.
`"<transform-function>"` Any valid [`<transform-function>`](../transform-function) values.
`"<custom-ident>"` Any valid [`<custom-ident>`](../custom-ident) values.
`"<transform-list>"` A list of valid [`<transform-function>`](../transform-function) values.
Formal definition
-----------------
| | |
| --- | --- |
| Related [at-rule](../at-rule) | [`@property`](../@property) |
| [Initial value](../initial_value) | `n/a (required)` |
| [Computed value](../computed_value) | as specified |
Formal syntax
-------------
```
syntax =
[<string>](../string)
```
Examples
--------
Add type checking to `--my-color` [`custom property`](../--*), using the `<color>` syntax:
Using [CSS](https://developer.mozilla.org/en-US/docs/Web/CSS) [`@property`](../@property) [at-rule](../at-rule):
```
@property --my-color {
syntax: "<color>";
inherits: false;
initial-value: #c0ffee;
}
```
Using [JavaScript](https://developer.mozilla.org/en-US/docs/Web/JavaScript) [`CSS.registerProperty`](https://developer.mozilla.org/en-US/docs/Web/API/CSS/RegisterProperty):
```
window.CSS.registerProperty({
name: "--my-color",
syntax: "<color>",
inherits: false,
initialValue: "#c0ffee",
});
```
Specifications
--------------
| Specification |
| --- |
| [CSS Properties and Values API Level 1 # the-syntax-descriptor](https://drafts.css-houdini.org/css-properties-values-api/#the-syntax-descriptor) |
Browser compatibility
---------------------
| | Desktop | Mobile |
| --- | --- | --- |
| | Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet |
| `syntax` | 85 | 85 | No | No | 71 | No | 85 | 85 | No | 60 | No | 14.0 |
See also
--------
* [CSS Properties and Values API](https://developer.mozilla.org/en-US/docs/Web/API/CSS_Properties_and_Values_API)
* [CSS Painting API](https://developer.mozilla.org/en-US/docs/Web/API/CSS_Painting_API)
* [CSS Typed Object Model](https://developer.mozilla.org/en-US/docs/Web/API/CSS_Typed_OM_API)
* [CSS Houdini](https://developer.mozilla.org/en-US/docs/Web/Guide/Houdini)
css inherits inherits
========
**Experimental:** **This is an [experimental technology](https://developer.mozilla.org/en-US/docs/MDN/Writing_guidelines/Experimental_deprecated_obsolete#experimental)**
Check the [Browser compatibility table](#browser_compatibility) carefully before using this in production.
The `inherits` [CSS](https://developer.mozilla.org/en-US/docs/Web/CSS) descriptor is required when using the [`@property`](../@property) [at-rule](../at-rule) and controls whether the custom property registration specified by `@property` inherits by default.
Syntax
------
```
@property --property-name {
syntax: "<color>";
inherits: false;
initial-value: #c0ffee;
}
@property --property-name {
syntax: "<color>";
inherits: true;
initial-value: #c0ffee;
}
```
Values
------
`true` The property inherits by default.
`false` The property does not inherit by default.
Formal definition
-----------------
| | |
| --- | --- |
| Related [at-rule](../at-rule) | [`@property`](../@property) |
| [Initial value](../initial_value) | `auto` |
| [Computed value](../computed_value) | as specified |
Formal syntax
-------------
```
inherits =
true [|](../value_definition_syntax#single_bar)
false
```
Examples
--------
Add type checking to `--my-color` [`custom property`](../--*), as a color, a default value, and not allow it to inherit its value:
Using [CSS](https://developer.mozilla.org/en-US/docs/Web/CSS) [`@property`](../@property) [at-rule](../at-rule):
```
@property --my-color {
syntax: "<color>";
inherits: false;
initial-value: #c0ffee;
}
```
Using [JavaScript](https://developer.mozilla.org/en-US/docs/Web/JavaScript) [`CSS.registerProperty`](https://developer.mozilla.org/en-US/docs/Web/API/CSS/RegisterProperty):
```
window.CSS.registerProperty({
name: "--my-color",
syntax: "<color>",
inherits: false,
initialValue: "#c0ffee",
});
```
Specifications
--------------
| Specification |
| --- |
| [CSS Properties and Values API Level 1 # inherits-descriptor](https://drafts.css-houdini.org/css-properties-values-api/#inherits-descriptor) |
Browser compatibility
---------------------
| | Desktop | Mobile |
| --- | --- | --- |
| | Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet |
| `inherits` | 85 | 85 | No | No | 71 | No | 85 | 85 | No | 60 | No | 14.0 |
See also
--------
* [CSS Properties and Values API](https://developer.mozilla.org/en-US/docs/Web/API/CSS_Properties_and_Values_API)
* [CSS Painting API](https://developer.mozilla.org/en-US/docs/Web/API/CSS_Painting_API)
* [CSS Typed Object Model](https://developer.mozilla.org/en-US/docs/Web/API/CSS_Typed_OM_API)
* [CSS Houdini](https://developer.mozilla.org/en-US/docs/Web/Guide/Houdini)
css initial-value initial-value
=============
**Experimental:** **This is an [experimental technology](https://developer.mozilla.org/en-US/docs/MDN/Writing_guidelines/Experimental_deprecated_obsolete#experimental)**
Check the [Browser compatibility table](#browser_compatibility) carefully before using this in production.
The `initial-value` [CSS](https://developer.mozilla.org/en-US/docs/Web/CSS) descriptor is required when using the [`@property`](../@property) [at-rule](../at-rule) unless the syntax accepts any valid token stream. It sets the initial-value for the property.
The value chosen as the `initial-value` must parse correctly according to the syntax definition. Therefore, if syntax is `<color>` then the initial-value must be a valid [`color`](../color) value.
Syntax
------
```
@property --property-name {
syntax: "<color>";
inherits: false;
initial-value: #c0ffee;
}
@property --property-name {
syntax: "<color>";
inherits: true;
initial-value: #c0ffee;
}
```
Values
------
A string with a value which is a correct value for the chosen `syntax`.
Formal definition
-----------------
| | |
| --- | --- |
| Related [at-rule](../at-rule) | [`@property`](../@property) |
| [Initial value](../initial_value) | `n/a (required)` |
| [Computed value](../computed_value) | as specified |
Formal syntax
-------------
```
initial-value =
[<declaration-value>](../declaration-value)
```
Examples
--------
Add type checking to `--my-color` [`custom property`](../--*), as a color, the initial-value being a valid color:
Using [CSS](https://developer.mozilla.org/en-US/docs/Web/CSS) [`@property`](../@property) [at-rule](../at-rule):
```
@property --my-color {
syntax: "<color>";
inherits: false;
initial-value: #c0ffee;
}
```
Using [JavaScript](https://developer.mozilla.org/en-US/docs/Web/JavaScript) [`CSS.registerProperty`](https://developer.mozilla.org/en-US/docs/Web/API/CSS/RegisterProperty):
```
window.CSS.registerProperty({
name: "--my-color",
syntax: "<color>",
inherits: false,
initialValue: "#c0ffee",
});
```
Specifications
--------------
| Specification |
| --- |
| [CSS Properties and Values API Level 1 # initial-value-descriptor](https://drafts.css-houdini.org/css-properties-values-api/#initial-value-descriptor) |
Browser compatibility
---------------------
| | Desktop | Mobile |
| --- | --- | --- |
| | Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet |
| `initial-value` | 85 | 85 | No | No | 71 | No | 85 | 85 | No | 60 | No | 14.0 |
See also
--------
* [CSS Properties and Values API](https://developer.mozilla.org/en-US/docs/Web/API/CSS_Properties_and_Values_API)
* [CSS Painting API](https://developer.mozilla.org/en-US/docs/Web/API/CSS_Painting_API)
* [CSS Typed Object Model](https://developer.mozilla.org/en-US/docs/Web/API/CSS_Typed_OM_API)
* [CSS Houdini](https://developer.mozilla.org/en-US/docs/Web/Guide/Houdini)
css Shapes from images Shapes from images
==================
In this guide, we will take a look at how we can create a shape from an image file with an alpha channel or even from a CSS Gradient. This is a very flexible way to create shapes. Rather than drawing a path with a complex polygon in CSS, you can create the shape in a graphics program and then use the path created by the pixels less opaque than a threshold value.
Creating shapes from images
---------------------------
To use an image for creating a shape, the image needs to have an Alpha Channel, an area that is not fully opaque. The [`shape-image-threshold`](../shape-image-threshold) property is used to set a threshold for this opacity. Pixels that are more opaque than this value will be used to calculate the area of the shape.
In the example below, there is an image of a star with a solid red area and an area that is fully transparent. The path to the image file is used as the value for the [`shape-outside`](../shape-outside) property. The content now wraps around the star shape.
You can use [`shape-margin`](../shape-margin) to move the text away from the shape, giving a margin around the created shape and the text.
CORS compatibility
------------------
Something that you will run into when creating shapes from an image is that the image you use must be [CORS compatible](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS). An image hosted on the same domain as your site should work, however, if your images are hosted on a different domain such as on a CDN you should ensure that they are sending the correct headers to enable them to be used for Shapes. Due to this requirement for CORS-compatible images, if you are previewing your file locally without using a local web server, your shape will not work.
### Is it a CORS issue?
DevTools can help you to identify CORS errors. In Chrome the Console will alert you to CORS problems. In Firefox if you inspect the property you will be alerted to the fact that the image could not be loaded. This should alert you to the fact that your image cannot be used as the source of a shape due to CORS.
Setting a threshold
-------------------
The [`shape-image-threshold`](../shape-image-threshold) property enables the creation of shapes from areas which are not fully transparent. If the value of `shape-image-threshold` is `0.0` (which is the initial value) then the area must be fully transparent. If the value is `1.0` then it is fully opaque. Values in between mean that you can set a semi-transparent area as the defining area.
In the example below I am using a similar image to the initial example, however, in this image the background of the star is not fully transparent, it has a 20% opacity as created in my graphics program. If I set `shape-image-threshold` to `0.3` then I see the shape, if I set it to something smaller than `0.2` I do not get the shape.
Using images with generated content
-----------------------------------
In the above example, I have both used the image as the value of [`shape-outside`](../shape-outside) and also added it to the page. Many demos do this as it helps to show the shape we are following, however, the `shape-outside` property is not related to the image that is displayed on the page and so you do not need to display an image to use an image to create a shape.
You do need something to float, but that could be some generated content as in the below example. I am floating generated content and using a larger star image to shape my content without displaying any image on the page.
Creating shapes using a gradient
--------------------------------
Because a [CSS gradient](../css_images/using_css_gradients) is treated as an image, you can use a gradient to generate a shape by having transparent or semi-transparent areas as part of the gradient.
The next example uses generated content. The content has been floated, giving it a background image of a linear gradient. I am using that same value as the value of [`shape-outside`](../shape-outside). The linear gradient goes from purple to transparent. By changing the value of [`shape-image-threshold`](../shape-image-threshold), you can decide how transparent the pixels need to be that create the shape. You can play with that value in the example below to see how the diagonal line will move across the shape depending on that value.
You could also try removing the background image completely, thus using the gradient purely to create the shape and not displaying it on the page at all.
The next example uses a radial gradient with an ellipse, once again using a transparent part of the gradient to create the shape.
You can experiment directly in these live examples to see how changing the gradient will change the path of your shape.
| programming_docs |
css Basic shapes Basic shapes
============
CSS Shapes can be defined using the [`<basic-shape>`](../basic-shape) type, and in this guide I'll explain how each of the different values accepted by this type work. They range from simple circles to complex polygons.
Before looking at shapes, it is worth understanding two pieces of information that go together to make these shapes possible:
* The `<basic-shape>` type
* The reference box
The <basic-shape> type
----------------------
The `<basic-shape>` type is used as the value for all of our basic shapes. This type uses Functional Notation: the type of shape is followed by brackets, inside of which are additional values used to describe the shape.
The arguments which are accepted vary depending on the shape that you are creating. We will cover these in the examples below.
The reference box
-----------------
Understanding the reference box used by CSS Shapes is important when using basic shapes, as it defines each shape's coordinate system. You have already met the reference box in [the guide on creating shapes from Box Values](from_box_values), which directly uses the reference box to create the shape.
The Firefox Shapes Inspector helpfully shows the reference box in use when you inspect a shape. In the screenshot below I have created a circle, using `shape-outside: circle(50%)`. The floated element has 20 pixels of padding, border and margin applied, and the Shapes Inspector highlights these reference boxes. When using a basic shape, the reference box used by default is the margin-box. You can see in the screenshot that the shape is being defined with reference to that part of the Box Model.
You can add the various box values after your basic shape definition. Therefore the default behavior is as if you have defined.
```
.shape {
shape-outside: circle(50%) margin-box;
}
```
You can therefore change this in order that your shape uses the different parts of the box model, for example to use the border.
```
.shape {
shape-outside: circle(50%) border-box;
}
```
What is worth noting is that the `margin-box` will clip the shape, therefore shapes created in reference to other shapes which extend past the margin box will have the shape clipped to the margin box. We will see this in the following examples of basic shapes.
For an excellent description of references boxes as they apply to CSS Shapes, see [Understanding Reference Boxes for CSS Shapes](http://razvancaliman.com/writing/css-shapes-reference-boxes/).
inset()
-------
The `inset()` type defines a rectangle, which may not seem very useful as floating an item will give you a rectangular shape around it. However the `inset()` types enables the definition of offsets, thus pulling the content in over the shape.
Therefore `inset()` takes four values for the top, right, bottom and left values plus a final value for `border-radius`. The below CSS creates a rectangular shape inset from the reference box of the floated element 20 pixels from the top and bottom and 10 pixels from the left and right, with a border-radius value of 10 pixels.
```
.shape {
float: left;
shape-outside: inset(20px 10px 20px 10px round 10px);
}
```
Using the same rules as we use for the margin shorthand, you can set more than one offset at once. If there is only one value, it applies to all sides. If there are two values, the top and bottom offsets are set to the first value and the right and left offsets are set to the second. If there are three values, the top is set to the first value, the left and right are set to the second, and the bottom is set to the third. If there are four values, they apply to the top, right, bottom, and left, respectively. So, the above rules could also be described as:
```
.shape {
float: left;
shape-outside: inset(20px 10px round 10px);
}
```
In the example below we have an `inset()` shape used to pull content over the floated element. Change the offset values to see how the shape changes.
You can also add the Box Value that you wish to use as a reference box. In the example below change the reference box from `margin-box` to `border-box`, `padding-box` or `content-box` to see how the reference box used as the starting point before offsets are calculated changes.
circle()
--------
The `circle()` value for `shape-outside` can accept two possible arguments. The first is the `shape-radius`.
Both `circle()` and `ellipse()` values for `shape-outside` are specified as accepting this argument of `<shape-radius>`. This argument can be a length or percentage but can also be one of the keywords `closest-side` or `farthest-side`.
The keyword `closest-side` uses the length from the center of the shape to the closest side of the reference box. For circles, this is the closest side in any dimension. For ellipses, this is the closest side in the radius dimension.
The keyword `farthest-side` uses the length from the center of the shape to the farthest side of the reference box. For circles, this is the farthest side in any dimension. For ellipses, this is the farthest side in the radius dimension.
The second argument is a `position`. If omitted this will be set to `center`. However you can use any valid position here to indicate the position of the center of the circle.
Our circle therefore accepts one radius value, which may be a length, a percentage or the closest-side or farthest side keyword then optionally the keyword **at** followed by a position value.
In the below example I have created a circle on an item with a width of 100 pixels, plus a margin of 20 pixels. This gives a total width for the reference box of 140 pixels. I have given a value of 50% for the shape-radius value which means that our radius is 70px. I have then set the position value to 30%.
In the live example you can play with increasing or decreasing the size of the circle by changing the size of the radius, moving the circle around with the position value, or setting a reference box as we did for `inset()`.
As an additional example, if you use the keywords `top left` for position, you can make a quarter circle shape in the top left corner of the page. The example below uses generated content to create a quarter circle shape for text to flow around.
### The shape will be clipped by the margin box
When describing Reference Boxes I explained that the margin-box will clip the shape. You can see this by moving the center of our circle towards the content by setting the position to 60%. The center of the circle is now nearer the content and the circle extends past the margin-box. This means that the extension becomes clipped and squared off.
```
img {
float: left;
shape-outside: circle(50% at 60%);
}
```

ellipse()
---------
An ellipse is essentially a squashed circle and so `ellipse()` acts in a very similar way to `circle()` except that we have to specify two radii x and y in that order.
These may then be followed by position values as with `circle()` to move the center of the ellipse around. In the example below we have an ellipse with an x radius of 40%, a y radius of 50% and the position being left. This means that the center of the ellipse is on the left edge of the box giving us a half ellipse shape to wrap our text around. You can change these values to see how the ellipse changes.
The keyword values of `closest-side` and `farthest-side` are useful to create a quick ellipse based on the size of the floated element reference box.
polygon()
---------
The final Basic Shape is the most complex and enables the creation of many side shapes by way of creating a `polygon()`. This shape accepts three or more pairs of values (a polygon must at least draw a triangle). These values are co-ordinates drawn with reference to the reference box.
In the example below I have created a shape for text to follow using the `polygon()`, you can change any of the values to see how the shape is changed.
You may well find the Firefox Shape Inspector very useful here to create your polygon shape. The screenshot below shows the shape highlighted in the tool.
Another useful resource is [Clippy](https://bennettfeely.com/clippy/) - a tool for creating shapes for `clip-path`, as the values for Basic Shapes are the same as those used for `clip-path`.
css Shapes from box values Shapes from box values
======================
A straightforward way to create a shape is to use a value from the CSS Box Model. This article explains how to do this.
The [box values](https://drafts.csswg.org/css-shapes-1/#shapes-from-box-values) allowable as a shape value are:
* `content-box`
* `padding-box`
* `border-box`
* `margin-box`
The `border-radius` values are also supported, this means that you can have something in your page with a curved border, and your shape can follow the created shape.
CSS box model
-------------
The values listed above correspond to the various parts of the CSS Box Model. A box in CSS has content, padding, border, and margin.
By using Box Values for Shapes we can wrap our content around the edges defined by these values. In all of the examples below I am using an element which has padding, a border, and a margin defined in order that you can see the different ways in which content will flow.
### margin-box
The `margin-box` is the shape defined by the outside margin edge and includes the corner radius of the shape, should [`border-radius`](../border-radius) have been used in defining the element.
In the example below, we have a circular purple item which is a [`<div>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/div) with a height, width, and background color. The `border-radius` property has been used to create a circle by setting `border-radius: 50%`. As the element has a margin, you can see that the content is flowing around the circular shape and the margin applied to it.
### border-box
The `border-box` value is the shape defined by the outside border edge. This shape follows all of the normal border radius shaping rules for the outside of the border. You still have a border, even if you have not used the CSS [`border`](../border) property. In this case it will be the same as `padding-box`, the shape defined by the outside padding edge.
In the example below you can see how the text now follows the line created by the border. Change the border size and the content follows it.
### padding-box
The `padding-box` value defines the shape enclosed by the outside padding edge. This shape follows all of the normal border radius shaping rules for the inside of the border. If you have no padding then `padding-box` is the same as `content-box`.
### content-box
The `content-box` value defines the shape enclosed by the outside content edge. Each corner radius of this box is the larger of 0 or border-radius − border-width − padding. This Means that it is impossible to have a negative value here.
When to use box values
----------------------
Using box values is a simple way to create shapes; however, this is by nature only going to work with very simple shapes that can be defined using the well-supported `border-radius` property. The examples shown above show one such use case. You can create a circular shape using border-radius and then curve text around it.
You can create some interesting effects however with just this simple technique. In my final example of this section, I have floated two elements left and right, giving each a border-radius of 100% in the direction closest to the text.
For more complex shapes, you will need to use one of the [basic shapes](basic_shapes) as a value, or define your shape from an image as covered in other guides in this section.
css Overview of shapes Overview of shapes
==================
The [CSS Shapes Level 1 Specification](https://www.w3.org/TR/css-shapes/) describes geometric shapes in CSS. They are, in Level 1 of the specification, designed to be applied to floated items. This article provides an overview of what you can do with shapes.
You could for example float an item left, which would cause the text to wrap round the right and bottom of the item in a rectangular fashion. If you then apply a circle shape, the text would then wrap round the line of the circle.
There are a number of ways to create these Shapes and in these guides we will find out how CSS Shapes work, and consider some ways you might like to use them.
What does the specification define?
-----------------------------------
The specification defines three new properties:
* [`shape-outside`](../shape-outside) — allows definition of basic shapes
* [`shape-image-threshold`](../shape-image-threshold) — Sets an opacity threshold value. If an image is being used to define the shape, only the parts of the image that are the same opacity or greater than the threshold value are used in the shape. Any other parts are ignored.
* [`shape-margin`](../shape-margin) — sets a margin around the defined shape
Defining basic shapes
---------------------
The `shape-outside` property allows us to a define a shape. It takes a variety of values, all of which define different shapes, specified in the [`<basic-shape>`](../basic-shape) datatype. We can start by looking at a very simple case.
In the following example I have an image floated left. I have then applied the `shape-outside` property to it with a value of `circle(50%)`. The result is that the content now curves around the circular shape rather than following the rectangle created by the box of the image.
As in this level of the specification an element has to be floated in order to apply `<basic-shape>` to it; this has the side-effect of creating a simple fallback for many cases. If you do not have Shapes support in the browser, the user will see content flowing around the sides of a rectangular box as before. If they do have Shapes support then the visual display is enhanced.
### Basic shapes
The value `circle(50%)` is an example of a basic shape. The specification defines four `<basic-shape>` values, which are:
* `inset()`
* `circle()`
* `ellipse()`
* `polygon()`
Using the value `inset()` wraps text around a rectangular shape however you are able to add offset values, thus pulling the line boxes of any wrapping content closer to the object than would otherwise happen.
We have already seen how `circle()` creates a circular shape. An `ellipse()` is essentially a squashed circle. If none of these simple shapes do the trick you can create a `polygon()` and make the shape as complex as you want.
In our [Guide to Basic Shapes](basic_shapes) we explore each of the possible Basic Shapes and how to create them.
### Shapes from the box value
Shapes can also be created around the box value. Therefor, you could create your shape on:
* `border-box`
* `padding-box`
* `content-box`
* `margin-box`
In the example below, you can change the value `border-box` to any of the other allowed values to see how the shape moves closer or further away from the box.
To explore the box values in more detail, see our guide covering [Shapes from box values](from_box_values).
### Shapes from images
An interesting way to generate your path is to use an image with an alpha channel — the text will then wrap around the non-transparent parts of the image. This allows the overlay of wrapped content around an image, or the use of an image which is never displayed on the page purely as a method of creating a complex shape without needing to carefully map a polygon.
Note that images used in this way must be [CORS compatible](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS), otherwise `shape-outside` will act as if `none` had been given as the value, and you will get no shape.
In this next example, we have an image with a fully transparent area, and we are using an image as the URL value for `shape-outside`. The shape is created around the opaque area — the image of the balloon.
#### `shape-image-threshold`
The `shape-image-threshold` property is used to set the threshold of image transparency used to define the area of the image used for the shape. If the value of `shape-image-threshold` is `0.0` (which is the initial value) then the area must be fully transparent. If the value is `1.0` then it is fully opaque. Values in between mean that you can set a semi-transparent area as the defining area of the shape.
You can see the threshold in action if we use a gradient as the image on which to define our shape. In the example below, if you change the threshold the path that the shape takes changes based on the level of opacity you have selected.
We take a deeper look at creating shapes from images in the [Shapes from Images](shapes_from_images) guide.
The `shape-margin` property
---------------------------
The [`shape-margin`](../shape-margin) property adds a margin to `shape-outside`. This will further shorten the line boxes of any content wrapping the shape, pushing it away from the shape itself.
In the example below we have added a `shape-margin` to a basic shape. Change the margin to push the text further away from the path the shape would take by default.
Using Generated Content as the floated item
-------------------------------------------
In the examples above, we have used images or a visible element to define the shape, meaning that you can see the shape on the page. Instead, you might want to cause some text to flow along a non-rectangular invisible line. You can do this with Shapes, however you will still need a floated item, which you can then make invisible. That could be a redundant element inserted into the document, an empty [`<div>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/div) or [`<span>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/span) perhaps, but our preference is to use generated content. This means we can keep things used for styling inside the CSS.
In this next example, we use generated content to insert an element with height and width of 150px. We can then use Basic Shapes, Box Values or even the Alpha Channel of an image to create a shape for the text to wrap around.
Relationship to `clip-path`
---------------------------
The Basic Shapes and Box values used to create Shapes are the same as those used as values for [`clip-path`](../clip-path). Therefore if you want to create a shape using an image, and also clip away part of that image, you can use the same values.
The image below is a square image with a blue background. We have defined a shape using `shape-outside: ellipse(40% 50%);` and also used `clip-path: ellipse(40% 50%);` to clip away the same area that we have used to define the shape.
Developer Tools for Shapes
--------------------------
Along with CSS Shapes support in the browser, Firefox are shipping a [Shape Path Editor](https://firefox-source-docs.mozilla.org/devtools-user/page_inspector/how_to/edit_css_shapes/index.html) in the Firefox DevTools. This tool means that you can inspect any shapes on your page, and even change the values in the live page. If your polygon isn't quite right you can use the Shapes Editor to tweak it, then copy the new value back into your CSS.
The Shape Path Editor will be enabled by default in Firefox 60 for shapes generated via `clip-path`. You can also use it to edit shapes generated via `shape-outside`, but only when you enable it via the `layout.css.shape-outside.enabled` pref.
Future CSS Shapes Features
--------------------------
The initial Shapes specification included a property `shape-inside` for creating shapes inside an element. This property, along with the possibility of creating shapes on non-floated elements, has been moved to [level 2](https://drafts.csswg.org/css-shapes-2/) of the specification. As the `shape-inside` property was initially in Level 1 of the specification, you may find tutorials on the web detailing both properties.
| programming_docs |
css image() image()
=======
The `image()` [CSS](https://developer.mozilla.org/en-US/docs/Web/CSS) [function](../css_functions) defines an [`<image>`](../image) in a similar fashion to the [`url()`](../url) function, but with added functionality including specifying the image's directionality, displaying just a part of that image defined by a media fragment, and specifying a solid color as a fallback in case none of the specified images are able to be rendered.
**Note:** The CSS `image()` function should not confused with [`Image()`, the `HTMLImageElement` constructor](https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/Image).
Syntax
------
```
<image()> =
image( <image-tags>[?](../value_definition_syntax#question_mark) [[](../value_definition_syntax#brackets) <image-src>[?](../value_definition_syntax#question_mark) , [<color>](../color_value)[?](../value_definition_syntax#question_mark) ]! )
<image-tags> =
ltr [|](../value_definition_syntax#single_bar)
rtl
<image-src> =
<url> [|](../value_definition_syntax#single_bar)
[<string>](../string)
<url> =
url( [<string>](../string) [<url-modifier>](../url-modifier)[\*](../value_definition_syntax#asterisk) ) [|](../value_definition_syntax#single_bar)
src( [<string>](../string) [<url-modifier>](../url-modifier)[\*](../value_definition_syntax#asterisk) )
```
where:
`image-tags` Optional
The directionality of the image, either `ltr` for left-to-right or `rtl` for right-to-left.
`image-src` Optional
Zero or more [`url()`](../url)s or [`<string>`](../string)s specifying the image sources, with optional image fragment identifiers.
`color` Optional
A color, specifying a solid background color to use as a fallback if no `image-src` is found, supported, or declared.
### Bi-directional awareness
The first, optional parameter of the `image()` notation is the directionality of the image. If included, and the image is used on an element with opposite directionality, the image will be flipped horizontally in horizontal writing modes. If the directionality is omitted, the image won't be flipped if the language direction is changed.
### Image fragments
One key difference between `url()` and `image()` is the ability to add a media fragment identifier — a starting point along the x and y axis, along with a width and height — onto the image source to display only a section of the source image. The section of the image defined in the parameter becomes a standalone image. The syntax looks like so:
```
background-image: image("myimage.webp#xywh=0,20,40,60");
```
The background image of the element will be the portion of the image *myImage.webp* that starts at the coordinate 0px, 20px (the top left-hand corner) and is 40px wide and 60px tall.
The `#xywh=#,#,#,#` media fragment syntax takes four comma separated numeric values. The first two represent the X and Y coordinates for the starting point of the box that will be created. The third value is the width of the box, and the last value is the height. By default, these are pixel values. The [spacial dimension definition in the media specification](https://www.w3.org/TR/media-frags/#naming-space) indicates that percentages will be supported as well:
```
xywh=160,120,320,240 /\* results in a 320x240 image at x=160 and y=120 \*/
xywh=pixel:160,120,320,240 /\* results in a 320x240 image at x=160 and y=120 \*/
xywh=percent:25,25,50,50 /\* results in a 50%x50% image at x=25% and y=25% \*/
```
The image fragments can be used in `url()` notation as well. The `#xywh=#,#,#,#` media fragment syntax is 'backwards compatible' in that a media fragment will be ignored if not understood, and won't break the source call when used with `url()`. If the browser doesn't understand the media fragments notation, it ignores the fragment, displaying the entire image.
Browsers that understand `image()` also understand the fragment notation. Therefore, if the fragment is not understood within `image()`, the image will be considered invalid.
### Color fallback
If a color is specified in `image()` along with your image sources, it acts as a fallback if the images are invalid and do not appear. In such cases, the `image()` function renders as if no image were included, generating a solid-color image. As a use case, consider a dark image being used as a background for some white text. A dark background color may be needed for foreground text to be legible, if the image does not render.
Omitting image sources while including a color is valid and creates a color swatch. Unlike declaring a [`background-color`](../background-color), which is placed under or behind all the background images, this can be used to put (generally semi-transparent) colors over other images.
The size of the color swatch can be set with the [`background-size`](../background-size) property. This is different from the `background-color`, which sets a color to cover the entire element. Both `image(color)` and `background-color` placements are impacted by the [`background-clip`](../background-clip) and [`background-origin`](../background-origin) properties.
Accessibility concerns
----------------------
Browsers do not provide any special information on background images to assistive technology. This is important primarily for screen readers, as a screen reader will not announce its presence and therefore convey nothing to its users. If the image contains information critical to understanding the page's overall purpose, it is better to describe it semantically in the document.
* [MDN Understanding WCAG, Guideline 1.1 explanations](https://developer.mozilla.org/en-US/docs/Web/Accessibility/Understanding_WCAG/Perceivable#guideline_1.1_%e2%80%94_providing_text_alternatives_for_non-text_content)
* [Understanding Success Criterion 1.1.1 | W3C Understanding WCAG 2.0](https://www.w3.org/TR/2016/NOTE-UNDERSTANDING-WCAG20-20161007/text-equiv-all.html)
This feature can help improve accessibility by providing a fallback color when an image fails to load. While this can and should be done by including a background-color on every background image, the CSS `image()` function allows adding allows only including background colors should an image fail to load, which means you can add a fall back color should a transparent PNG/GIF/WebP not load.
Examples
--------
### Directionally-sensitive images
```
<ul>
<li dir="ltr">Bullet is a right facing arrow on the left</li>
<li dir="rtl">Bullet is the same arrow, flipped to point left.</li>
</ul>
```
```
ul {
list-style-image: image(ltr "rightarrow.png");
}
```
In the left-to-right list items — those with `dir="ltr"` set on the element itself or inheriting the directionality from an ancestor or default value for the page — the image will be used as-is. List items with `dir="rtl"` set on the `<li>` or inheriting the right-to-left directionality from an ancestor, such as documents set to Arabic or Hebrew, will have the bullet display on the right, horizontally flipped, as if `transform: scalex(-1)` had been set. The text will also be displayed left-to-right.
### Displaying a section of the background image
```
<div class="box">Hover over me. What cursor do you see?</div>
```
```
.box:hover {
cursor: image("sprite.png#xywh=32,64,16,16");
}
```
When the user hovers over the box, the cursor will change to display the 16x16 px section of the sprite image, starting at x=32 and y=64.
### Putting color on top of a background image
```
.quarterlogo {
background-image: image(rgba(0, 0, 0, 0.25)), url("firefox.png");
background-size: 25%;
background-repeat: no-repeat;
}
```
```
<div class="quarterlogo">
If supported, a quarter of this div has a darkened logo
</div>
```
The above will put a semi-transparent black mask over the Firefox logo background image. Had we used the [`background-color`](../background-color) property instead, the color would have appeared behind the logo image instead of on top of it. Additionally, the entire container would have had the same background color. Because we used `image()` along with the [`background-size`](../background-size) property (and prevented the image from repeating with the [`background-repeat`](../background-repeat) property, the color swatch will only cover a quarter of the container.
Specifications
--------------
| Specification |
| --- |
| [CSS Image Values and Replaced Content Module Level 4 # image-notation](https://w3c.github.io/csswg-drafts/css-images-4/#image-notation) |
Browser compatibility
---------------------
| | Desktop | Mobile |
| --- | --- | --- |
| | Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet |
| `image` | No | No | No
["See [bug 703217](https://bugzil.la/703217).", "The [`-moz-image-rect()`](https://developer.mozilla.org/docs/Web/CSS/-moz-image-rect) function supports fragments as of Firefox 4."] | No | No | No | No | No | No
The [`-moz-image-rect()`](https://developer.mozilla.org/docs/Web/CSS/-moz-image-rect) function supports fragments as of Firefox 4. | No | No | No |
See also
--------
* [`<image>`](../image)
* [`element()`](../element())
* [`url()`](../url)
* [`clip-path`](../clip-path)
* [`-moz-image-rect()`](../-moz-image-rect)
* [`<gradient>`](../gradient)
* [`image-set()`](image-set)
* [`cross-fade()`](../cross-fade)
css paint() paint()
=======
The `paint()` [CSS](https://developer.mozilla.org/en-US/docs/Web/CSS) [function](../css_functions) defines an [`<image>`](../image) value generated with a PaintWorklet.
Syntax
------
```
paint(workletName, ...parameters)
```
where:
*workletName* The name of the registered worklet.
*parameters* Optional additional parameters to pass to the paintWorklet
Examples
--------
### Basic usage example
In JavaScript, we register the [paint worklet](https://developer.mozilla.org/en-US/docs/Web/API/PaintWorklet):
```
CSS.paintWorklet.addModule("boxbg.js");
```
...then, in the CSS, we define the `background-image` as a `paint()` type with the worklet name, `boxbg`, along with any variables (ex. `--boxColor` and `--widthSubtractor`) the worklet will use:
```
li {
background-image: paint(boxbg);
--boxColor: hsl(55 90% 60% / 1);
}
li:nth-of-type(3n) {
--boxColor: hsl(155 90% 60% / 1);
--widthSubtractor: 20;
}
li:nth-of-type(3n + 1) {
--boxColor: hsl(255 90% 60% / 1);
--widthSubtractor: 40;
}
```
The result will be the following:
### With additional parameters
You can pass additional arguments via the CSS paint() function. In this example, we passed two arguments: whether the background-image on a group of list items is filled or just has a stroke outline, and the width of that outline:
```
li {
--boxColor: hsl(55 90% 60% / 1);
background-image: paint(hollowHighlights, stroke, 2px);
}
li:nth-of-type(3n) {
--boxColor: hsl(155 90% 60% / 1);
background-image: paint(hollowHighlights, filled, 3px);
}
li:nth-of-type(3n + 1) {
--boxColor: hsl(255 90% 60% / 1);
background-image: paint(hollowHighlights, stroke, 1px);
}
```
We've included a custom property in the selector block defining a boxColor. Custom properties are accessible to the PaintWorklet.
Specifications
--------------
| Specification |
| --- |
| [CSS Painting API Level 1 # paint-notation](https://drafts.css-houdini.org/css-paint-api/#paint-notation) |
Browser compatibility
---------------------
| | Desktop | Mobile |
| --- | --- | --- |
| | Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet |
| `paint` | 65 | 79 | No | No | 52 | No | 65 | 65 | No | 47 | No | 9.2 |
| `additional_parameters` | No | No | No | No | No | No | No | No | No | No | No | No |
See also
--------
* [`PaintWorklet`](https://developer.mozilla.org/en-US/docs/Web/API/PaintWorklet)
* [CSS Painting API](https://developer.mozilla.org/en-US/docs/Web/API/CSS_Painting_API)
* [Using the CSS Painting API](https://developer.mozilla.org/en-US/docs/Web/API/CSS_Painting_API/Guide)
* [`<image>`](../image)
* [`canvas`](https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API)
css image-set() image-set()
===========
The `image-set()` [CSS](https://developer.mozilla.org/en-US/docs/Web/CSS) [functional](../css_functions) notation is a method of letting the browser pick the most appropriate CSS image from a given set, primarily for high pixel density screens.
Resolution and bandwidth differ by device and network access. The `image-set()` function delivers the most appropriate image resolution for a user's device, providing a set of image options — each with an associated resolution declaration — from which the browser picks the most appropriate for the device and settings. Resolution can be used as a proxy for filesize — a user agent on a slow mobile connection with a high-resolution screen may prefer to receive lower-resolution images rather than waiting for a higher resolution image to load.
`image-set()` allows the author to provide options rather than determining what each individual user needs.
Syntax
------
```
image-set() = image-set( <image-set-option># )
where <image-set-option> = [ <image> | <string> ] <resolution> and
<string> is an <url>
```
### Values
`<image>` The [`<image>`](../image) can be any image type except for an image set. The `image-set()` function may not be nested inside another `image-set()` function.
`<string>` A URL to an image.
`<resolution>` Optional
[`<resolution>`](../resolution) units include `x` or `dppx`, for dots per pixel unit, `dpi`, for dots per inch, and `dpcm` for dots per centimeter. Every image within an `image-set()` must have a unique resolution.
`type(<string>)` Optional
A valid MIME type string, for example "image/jpeg".
Examples
--------
### Using image-set() to provide alternative background-image options
This example shows how to use [`image-set()`](https://drafts.csswg.org/css-images-4/#funcdef-image-set) to provide two alternative [`background-image`](../background-image) options, chosen depending on the resolution needed: a normal version and a high-resolution version.
**Note:** In the above example, the `-webkit` prefixed version is also used to support Chrome and Safari. In Firefox 90, support was added for `-webkit-image-set()` as an alias to `image-set()` (in order to provide compat where developers had not added the standard property).
### Using image-set() to provide alternative image formats
In the next example the `type()` function is used to serve the image in AVIF and JPEG formats. If the browser supports avif, it will choose that version. Otherwise it will use the jpeg version.
#### Providing a fallback
There is no inbuilt fallback for `image-set()`; therefore to include a [`background-image`](../background-image) for those browsers that do not support the function, a separate declaration is required before the line using `image-set()`.
```
.box {
background-image: url("large-balloons.jpg");
background-image: image-set(
"large-balloons.avif" type("image/avif"),
"large-balloons.jpg" type("image/jpeg")
);
}
```
Accessibility concerns
----------------------
Browsers do not provide any special information on background images to assistive technology. This is important primarily for screen readers, as a screen reader will not announce its presence and therefore convey nothing to its users. If the image contains information critical to understanding the page's overall purpose, it is better to describe it semantically in the document.
* [MDN Understanding WCAG, Guideline 1.1 explanations](https://developer.mozilla.org/en-US/docs/Web/Accessibility/Understanding_WCAG/Perceivable#guideline_1.1_%e2%80%94_providing_text_alternatives_for_non-text_content)
* [Understanding Success Criterion 1.1.1 | W3C Understanding WCAG 2.0](https://www.w3.org/TR/2016/NOTE-UNDERSTANDING-WCAG20-20161007/text-equiv-all.html)
Specifications
--------------
| Specification |
| --- |
| [CSS Image Values and Replaced Content Module Level 4 # image-set-notation](https://w3c.github.io/csswg-drafts/css-images-4/#image-set-notation) |
Browser compatibility
---------------------
| | Desktop | Mobile |
| --- | --- | --- |
| | Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet |
| `image-set` | 21 | 79 | 90
88
["In `cursor` and `content` properties, gradients are not supported as arguments to `image-set()`. See [bug 1696314](https://bugzil.la/1696314).", "Before Firefox 89, the `type()` function is not supported as an argument to `image-set()`."] | No | 15 | 6
Support for `url` images only and `x` is the only supported resolution unit. See [bug 160934](https://webkit.org/b/160934). | 4.4 | 25 | 90
88
["In `cursor` and `content` properties, gradients are not supported as arguments to `image-set()`. See [bug 1696314](https://bugzil.la/1696314).", "Before Firefox 89, the `type()` function is not supported as an argument to `image-set()`."] | 14 | 6
Support for `url` images only and `x` is the only supported resolution unit. See [bug 160934](https://webkit.org/b/160934). | 1.5 |
See also
--------
* [`<image>`](../image)
* [`image()`](image)
* [`element()`](../element())
* [`url()`](../url)
* [`<gradient>`](../gradient)
* [`cross-fade()`](../cross-fade)
css base-palette base-palette
============
The `base-palette` CSS [descriptor](https://developer.mozilla.org/en-US/docs/Glossary/Descriptor_(CSS)) is used to specify the name or index of a pre-defined palette to be used for creating a new palette. If the specified `base-palette` does not exist, then the palette defined at index 0 will be used.
Syntax
------
```
@font-palette-values --one {
base-palette: 1;
}
```
The `base-palette` [descriptor](https://developer.mozilla.org/en-US/docs/Glossary/Descriptor_(CSS)) is specified using a zero-based index of the font-maker created palettes.
### Values
`<index>` Specifies the index of the pre-defined palette to use.
Formal definition
-----------------
Value not found in DB!Formal syntax
-------------
```
base-palette =
light [|](../value_definition_syntax#single_bar)
dark [|](../value_definition_syntax#single_bar)
[<integer [0,∞]>](../integer)
```
Examples
--------
### Changing the default palette in a font
Using the [Rocher Color Font](https://www.harbortype.com/fonts/rocher-color/), this example shows two instances of switching the default palette in the font to an alternate palette created by the font-maker.
#### HTML
```
<h2>default base-palette</h2>
<h2 class="two">base-palette at index 2</h2>
<h2 class="five">base-palette at index 5</h2>
```
#### CSS
```
@font-face {
font-family: 'Rocher';
src: url('[path-to-font]/RocherColorGX.woff2') format('woff2');
}
h2 {
font-family: 'Rocher';
}
@font-palette-values --two {
font-family: 'Rocher';
base-palette: 2;
}
@font-palette-values --five {
font-family: 'Rocher';
base-palette: 5;
}
.two {
font-palette: --two;
}
.five {
font-palette: --five;
}
```
#### Result
Specifications
--------------
| Specification |
| --- |
| [CSS Fonts Module Level 4 # base-palette-desc](https://w3c.github.io/csswg-drafts/css-fonts/#base-palette-desc) |
Browser compatibility
---------------------
| | Desktop | Mobile |
| --- | --- | --- |
| | Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet |
| `base-palette` | 101 | 101 | 107 | No | 87 | 15.4 | 101 | 101 | 107 | 70 | 15.4 | 19.0 |
See also
--------
* [`@font-palette-values`](../@font-palette-values)
* [`font-family`](font-family) descriptor
* [`override-colors`](override-colors) descriptor
* [`font-palette`](../font-palette) property
| programming_docs |
css font-family font-family
===========
The [@font-palette-values](../@font-palette-values) [descriptor](https://developer.mozilla.org/en-US/docs/Glossary/Descriptor_(CSS)) `font-family` is used to specify which font-family palette values are to be applied to. This need to match exactly the values used when setting the CSS [font-family](../font-family).
Syntax
------
```
@font-palette-values --Dark-mode {
font-family: "Bungee Spice";
/\* other palette settings follow \*/
}
```
Other palette values that follow apply only to the specified font family. You can create [@font-palette-values](../@font-palette-values) for other font families by using the same [<dashed-ident>s](../dashed-ident). This means that if you have multiple Color Fonts and can use the same identifier for each.
### Values
`<family-name>` Specifies the name of the [font-family](../font-family).
Formal definition
-----------------
Value not found in DB!Formal syntax
-------------
```
font-family =
[<family-name>](../family-name)[#](../value_definition_syntax#hash_mark)
```
Examples
--------
### Using matching family names
In this example, when the `font-family` descriptor is used in the [@font-palette-values](../@font-palette-values) at-rule, the same value is used for the `font-family`, as when it is declared.
#### HTML
```
<h2>This is spicy</h2>
<h2 class="extra-spicy">This is extra hot & spicy</h2>
```
#### CSS
```
@import url(https://fonts.googleapis.com/css2?family=Bungee+Spice);
@font-palette-values --bungee-extra-spicy {
font-family: "Bungee Spice";
override-colors:
0 DarkRed,
1 Red;
}
h2 {
font-family: "Bungee Spice";
}
h2.extra-spicy {
font-palette: --bungee-extra-spicy;
}
```
#### Result
### Using the same palette identifier for multiple font-families
In this example, two [@font-palette-values](../@font-palette-values) at-rules are set for two font families, but both the at-rules use the same dashed-ident identifier, `--Dark Mode`. This helps to set the [font-palette](../font-palette) property for multiple elements, `h1` and `h2` in this case, at the same time. This can be useful when you want to update font colors to match your site's branding.
```
@font-palette-values --Dark-Mode {
font-family: "Bungee Spice";
/\* palette settings for Bungee Spice \*/
}
@font-palette-values --Dark-Mode {
font-family: Bixa;
/\* palette settings for Bixa \*/
}
h1, h2 {
font-palette: --Dark-Mode;
}
h1 {
font-family: "Bungee Spice";
}
h2 {
font-family: Bixa;
}
```
Specifications
--------------
| Specification |
| --- |
| [CSS Fonts Module Level 4 # font-family-2-desc](https://w3c.github.io/csswg-drafts/css-fonts/#font-family-2-desc) |
Browser compatibility
---------------------
| | Desktop | Mobile |
| --- | --- | --- |
| | Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet |
| `font-family` | 101 | 101 | 107 | No | 87 | 15.4 | 101 | 101 | 107 | 70 | 15.4 | 19.0 |
See also
--------
* [`font-family`](../@font-face/font-family)
* [`@font-palette-values`](../@font-palette-values)
* [`font-family`](font-family) descriptor
* [`override-colors`](override-colors) descriptor
* [`font-palette`](../font-palette) property
css override-colors override-colors
===============
The `override-colors` CSS [descriptor](https://developer.mozilla.org/en-US/docs/Glossary/Descriptor_(CSS)) is used to override colors in the chosen <base-palette> for a color font.
Syntax
------
```
/\* basic syntax \*/
override-colors: <index of color> <color>;
/\* using colour names \*/
override-colors: 0 red;
/\* using hex-color \*/
override-colors: 0 #f00;
/\* using rbg \*/
override-colors: 0 rgb(255, 0, 0);
/\* overriding multiple colors \*/
override-colors: 0 #f00, 1 #0f0, 2 #00f;
/\* overriding multiple colors with readability \*/
override-colors:
0 #f00,
1 #0f0,
2 #00f;
```
The `override-colors` [descriptor](https://developer.mozilla.org/en-US/docs/Glossary/Descriptor_(CSS)) takes a comma-separated list of the color index and new color value.
The color index is zero-based and any [color value](../color_value) can be used.
For each key-value pair of index and color, the color with the index in the specified <base-palette> will be overwritten. If the color font does not have a color at the specified index, it will be ignored.
### Values
`[ <integer [0,∞]> <absolute-color-base> ]` Specifies the index of a color in a <base-palette> and the color to overwrite it with.
Formal definition
-----------------
Value not found in DB!Formal syntax
-------------
```
override-colors =
[[](../value_definition_syntax#brackets) [<integer [0,∞]>](../integer) <absolute-color-base> []](../value_definition_syntax#brackets)[#](../value_definition_syntax#hash_mark)
<absolute-color-base> =
[<hex-color>](../hex-color) [|](../value_definition_syntax#single_bar)
<absolute-color-function> [|](../value_definition_syntax#single_bar)
[<named-color>](../named-color) [|](../value_definition_syntax#single_bar)
transparent
<absolute-color-function> =
<rgb()> [|](../value_definition_syntax#single_bar)
[<rgba()>](../rgba()) [|](../value_definition_syntax#single_bar)
<hsl()> [|](../value_definition_syntax#single_bar)
[<hsla()>](../hsla()) [|](../value_definition_syntax#single_bar)
<hwb()> [|](../value_definition_syntax#single_bar)
<lab()> [|](../value_definition_syntax#single_bar)
<lch()> [|](../value_definition_syntax#single_bar)
<oklab()> [|](../value_definition_syntax#single_bar)
<oklch()> [|](../value_definition_syntax#single_bar)
<color()>
<rgb()> =
rgb( [[](../value_definition_syntax#brackets) [<percentage>](../percentage) [|](../value_definition_syntax#single_bar) none []](../value_definition_syntax#brackets)[{3}](../value_definition_syntax#curly_braces) [[](../value_definition_syntax#brackets) / [[](../value_definition_syntax#brackets) <alpha-value> [|](../value_definition_syntax#single_bar) none []](../value_definition_syntax#brackets) []](../value_definition_syntax#brackets)[?](../value_definition_syntax#question_mark) ) [|](../value_definition_syntax#single_bar)
rgb( [[](../value_definition_syntax#brackets) [<number>](../number) [|](../value_definition_syntax#single_bar) none []](../value_definition_syntax#brackets)[{3}](../value_definition_syntax#curly_braces) [[](../value_definition_syntax#brackets) / [[](../value_definition_syntax#brackets) <alpha-value> [|](../value_definition_syntax#single_bar) none []](../value_definition_syntax#brackets) []](../value_definition_syntax#brackets)[?](../value_definition_syntax#question_mark) )
<hsl()> =
hsl( [[](../value_definition_syntax#brackets) <hue> [|](../value_definition_syntax#single_bar) none []](../value_definition_syntax#brackets) [[](../value_definition_syntax#brackets) [<percentage>](../percentage) [|](../value_definition_syntax#single_bar) none []](../value_definition_syntax#brackets) [[](../value_definition_syntax#brackets) [<percentage>](../percentage) [|](../value_definition_syntax#single_bar) none []](../value_definition_syntax#brackets) [[](../value_definition_syntax#brackets) / [[](../value_definition_syntax#brackets) <alpha-value> [|](../value_definition_syntax#single_bar) none []](../value_definition_syntax#brackets) []](../value_definition_syntax#brackets)[?](../value_definition_syntax#question_mark) )
<hwb()> =
hwb( [[](../value_definition_syntax#brackets) <hue> [|](../value_definition_syntax#single_bar) none []](../value_definition_syntax#brackets) [[](../value_definition_syntax#brackets) [<percentage>](../percentage) [|](../value_definition_syntax#single_bar) none []](../value_definition_syntax#brackets) [[](../value_definition_syntax#brackets) [<percentage>](../percentage) [|](../value_definition_syntax#single_bar) none []](../value_definition_syntax#brackets) [[](../value_definition_syntax#brackets) / [[](../value_definition_syntax#brackets) <alpha-value> [|](../value_definition_syntax#single_bar) none []](../value_definition_syntax#brackets) []](../value_definition_syntax#brackets)[?](../value_definition_syntax#question_mark) )
<lab()> =
lab( [[](../value_definition_syntax#brackets) [<percentage>](../percentage) [|](../value_definition_syntax#single_bar) [<number>](../number) [|](../value_definition_syntax#single_bar) none []](../value_definition_syntax#brackets) [[](../value_definition_syntax#brackets) [<percentage>](../percentage) [|](../value_definition_syntax#single_bar) [<number>](../number) [|](../value_definition_syntax#single_bar) none []](../value_definition_syntax#brackets) [[](../value_definition_syntax#brackets) [<percentage>](../percentage) [|](../value_definition_syntax#single_bar) [<number>](../number) [|](../value_definition_syntax#single_bar) none []](../value_definition_syntax#brackets) [[](../value_definition_syntax#brackets) / [[](../value_definition_syntax#brackets) <alpha-value> [|](../value_definition_syntax#single_bar) none []](../value_definition_syntax#brackets) []](../value_definition_syntax#brackets)[?](../value_definition_syntax#question_mark) )
<lch()> =
lch( [[](../value_definition_syntax#brackets) [<percentage>](../percentage) [|](../value_definition_syntax#single_bar) [<number>](../number) [|](../value_definition_syntax#single_bar) none []](../value_definition_syntax#brackets) [[](../value_definition_syntax#brackets) [<percentage>](../percentage) [|](../value_definition_syntax#single_bar) [<number>](../number) [|](../value_definition_syntax#single_bar) none []](../value_definition_syntax#brackets) [[](../value_definition_syntax#brackets) <hue> [|](../value_definition_syntax#single_bar) none []](../value_definition_syntax#brackets) [[](../value_definition_syntax#brackets) / [[](../value_definition_syntax#brackets) <alpha-value> [|](../value_definition_syntax#single_bar) none []](../value_definition_syntax#brackets) []](../value_definition_syntax#brackets)[?](../value_definition_syntax#question_mark) )
<oklab()> =
oklab( [[](../value_definition_syntax#brackets) [<percentage>](../percentage) [|](../value_definition_syntax#single_bar) [<number>](../number) [|](../value_definition_syntax#single_bar) none []](../value_definition_syntax#brackets) [[](../value_definition_syntax#brackets) [<percentage>](../percentage) [|](../value_definition_syntax#single_bar) [<number>](../number) [|](../value_definition_syntax#single_bar) none []](../value_definition_syntax#brackets) [[](../value_definition_syntax#brackets) [<percentage>](../percentage) [|](../value_definition_syntax#single_bar) [<number>](../number) [|](../value_definition_syntax#single_bar) none []](../value_definition_syntax#brackets) [[](../value_definition_syntax#brackets) / [[](../value_definition_syntax#brackets) <alpha-value> [|](../value_definition_syntax#single_bar) none []](../value_definition_syntax#brackets) []](../value_definition_syntax#brackets)[?](../value_definition_syntax#question_mark) )
<oklch()> =
oklch( [[](../value_definition_syntax#brackets) [<percentage>](../percentage) [|](../value_definition_syntax#single_bar) [<number>](../number) [|](../value_definition_syntax#single_bar) none []](../value_definition_syntax#brackets) [[](../value_definition_syntax#brackets) [<percentage>](../percentage) [|](../value_definition_syntax#single_bar) [<number>](../number) [|](../value_definition_syntax#single_bar) none []](../value_definition_syntax#brackets) [[](../value_definition_syntax#brackets) <hue> [|](../value_definition_syntax#single_bar) none []](../value_definition_syntax#brackets) [[](../value_definition_syntax#brackets) / [[](../value_definition_syntax#brackets) <alpha-value> [|](../value_definition_syntax#single_bar) none []](../value_definition_syntax#brackets) []](../value_definition_syntax#brackets)[?](../value_definition_syntax#question_mark) )
<color()> =
color( <colorspace-params> [[](../value_definition_syntax#brackets) / [[](../value_definition_syntax#brackets) <alpha-value> [|](../value_definition_syntax#single_bar) none []](../value_definition_syntax#brackets) []](../value_definition_syntax#brackets)[?](../value_definition_syntax#question_mark) )
<alpha-value> =
[<number>](../number) [|](../value_definition_syntax#single_bar)
[<percentage>](../percentage)
<hue> =
[<number>](../number) [|](../value_definition_syntax#single_bar)
[<angle>](../angle)
<colorspace-params> =
<predefined-rgb-params> [|](../value_definition_syntax#single_bar)
<xyz-params>
<predefined-rgb-params> =
<predefined-rgb> [[](../value_definition_syntax#brackets) [<number>](../number) [|](../value_definition_syntax#single_bar) [<percentage>](../percentage) [|](../value_definition_syntax#single_bar) none []](../value_definition_syntax#brackets)[{3}](../value_definition_syntax#curly_braces)
<xyz-params> =
<xyz-space> [[](../value_definition_syntax#brackets) [<number>](../number) [|](../value_definition_syntax#single_bar) [<percentage>](../percentage) [|](../value_definition_syntax#single_bar) none []](../value_definition_syntax#brackets)[{3}](../value_definition_syntax#curly_braces)
<predefined-rgb> =
srgb [|](../value_definition_syntax#single_bar)
srgb-linear [|](../value_definition_syntax#single_bar)
display-p3 [|](../value_definition_syntax#single_bar)
a98-rgb [|](../value_definition_syntax#single_bar)
prophoto-rgb [|](../value_definition_syntax#single_bar)
rec2020
<xyz-space> =
xyz [|](../value_definition_syntax#single_bar)
xyz-d50 [|](../value_definition_syntax#single_bar)
xyz-d65
```
Examples
--------
### Changing colors of emojis
This example shows how to override colors in the [Noto Color Emoji](https://fonts.google.com/noto/specimen/Noto+Color+Emoji/) color font to match your site's brand.
#### HTML
```
<section class="hats">
<div class="hat">
<h2>Original Hat</h2>
<div class="emoji">🎩</div>
</div>
<div class="hat">
<h2>Red Hat</h2>
<div class="emoji red-hat">🎩</div>
</div>
</section>
```
#### CSS
```
@font-face {
font-family: "Noto Color Emoji";
font-style: normal;
font-weight: 400;
src: url(https://fonts.gstatic.com/l/font?kit=Yq6P-KqIXTD0t4D9z1ESnKM3-HpFabts6diywYkdG3gjD0U&skey=a373f7129eaba270&v=v24) format("woff2");
}
.emoji {
font-family: "Noto Color Emoji";
font-size: 3rem;
}
@font-palette-values --red {
font-family: "Noto Color Emoji";
override-colors:
0 rgb(74, 11, 0),
1 rgb(149, 22, 1),
2 rgb(183, 27, 1),
3 rgb(193, 28, 1),
4 rgb(230, 34, 1);
}
.red-hat {
font-palette: --red;
}
```
#### Result
### Changing a color in an alternate base-palette
Using [Rocher Color Font](https://www.harbortype.com/fonts/rocher-color/), this example shows how to override one color in the font.
#### HTML
```
<h2 class="normal-palette">Normal Palette</h2>
<h2 class="override-palette">Override Palette</h2>
```
#### CSS
```
@font-face {
font-family: 'Rocher';
src: url('[path-to-font]/RocherColorGX.woff2') format('woff2');
}
h2 {
font-family: 'Rocher';
}
@font-palette-values --override-palette {
font-family: 'Rocher';
base-palette: 3;
}
@font-palette-values --override-palette {
font-family: 'Rocher';
base-palette: 3;
override-colors: 0 rebeccapurple;
}
.normal-palette {
font-palette: --normal-palette;
}
.override-palette {
font-palette: --override-palette;
}
```
#### Result
This example shows the that in `base-palette` `3`, the color at index 0 is overridden with `rebeccapurple`.
Specifications
--------------
| Specification |
| --- |
| [CSS Fonts Module Level 4 # override-color](https://w3c.github.io/csswg-drafts/css-fonts/#override-color) |
Browser compatibility
---------------------
| | Desktop | Mobile |
| --- | --- | --- |
| | Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet |
| `override-colors` | 101 | 101 | 107 | No | 87 | 15.4 | 101 | 101 | 107 | 70 | 15.4 | 19.0 |
See also
--------
* [`@font-palette-values`](../@font-palette-values)
* [`base-palette`](base-palette)
* [`font-family`](font-family)
* [`font-palette`](../font-palette)
css Applying color to HTML elements using CSS Applying color to HTML elements using CSS
=========================================
This article is a primer introducing each of the ways CSS color can be used in HTML.
The use of color is a fundamental form of human expression. Children experiment with color before they even have the manual dexterity to draw. Maybe that's why color is one of the first things people often want to experiment with when learning to develop websites. With [CSS](https://developer.mozilla.org/en-US/docs/Web/CSS), there are lots of ways to add color to your [HTML](https://developer.mozilla.org/en-US/docs/Web/HTML) [elements](https://developer.mozilla.org/en-US/docs/Web/HTML/Element) to create just the look you want.
We're going to touch on most of what you'll need to know when using color, including a [list of what you can color and what CSS properties are involved](#things_that_can_have_color), [how you describe colors](#how_to_describe_a_color), and how to actually [use colors both in stylesheets and in scripts](#using_color). We'll also take a look at how to [let the user pick a color](#letting_the_user_pick_a_color).
Then we'll wrap things up with a brief discussion of how to [use color wisely](#using_color_wisely): how to select appropriate colors, keeping in mind the needs of people with differing visual capabilities.
Things that can have color
--------------------------
At the element level, everything in HTML can have color applied to it. Instead, let's look at things in terms of the kinds of things that are drawn in the elements, such as text and borders and so forth. For each, we'll see a list of the CSS properties that apply color to them.
At a fundamental level, the [`color`](../color) property defines the foreground color of an HTML element's content and the [`background-color`](../background-color) property defines the element's background color. These can be used on just about any element.
### Text
Whenever an element is rendered, these properties are used to determine the color of the text, its background, and any decorations on the text.
[`color`](../color) The color to use when drawing the text and any [text decorations](https://developer.mozilla.org/en-US/docs/Learn/CSS/Styling_text/Fundamentals#font_style_font_weight_text_transform_and_text_decoration) (such as the addition of under- or overlines, strike-through lines, and so forth.
[`background-color`](../background-color) The text's background color.
[`text-shadow`](../text-shadow) Configures a shadow effect to apply to text. Among the options for the shadow is the shadow's base color (which is then blurred and blended with the background based on the other parameters). See [Text drop shadows](https://developer.mozilla.org/en-US/docs/Learn/CSS/Styling_text/Fundamentals#text_drop_shadows) in [Fundamental text and font styling](https://developer.mozilla.org/en-US/docs/Learn/CSS/Styling_text/Fundamentals) to learn more.
[`text-decoration-color`](../text-decoration-color) By default, text decorations (such as underlines, strikethroughs, etc.) use the `color` property as their colors. However, you can override that behavior and use a different color for them with the `text-decoration-color` property.
[`text-emphasis-color`](../text-emphasis-color) The color to use when drawing emphasis symbols adjacent to each character in the text. This is used primarily when drawing text for East Asian languages.
[`caret-color`](../caret-color) The color to use when drawing the [caret](https://developer.mozilla.org/en-US/docs/Glossary/Caret) (sometimes referred to as the text input cursor) within the element. This is only useful in elements that are editable, such as [`<input>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input) and [`<textarea>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/textarea) or elements whose HTML [`contenteditable`](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes#contenteditable) attribute is set.
### Boxes
Every element is a box with some sort of content, and has a background and a border in addition to whatever contents the box may have.
[Borders](#borders) See the section [Borders](#borders) for a list of the CSS properties you can use to set the colors of a box's borders.
[`background-color`](../background-color) The background color to use in areas of the element that have no foreground content.
[`column-rule-color`](../column-rule-color) The color to use when drawing the line separating columns of text.
[`outline-color`](../outline-color) The color to use when drawing an outline around the outside of the element. This outline is different from the border in that it doesn't get space set aside for it in the document (so it may overlap other content). It's generally used as a focus indicator, to show which element will receive input events.
### Borders
Any element can have a [border](https://developer.mozilla.org/en-US/docs/Learn/CSS/Building_blocks/Backgrounds_and_borders) drawn around it. A basic element border is a line drawn around the edges of the element's content. See [Box properties](https://developer.mozilla.org/en-US/docs/Learn/CSS/Building_blocks/The_box_model#box_properties) in [The box model](https://developer.mozilla.org/en-US/docs/Learn/CSS/Building_blocks/The_box_model) to learn about the relationship between elements and their borders, and the article [Styling borders using CSS](https://developer.mozilla.org/en-US/docs/Learn/CSS/Building_blocks/Backgrounds_and_borders) to learn more about applying styles to borders.
You can use the [`border`](../border) shorthand property, which lets you configure everything about the border in one shot (including non-color features of borders, such as its [width](../border-width), [style](../border-style) (solid, dashed, etc.), and so forth.
[`border-color`](../border-color) Specifies a single color to use for every side of the element's border.
[`border-left-color`](../border-left-color), [`border-right-color`](../border-right-color), [`border-top-color`](../border-top-color), and [`border-bottom-color`](../border-bottom-color)
Lets you set the color of the corresponding side of the element's border.
[`border-block-start-color`](../border-block-start-color) and [`border-block-end-color`](../border-block-end-color)
With these, you can set the color used to draw the borders which are closest to the start and end of the block the border surrounds. In a left-to-right writing mode (such as the way English is written), the block start border is the top edge and the block end is the bottom. This differs from the inline start and end, which are the left and right edges (corresponding to where each line of text in the box begins and ends).
[`border-inline-start-color`](../border-inline-start-color) and [`border-inline-end-color`](../border-inline-end-color)
These let you color the edges of the border closest to the beginning and the end of the start of lines of text within the box. Which side this is will vary depending on the [`writing-mode`](../writing-mode), [`direction`](../direction), and [`text-orientation`](../text-orientation) properties, which are typically (but not always) used to adjust text directionality based on the language being displayed. For example, if the box's text is being rendered right-to-left, then the `border-inline-start-color` is applied to the right side of the border.
### Other ways to use color
CSS isn't the only web technology that supports color. There are graphics technologies that are available on the web which also support color.
The HTML [Canvas API](https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API)
Lets you draw 2D bitmapped graphics in a [`<canvas>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/canvas) element. See our [Canvas tutorial](https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API/Tutorial) to learn more.
[SVG](https://developer.mozilla.org/en-US/docs/Web/SVG) (Scalable Vector Graphics) Lets you draw images using commands that draw specific shapes, patterns, and lines to produce an image. SVG commands are formatted as XML, and can be embedded directly into a web page or can be placed in the page using the [`<img>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img) element, just like any other type of image.
[WebGL](https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API) The Web Graphics Library is an OpenGL ES-based API for drawing high-performance 2D and 3D graphics on the Web. See our [WebGL tutorial](https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API/Tutorial) to find out more.
How to describe a color
-----------------------
In order to represent a color in CSS, you have to find a way to translate the analog concept of "color" into a digital form that a computer can use. This is typically done by breaking down the color into components, such as how much of each of a set of primary colors to mix together, or how bright to make the color. As such, there are several ways you can describe color in CSS.
For more detailed discussion of each of the color value types, see the reference for the CSS [`<color>`](../color_value) unit.
### Keywords
A set of standard color names have been defined, letting you use these keywords instead of numeric representations of colors if you choose to do so and there's a keyword representing the exact color you want to use. Color keywords include the standard primary and secondary colors (such as `red`, `blue`, or `orange`), shades of gray (from `black` to `white`, including colors like `darkgray` and `lightgrey`), and a variety of other blended colors including `lightseagreen`, `cornflowerblue`, and `rebeccapurple`.
See [Color keywords](../color_value#color_keywords) in [`<color>`](../color_value) for a list of all available color keywords.
### RGB values
There are three ways to represent an RGB color in CSS.
#### Hexadecimal string notation
Hexadecimal string notation represents a color using hexadecimal digits to represent each of the color components (red, green, and blue). It may also include a fourth component: the alpha channel (or opacity). Each color component can be represented as a number between 0 and 255 (0x00 and 0xFF) or, optionally, as a number between 0 and 15 (0x0 and 0xF). All components *must* be specified using the same number of digits. If you use the single-digit notation, the final color is computed by using each component's digit twice; that is, `"#D"` becomes `"#DD"` when drawing.
A color in hexadecimal string notation always begins with the character `"#"`. After that come the hexadecimal digits of the color code. The string is case-insensitive.
`"#rrggbb"` Specifies a fully-opaque color whose red component is the hexadecimal number `0xrr`, green component is `0xgg`, and blue component is `0xbb`.
`"#rrggbbaa"` Specifies a color whose red component is the hexadecimal number `0xrr`, green component is `0xgg`, and blue component is `0xbb`. The alpha channel is specified by `0xaa`; the lower this value is, the more translucent the color becomes.
`"#rgb"` Specifies a color whose red component is the hexadecimal number `0xrr`, green component is `0xgg`, and blue component is `0xbb`.
`"#rgba"` Specifies a color whose red component is the hexadecimal number `0xrr`, green component is `0xgg`, and blue component is `0xbb`. The alpha channel is specified by `0xaa`; the lower this value is, the more translucent the color becomes.
As an example, you can represent the opaque color bright blue as `"#0000ff"` or `"#00f"`. To make it 25% opaque, you can use `"#0000ff44"` or `"#00f4"`.
#### RGB functional notation
RGB (Red/Green/Blue) functional notation, like hexadecimal string notation, represents colors using their red, green, and blue components (as well as, optionally, an alpha channel component for opacity). However, instead of using a string, the color is defined using the CSS function [`rgb()`](../color_value#rgb()). This function accepts as its input parameters the values of the red, green, and blue components and an optional fourth parameter, the value for the alpha channel.
Legal values for each of these parameters are:
`red`, `green`, and `blue`
Each must be an [`<integer>`](../integer) value between 0 and 255 (inclusive), or a [`<percentage>`](../percentage) from 0% to 100%.
`alpha` The alpha channel is a number between 0.0 (fully transparent) and 1.0 (fully opaque). You can also specify a percentage where 0% is the same as 0.0 and 100% is the same as 1.0.
For example, a bright red that's 50% opaque can be represented as `rgb(255, 0, 0, 0.5)` or `rgb(100%, 0, 0, 50%)`.
### HSL functional notation
Designers and artists often prefer to work using the [HSL](https://en.wikipedia.org/wiki/HSL_and_HSV) (Hue/Saturation/Luminosity) color method. On the web, HSL colors are represented using HSL functional notation. The `hsl()` CSS function is very similar to the `rgb()` function in usage otherwise.
The diagram below shows an HSL color cylinder. Hue defines the actual color based on the position along a circular [color wheel](https://developer.mozilla.org/en-US/docs/Glossary/Color_wheel) representing the colors of the visible spectrum. Saturation is a percentage of how much of the way between being a shade of gray and having the maximum possible amount of the given hue. As the value of luminance (or lightness) increases, the color transitions from the darkest possible to the brightest possible (from black to white). Image courtesy of user [SharkD](https://commons.wikimedia.org/wiki/User:SharkD) on [Wikipedia](https://en.wikipedia.org/), distributed under the [CC BY-SA 3.0](https://creativecommons.org/licenses/by-sa/3.0/) license.
The value of the hue (H) component of an HSL color is an angle from red around through yellow, green, cyan, blue, and magenta (ending up back at red again at 360°) that identifies what the base color is. The value can be specified in any [`<angle>`](../angle) unit supported by CSS, including degrees (`deg`), radians (`rad`), gradians (`grad`), or turns (`turn`). But this doesn't control how vivid or dull, or how bright or dark the color is.
The saturation (S) component of the color specifies what percentage of the final color is comprised of the specified hue. The rest is defined by the grey level provided by the luminance (L) component.
Think of it like creating the perfect paint color:
1. You start with base paint that's the maximum intensity possible for a given color, such as the most intense blue that can be represented by the user's screen. This is the **hue** (H) component: a value representing the angle around the [color wheel](https://developer.mozilla.org/en-US/docs/Glossary/Color_wheel) for the vivid hue we want to use as our base.
2. Then select a greyscale paint that corresponds how bright you want the color to be; this is the luminance. Do you want it to be very bright and nearly white, or very dark and closer to black, or somewhere in between? This is specified using a percentage, where 0% is perfectly black and 100% is perfectly white (regardless of the saturation or hue). In between values are a literal grey area.
3. Now that you have a grey paint and a perfectly vivid color, you need to mix them together. The saturation (S) component of the color indicates what percentage of the final color should be comprised of that perfectly vivid color. The rest of the final color is made up of the grey paint that represents the saturation.
You can also optionally include an alpha channel, to make the color less than 100% opaque.
Here are some sample colors in HSL notation:
```
<table>
<thead>
<tr>
<th scope="col">Color in HSL notation</th>
<th scope="col">Example</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>hsl(90deg, 100%, 50%)</code></td>
<td style="background-color: hsl(90deg, 100%, 50%);"> </td>
</tr>
<tr>
<td><code>hsl(90, 100%, 50%)</code></td>
<td style="background-color: hsl(90, 100%, 50%);"> </td>
</tr>
<tr>
<td><code>hsl(0.15turn, 50%, 75%)</code></td>
<td style="background-color: hsl(0.15turn, 50%, 75%);"> </td>
</tr>
<tr>
<td><code>hsl(0.15turn, 90%, 75%)</code></td>
<td style="background-color: hsl(0.15turn, 90%, 75%);"> </td>
</tr>
<tr>
<td><code>hsl(0.15turn, 90%, 50%)</code></td>
<td style="background-color: hsl(0.15turn, 90%, 50%);"> </td>
</tr>
<tr>
<td><code>hsl(270deg, 90%, 50%)</code></td>
<td style="background-color: hsl(270deg, 90%, 50%);"> </td>
</tr>
</tbody>
</table>
```
**Note:** When you omit the hue's unit, it's assumed to be in degrees (`deg`).
### HWB functional notation
Much like the HSL functional notation above, the [hwb()](../color_value/hwb) function uses the same hue value. But instead of lightness and saturation you specify whiteness and blackness values in percentages. Values are **not** separated with a comma and an optional alpha value can be included (it must be preceded by a forward slash `/`).
Here are some examples of using HWB notation:
```
/\* These examples all specify varying shades of a lime green. \*/
hwb(90 10% 10%)
hwb(90 10% 10%)
hwb(90 50% 10%)
hwb(90deg 10% 10%)
hwb(1.5708rad 60% 0%)
hwb(.25turn 0% 40%)
/\* Same lime green but with an alpha value \*/
hwb(90 10% 10% / 0.5)
hwb(90 10% 10% / 50%)
```
Using color
-----------
Now that you know what CSS properties exist that let you apply color to elements and the formats you can use to describe colors, you can put this together to begin to make use of color. As you may have seen from the list under [Things that can have color](#things_that_can_have_color), there are plenty of things you can color with CSS. Let's look at this from two sides: using color within a [stylesheet](https://developer.mozilla.org/en-US/docs/Glossary/Stylesheet), and adding and changing color using [JavaScript](https://developer.mozilla.org/en-US/docs/Glossary/JavaScript) code to alter the styles of elements.
### Specifying colors in stylesheets
The easiest way to apply color to elements—and the way you'll usually do it—is to specify colors in the CSS that's used when rendering elements. While we won't use every single property mentioned previously, we'll look at a couple of examples. The concept is the same anywhere you use color.
Let's take a look at an example, starting by looking at the results we're trying to achieve:
#### HTML
The HTML responsible for creating the above example is shown here:
```
<div class="wrapper">
<div class="box boxLeft">
<p>This is the first box.</p>
</div>
<div class="box boxRight">
<p>This is the second box.</p>
</div>
</div>
```
This is pretty simple, using a [`<div>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/div) as a wrapper around the contents, which consists of two more `<div>`s, each styled differently with a single paragraph ([`<p>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/p)) in each box.
The magic happens, as usual, in the CSS, where we'll apply colors define the layout for the HTML above.
#### CSS
We'll look at the CSS to create the above results a piece at a time, so we can review the interesting parts one by one.
```
.wrapper {
width: 620px;
height: 110px;
margin: 0;
padding: 10px;
border: 6px solid mediumturquoise;
}
```
The `.wrapper` class is used to assign styles to the [`<div>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/div) that encloses all of our other content. This establishes the size of the container using [`width`](../width) and [`height`](../height) as well as its [`margin`](../margin) and [`padding`](../padding).
Of more interest to our discussion here is the use of the [`border`](../border) property to establish a border around the outside edge of the element. This border is a solid line, 6 pixels wide, in the color `mediumturquoise`.
Our two colored boxes share a number of properties in common, so next we establish a class, `.box`, that defines those shared properties:
```
.box {
width: 290px;
height: 100px;
margin: 0;
padding: 4px 6px;
font: 28px "Marker Felt", "Zapfino", cursive;
display: flex;
justify-content: center;
align-items: center;
}
```
In brief, `.box` establishes the size of each box, as well as the configuration of the font used within. We also take advantage of [CSS Flexbox](../css_flexible_box_layout) to easily center the contents of each box. We enable `flex` mode using [`display: flex`](../display), and set both [`justify-content`](../justify-content) and [`align-items`](../align-items) to `center`. Then we can create a class for each of the two boxes that defines the properties that differ between the two.
```
.boxLeft {
float: left;
background-color: rgb(245, 130, 130);
outline: 2px solid darkred;
}
```
The `.boxLeft` class—which, cleverly, is used to style the box on the left—floats the box to the left, then sets up the colors:
* The box's background color is set by changing the value of the CSS [`background-color`](../background-color) property to `rgb(245, 130, 130)`.
* An outline is defined for the box. Unlike the more commonly used `border`, [`outline`](../outline) doesn't affect layout at all; it draws over the top of whatever may happen to be outside the element's box instead of making room as `border` does. This outline is a solid, dark red line that's two pixels thick. Note the use of the `darkred` keyword when specifying the color.
* Notice that we're not explicitly setting the text color. That means the value of [`color`](../color) will be inherited from the nearest containing element that defines it. By default, that's black.
```
.boxRight {
float: right;
background-color: hsl(270deg, 50%, 75%);
outline: 4px dashed rgb(110, 20, 120);
color: hsl(0deg, 100%, 100%);
text-decoration: underline wavy #88ff88;
text-shadow: 2px 2px 3px black;
}
```
**Note:** When you try to show it in Safari, it will not show properly. Because Safari doesn't support `text-decoration: underline wavy #88ff88`.
Finally, the `.boxRight` class describes the unique properties of the box that's drawn on the right. It's configured to float the box to the right so that it appears next to the previous box. Then the following colors are established:
* The `background-color` is set using the HSL value specified using `hsl(270deg, 50%, 75%)`. This is a medium purple color.
* The box's `outline` is used to specify that the box should be enclosed in a four pixel thick dashed line whose color is a somewhat deeper purple (`rgb(110, 20, 120)`).
* The foreground (text) color is specified by setting the [`color`](../color) property to `hsl(0deg, 100%, 100%)`. This is one of many ways to specify the color white.
* We add a green wavy line under the text with [`text-decoration`](../text-decoration).
* Finally, a bit of a shadow is added to the text using [`text-shadow`](../text-shadow). Its `color` parameter is set to `black`.
Letting the user pick a color
-----------------------------
There are many situations in which your website may need to let the user select a color. Perhaps you have a customizable user interface, or you're implementing a drawing app. Maybe you have editable text and need to let the user choose the text color. Or perhaps your app lets the user assign colors to folders or items. Although historically it's been necessary to implement your own [color picker](https://en.wikipedia.org/wiki/Color_picker), HTML now provides support for browsers to provide one for your use through the [`<input>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input) element, by using `"color"` as the value of its [`type`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-type) attribute.
The `<input>` element represents a color only in the [hexadecimal string notation](#hexadecimal_string_notation) covered above.
### Example: Picking a color
Let's look at a simple example, in which the user can choose a color. As the user adjusts the color, the border around the example changes to reflect the new color. After finishing up and picking the final color, the color picker's value is displayed.
**Note:** On macOS, you indicate that you've finalized selection of the color by closing the color picker window.
#### HTML
The HTML here creates a box that contains a color picker control (with a label created using the [`<label>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/label) element) and an empty paragraph element ([`<p>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/p)) into which we'll output some text from our JavaScript code.
```
<div id="box">
<label for="colorPicker">Border color:</label>
<input type="color" value="#8888ff" id="colorPicker" />
<p id="output"></p>
</div>
```
#### CSS
The CSS establishes a size for the box and some basic styling for appearances. The border is also established with a 2-pixel width and a border color.
```
#box {
width: 500px;
height: 200px;
border: 2px solid rgb(245, 220, 225);
padding: 4px 6px;
font: 16px "Lucida Grande", "Helvetica", "Arial", "sans-serif";
}
```
#### JavaScript
The script here handles the task of updating the starting color of the border to match the color picker's value. Then two event handlers are added to deal with input from the [`<input type="color">`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/color) element.
```
const colorPicker = document.getElementById("colorPicker");
const box = document.getElementById("box");
const output = document.getElementById("output");
box.style.borderColor = colorPicker.value;
colorPicker.addEventListener("input", (event) => {
box.style.borderColor = event.target.value;
}, false);
colorPicker.addEventListener("change", (event) => {
output.innerText = `Color set to ${colorPicker.value}.`;
}, false);
```
The [`input`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event) event is sent every time the value of the element changes; that is, every time the user adjusts the color in the color picker. Each time this event arrives, we set the box's border color to match the color picker's current value.
The [`change`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event) event is received when the color picker's value is finalized. We respond by setting the contents of the `<p>` element with the ID `"output"` to a string describing the finally selected color.
Using color wisely
------------------
Making the right choices when selecting colors when designing a website can be a tricky process, especially if you aren't well-grounded in art, design, or at least basic color theory. The wrong color choice can render your site unattractive, or even worse, leave the content unreadable due to problems with contrast or conflicting colors. Worse still, if using the wrong colors can result in your content being outright unusable by people with certain vision problems, particularly color blindness.
### Finding the right colors
Coming up with just the right colors can be tricky, especially without training in art or design. Fortunately, there are tools available that can help you. While they can't replace having a good designer helping you make these decisions, they can definitely get you started.
#### Base color
The first step is to choose your **base color**. This is the color that in some way defines your website or the subject matter of the site. Just as we associate green with the beverage [Mountain Dew](https://en.wikipedia.org/wiki/Mountain_Dew) and one might think of the color blue in relationship with the sky or the ocean, choosing an appropriate base color to represent your site is a good place to start. There are plenty of ways to select a base color; a few ideas include:
* A color that is naturally associated with the topic of your content, such as the existing color identified with a product or idea or a color representative of the emotion you wish to convey.
* A color that comes from imagery associated with what your content is about. If you're creating a website about a given item or product, choose a color that's physically present on that item.
* Browse websites that let you look at lots of existing color palettes and images to find inspiration.
When trying to decide upon a base color, you may find that browser extensions that let you select colors from web content can be particularly handy. Some of these are even specifically designed to help with this sort of work. For example, the website [ColorZilla](https://www.colorzilla.com/) offers an extension ([Chrome](https://www.colorzilla.com/chrome/) / [Firefox](https://www.colorzilla.com/firefox/)) that offers an eyedropper tool for picking colors from the web. It can also take averages of the colors of pixels in various sized areas or even a selected area of the page.
**Note:** The advantage to averaging colors can be that often what looks like a solid color is actually a surprisingly varied number of related colors all used in concert, blending to create a desired effect. Picking just one of these pixels can result in getting a color that on its own looks very out of place.
#### Fleshing out the palette
Once you have decided on your base color, there are plenty of online tools that can help you build out a palette of appropriate colors to use along with your base color by applying color theory to your base color to determine appropriate added colors. Many of these tools also support viewing the colors filtered so you can see what they would look like to people with various forms of color blindness. See [Color and accessibility](#color_and_accessibility) for a brief explanation of why this matters.
A few examples (all free to use as of the time this list was last revised):
* [MDN's color picker tool](color_picker_tool)
* [Paletton](https://paletton.com/)
* [Adobe Color CC online color wheel](https://color.adobe.com/create/color-wheel)
When designing your palette, be sure to keep in mind that in addition to the colors these tools typically generate, you'll probably also need to add some core neutral colors such as white (or nearly white), black (or nearly black), and some number of shades of gray.
**Note:** Usually, you are far better off using the smallest number of colors possible. By using color to accentuate rather than adding color to everything on the page, you keep your content easy to read and the colors you do use have far more impact.
### Color theory resources
A full review of color theory is beyond the scope of this article, but there are plenty of articles about color theory available, as well as courses you can find at nearby schools and universities. A couple of useful resources about color theory:
[Color Science](https://www.khanacademy.org/computing/pixar/color) ([Khan Academy](https://www.khanacademy.org/) in association with [Pixar](https://www.pixar.com/)) An online course which introduces concepts such as what color is, how it's perceived, and how to use colors to express ideas. Presented by Pixar artists and designers.
[Color theory](https://en.wikipedia.org/wiki/Color_theory) on Wikipedia Wikipedia's entry on color theory, which has a lot of great information from a technical perspective. It's not really a resource for helping you with the color selection process, but is still full of useful information.
### Color and accessibility
There are several ways color can be an [accessibility](https://developer.mozilla.org/en-US/docs/Glossary/Accessibility) problem. Improper or careless use of color can result in a website or app that a percentage of your target audience may not be able to use adequately, resulting in lost traffic, lost business, and possibly even a public relations problem. So it's important to consider your use of color carefully.
You should do at least basic research into [color blindness](https://en.wikipedia.org/wiki/Color_blindness). There are several kinds; the most common is red-green color blindness, which causes people to be unable to differentiate between the colors red and green. There are others, too, ranging from inabilities to tell the difference between certain colors to total inability to see color at all.
**Note:** The most important rule: never use color as the only way to know something. If, for example, you indicate success or failure of an operation by changing the color of a shape from white to green for success and red for failure, users with red-green color-blindness won't be able to use your site properly. Instead, perhaps use both text and color together, so that everyone can understand what's happening.
For more information about color blindness, see the following articles:
* [Medline Plus: Color Blindness](https://medlineplus.gov/colorblindness.html) (United States National Institute of Health)
* [American Academy of Ophthalmology: What Is Color Blindness?](https://www.aao.org/eye-health/diseases/what-is-color-blindness)
* [Color Blindness & Web Design](https://www.usability.gov/get-involved/blog/2010/02/color-blindness.html) (Usability.gov: United States Department of Health and Human Services)
### Palette design example
Let's consider a quick example of selecting an appropriate color palette for a site. Imagine that you're building a website for a new game that takes place on the planet Mars. So let's do a [Google search for photos of Mars](https://www.google.com/search?q=Mars&tbm=isch). Lots of good examples of Martian coloration there. We carefully avoid the mockups and the photos from movies. And we decide to use a photo taken by one of the Mars landers humanity has parked on the surface over the last few decades, since the game takes place on the planet's surface. We use a color picker tool to select a sample of the color we choose.
Using an eyedropper tool, we identify a color we like and determine that the color in question is `#D79C7A`, which is an appropriate rusty orange-red color that's so stereotypical of the Martian surface.
Having selected our base color, we need to build out our palette. We decide to use [Paletton](https://www.paletton.com/) to come up with the other colors we need. Upon opening Paletton, we see:
Next, we enter our color's hex code (`D79C7A`) into the "Base RGB" box at the bottom-left corner of the tool:
We now see a monochromatic palette based on the color we picked from the Mars photo. If you need a lot of related colors for some reason, those are likely to be good ones. But what we really want is an accent color. Something that will pop along side the base color. To find that, we click the "add complementary" toggle underneath the menu that lets you select the palette type (currently "Monochromatic"). Paletton computes an appropriate accent color; clicking on the accent color down in the bottom-right corner tells us that this color is `#508D7C`.
If you're unhappy with the color that's proposed to you, you can change the color scheme, to see if you find something you like better. For example, if we don't like the proposed greenish-blue color, we can click the Triad color scheme icon, which presents us with the following:
That greyish blue in the top-right looks pretty good. Clicking on it, we find that it's `#556E8D`. That would be used as the accent color, to be used sparingly to make things stand out, such as in headlines or in the highlighting of tabs or other indicators on the site:
Now we have our base color and our accent. On top of that, we have a few complementary shades of each, just in case we need them for gradients and the like. The colors can then be exported in a number of formats so you can make use of them.
Once you have these colors, you will probably still need to select appropriate neutral colors. Common design practice is to try to find the sweet spot where there's just enough contrast that the text is crisp and readable but not enough contrast to become harsh for the eyes. It's easy to go too far in one way or another so be sure to get feedback on your colors once you've selected them and have examples of them in use available. If the contrast is too low, your text will tend to be washed out by the background, leaving it unreadable, but if your contrast is too high, the user may find your site garish and unpleasant to look at.
### Color, backgrounds, contrast, and printing
What looks good on screen may look very different on paper. In addition, ink can be expensive, and if a user is printing your page, they don't necessarily need all the backgrounds and such using up their precious ink when all that matters is the text itself. Most browsers, by default, remove background images when printing documents.
If your background colors and images have been selected carefully and/or are crucial to the usefulness of the content, you can use the CSS [`print-color-adjust`](../print-color-adjust) property to tell the browser that it should not make adjustments to the appearance of content.
The default value of `print-color-adjust`, `economy`, indicates that the browser is allowed to make appearance changes as it deems necessary in order to try to optimize the legibility and/or print economy of the content, given the type of output device the document is being drawn onto.
You can set `print-color-adjust` to `exact` to tell the browser that the element or elements on which you use it have been designed specifically to best work with the colors and images left as they are. With this set, the browser won't tamper with the appearance of the element, and will draw it as indicated by your CSS.
**Note:** There is no guarantee, though, that `print-color-adjust: exact` will result in your CSS being used exactly as given. If the browser provides user preferences to change the output (such as a "don't print backgrounds" checkbox in a print dialog box), that overrides the value of `print-color-adjust`.
See also
--------
* [Drawing graphics](https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Client-side_web_APIs/Drawing_graphics)
* [Graphics on the web](https://developer.mozilla.org/en-US/docs/Web/Guide/Graphics)
* [MDN's color picker tool](color_picker_tool)
| programming_docs |
css Color picker tool Color picker tool
=================
This tool makes it easy to create, adjust, and experiment with custom colors for the web. It also makes it easy to convert between various [color formats](../color_value) supported by [CSS](https://developer.mozilla.org/en-US/docs/Web/CSS), including: HEXA colors, RGB (Red/Green/Blue) and HSL (Hue/Saturation/Lightness). Control over the alpha channel is also supported.
As you adjust the parameters that define the color, it gets displayed in all three standard Web CSS formats. In addition, based on the currently-selected color, a palette for HSL and HSV, as well as alpha, is generated. The "eyedropper" style color picker box can be toggled between HSL or HSV format. You can also test colors and how they overlap one another by dragging them into the box at the bottom of the tool and moving them over one another. Adjust their relative Z index values to move them forward and behind one another.
This tool will help you identify the perfect CSS colors to apply to your [HTML](https://developer.mozilla.org/en-US/docs/Web/HTML).
The generated colors you create above can be used anywhere color is used in CSS and HTML, unless otherwise noted.
See also
--------
For more on using color, see:
* [Applying color to HTML elements using CSS](applying_color)
* [Fundamental text and font styling](https://developer.mozilla.org/en-US/docs/Learn/CSS/Styling_text/Fundamentals)
* [Styling borders using CSS](https://developer.mozilla.org/en-US/docs/Learn/CSS/Building_blocks/Backgrounds_and_borders)
* [Changing background styles using CSS](https://developer.mozilla.org/en-US/docs/Learn/CSS/Building_blocks/Backgrounds_and_borders)
* [Color and color contrast](https://developer.mozilla.org/en-US/docs/Learn/Accessibility/CSS_and_JavaScript#color_and_color_contrast)
css Variable fonts guide Variable fonts guide
====================
**Variable fonts** are an evolution of the OpenType font specification that enables many different variations of a typeface to be incorporated into a single file, rather than having a separate font file for every width, weight, or style. They let you access all the variations contained in a given font file via CSS and a single [`@font-face`](../@font-face) reference. This article will give you all you need to know to get you started using variable fonts.
**Note:** To use variable fonts on your operating system, you need to make sure that it is up to date. For example, Linux OSes need the latest Linux Freetype version, and macOS prior to High Sierra (10.13) does not support variable fonts. If your operating system is not up to date, you will not be able to use variable fonts in web pages or the Firefox Developer Tools.
Variable Fonts: what they are, and how they differ
--------------------------------------------------
To better understand what's different about variable fonts, it is worth reviewing what non-variable ones are like and how they compare.
### Standard (or Static) fonts
In the past, a typeface would be produced as several individual fonts, and each font would represent one specific width/weight/style combination. So you would have separate files for 'Roboto Regular', 'Roboto Bold', and 'Roboto Bold Italic' — meaning that you could end up with 20 or 30 different font files to represent a complete typeface (it could be several times that for a large typeface that has different widths as well).
In such a scenario, to use a typeface for typical use on a site for body copy you would need at least four files: regular, italic, bold, and bold italic. If you wanted to add more weights, like a lighter one for captions or a heavier one for extra emphasis, that would mean several more files. This results in more HTTP requests, and more data being downloaded (usually around 20k or more per file).
### Variable fonts
With a variable font, all of those permutations can be contained in a single file. That file would be larger than a single font, but in most cases smaller or about the same size as the 4 you might load for body copy. The advantage in choosing the variable font is that you have access to the entire range of weights, widths, and styles available, rather than being constrained to only the few that you previously would have loaded separately.
This allows for common typographic techniques such as setting different size headings in different weights for better readability at each size or using a slightly narrower width for data-dense displays. For comparison, it is typical in a typographic system for a magazine to use 10–15 or more different weight and width combinations throughout the publication — giving a much wider range of styles than currently typical on the web (or indeed practical for performance reasons alone).
#### A note about font families, weights, and variants
You might notice that we have been talking about having a specific font file for every weight and style (i.e. bold and italic and bold italic), rather than relying upon the browser to synthesize them. The reason for this is that most typefaces have very specific designs for bolder weights and italics that often include completely different characters (lower-case 'a' and 'g's are often quite different in italics, for example). To most accurately reflect the typeface design and avoid differences between browsers and how they may or may not synthesize the different styles, it's more accurate to load the specific font files where needed when using a non-variable font.
You may also find that some variable fonts come split into two files: one for uprights and all their variations, and one containing the italic variations. This is sometimes done to reduce the overall file size in cases where the italics aren't needed or used. In all cases, it is still possible to link them with a common [`font-family`](../font-family) name so you can call them using the same `font-family` and appropriate [`font-style`](../font-style).
Introducing the 'variation axis'
--------------------------------
The heart of the new variable fonts format is the concept of an **axis of variation** describing the allowable range of that particular aspect of the typeface design. So the 'weight axis' describes how light or how bold the letterforms can be; the 'width axis' describes how narrow or how wide they can be; the 'italic axis' describes if italic letterforms are present and can be turned on or off accordingly, etc. Note that an axis can be a range or a binary choice. Weight might range from 1–999, whereas italic might be 0 or 1 (off or on).
As defined in the specification, there are two kinds of axes: **registered** and **custom**:
* Registered axes are those that are most frequently encountered, and common enough that the authors of the specification felt it was worth standardizing. The five currently registered axes are weight, width, slant, italic, and optical size. The W3C has undertaken to map them to existing CSS attributes, and in one case introduced a new one, which you'll see below.
* Custom axes are limitless: the typeface designer can define and scope any axis they like and are just required to give it a four-letter **tag** to identify it within the font file format itself. You can use these four-letter tags in CSS to specify a point along that axis of variation, as will be shown in the code examples below.
### Registered axes and existing CSS attributes
In this section we'll demonstrate the five registered axes defined with examples and the corresponding CSS. Where possible, both the standard and lower-level syntax are included. The lower-level syntax ([`font-variation-settings`](../font-variation-settings)) was the first mechanism implemented to test the early implementations of variable font support and is necessary to utilize new or custom axes beyond the five registered ones. However, the W3C's intent was for this syntax not to be used when other attributes are available. Therefore wherever possible, the appropriate property should be used, with the lower-level syntax of `font-variation-settings` only being used to set values or axes not available otherwise.
#### Notes
1. When using `font-variation-settings` it is important to note that axis names are case-sensitive. The registered axis names must be in lower case, and custom axes must be in upper case. For example:
```
font-variation-settings: "wght" 375, "GRAD" 88;
```
`wght` (weight) is a registered axis, and `GRAD` (grade) is a custom one.
2. If you have set values using `font-variation-settings` and want to change one of those values, you must redeclare all of them (in the same way as when you set OpenType font features using [`font-feature-settings`](../font-feature-settings)). You can work around this limitation by using [CSS Custom Properties](../using_css_custom_properties) (CSS variables) for the individual values, and modifying the value of an individual custom property. Example code follows at the end of the guide.
### Weight
Weight (represented by the `wght` tag) defines the design axis of how thin or thick (light or heavy, in typical typographic terms) the strokes of the letterforms can be. For a long time in CSS there has existed the ability to specify this via the [`font-weight`](../font-weight) property, which takes numeric values ranging from 100 to 900 in increments of 100, and keywords like `normal` or `bold`, which are aliases for their corresponding numeric values (400 and 700 in this case). These are still applied when dealing with non-variable or variable fonts, but with variable ones, any number from 1 to 1000 is now valid.
It should be noted that at this point there is no way in the `@font-face` declaration to 'map' a specific point on the variation axis of a variable font to the keyword `bold` (or any other keyword). This can generally be resolved fairly easily, but does require an extra step in writing your CSS:
```
font-weight: 375;
font-variation-settings: "wght" 375;
```
The following live example's CSS can be edited to allow you to play with font-weight values.
### Width
Width (represented by the `wdth` tag) defines the design axis of how narrow or wide (condensed or extended, in typographic terms) the letterforms can be. This is typically set in CSS using the [`font-stretch`](../font-stretch) property, with values expressed as a percentage above or below 'normal' (100%), any number greater than 0 is technically valid—though it is far more likely that the range would fall closer to the 100% mark, such as 75%-125%. If a number value supplied is outside the range encoded in the font, the browser should render the font at the closest value allowed.
**Note:** The % symbol is not used when utilizing `font-variation-settings`.
```
font-stretch: 115%;
font-variation-settings: "wdth" 115;
```
The following live example's CSS can be edited to allow you to play with font width values.
### Italic
The Italic (`ital`) axis works differently in that it is either on or off; there is no in-between. Italic designs often include dramatically different letterforms from their upright counterparts, so in the transition from upright to italic, several glyph (or character) substitutions usually occur. Italic and oblique are often used somewhat interchangeably, but in truth are quite different. Oblique is defined in this context with the term `slant` (see the below section), and a typeface would typically have one or the other, but not both.
In CSS, both italic and oblique are applied to text using the [`font-style`](../font-style) property. Also note the introduction of `font-synthesis: none;` — which will prevent browsers from accidentally applying the variation axis and a synthesized italic. This can be used to prevent faux-bolding as well.
```
font-style: italic;
font-variation-settings: "ital" 1;
font-synthesis: none;
```
The following live example's CSS can be edited to allow you to play with font italics.
### Slant
Slant (represented by the `slnt` tag), or as it's often referred to, 'oblique' — is different from true italics in that it changes the angle of the letterforms but doesn't perform any kind of character substitution. It is also variable, in that it is expressed as a numeric range. This allows the font to be varied anywhere along that axis. The allowed range is generally 0 (upright) to 20 degrees — any number value along that range can be supplied, so the font can be slanted just a tiny bit. However, any value from -90 to 90 degrees is valid.
**Note:** The `deg` keyword is not used when utilizing `font-variation-settings`.
```
font-style: oblique 14deg;
font-variation-settings: "slnt" 14;
```
The following live example's CSS can be edited to allow you to play with font slant/oblique values.
### Optical size
This is something new to digital fonts and CSS, but is a centuries-old technique in designing and creating metal type. Optical sizing refers to the practice of varying the overall stroke thickness of letterforms based on physical size. If the size was very small (such as an equivalent to 10 or 12px), the characters would have an overall thicker stroke, and perhaps other small modifications to ensure that it would reproduce and be readable at a physically smaller size. Conversely, when a much larger size was being used (like 48 or 60px), there might be much greater variation in thick and thin stroke weights, showing the typeface design more in line with the original intent.
While this was originally done to compensate for the ink and paper printing process (very thin lines at small sizes often didn't print, giving the letterforms a broken appearance), it translates well to digital displays when compensating for screen quality and physical size rendering.
Optical size values are generally intended to be automatically applied corresponding to `font-size`, but can also be manipulated using the lower-level `font-variation-settings` syntax.
There is a new attribute, [`font-optical-sizing`](../font-optical-sizing), created to support variable fonts in CSS. When using `font-optical-sizing`, the only allowed values are `auto` or `none` — so this attribute only allows for turning optical sizing on or off. However when using `font-variation-settings: 'opsz' <num>`, you can supply a numeric value. In most cases you would want to match the `font-size` (the physical size the type is being rendered) with the `opsz` value (which is how optical sizing is intended to be applied when using `auto`). The option to provide a specific value is provided so that should it be necessary to override the default — for legibility, aesthetic, or some other reason — a specific value can be applied.
```
font-optical-sizing: auto;
font-variation-settings: "opsz" 36;
```
The following live example's CSS can be edited to allow you to play with optical size values.
### Custom axes
Custom axes are just that: they can be any axis of design variation that the typeface designer imagines. There may be some that become fairly common — or even become registered — but only time will tell.
### Grade
Grade may become one of the more common custom axes as it has a known history in typeface design. The practice of designing different grades of a typeface was often done in reaction to intended use and printing technique. The term 'grade' refers to the relative weight or density of the typeface design, but differs from traditional 'weight' in that the physical space the text occupies does not change, so changing the text grade doesn't change the overall layout of the text or elements around it. This makes grade a useful axis of variation as it can be varied or animated without causing a reflow of the text itself.
```
font-variation-settings: "GRAD" 88;
```
The following live example's CSS can be edited to allow you to play with font grade values.
### Using a variable font: @font-face changes
The syntax for loading variable fonts is very similar to any other web font, with a few notable differences, which are provided via upgrades to the traditional [`@font-face`](../@font-face) syntax now available in modern browsers.
The basic syntax is the same, but the font technology can be specified, and allowable ranges for descriptors like `font-weight` and `font-stretch` can be supplied, rather than named according to the font file being loaded.
#### Example for a standard upright (Roman) font
```
@font-face {
font-family: "MyVariableFontName";
src: url("path/to/font/file/myvariablefont.woff2") format("woff2-variations");
font-weight: 125 950;
font-stretch: 75% 125%;
font-style: normal;
}
```
#### Example for a font that includes both upright and italics
```
@font-face {
font-family: "MyVariableFontName";
src: url("path/to/font/file/myvariablefont.woff2") format("woff2-variations");
font-weight: 125 950;
font-stretch: 75% 125%;
font-style: oblique 0deg 20deg;
}
```
**Note:** there is no set specific value for the upper-end degree measurement in this case; they indicate that there is an axis so the browser can know to render upright or italic (remember that italics are only on or off)
#### Example for a font that contains only italics and no upright characters
```
@font-face {
font-family: "MyVariableFontName";
src: url("path/to/font/file/myvariablefont.woff2") format("woff2-variations");
font-weight: 125 950;
font-stretch: 75% 125%;
font-style: italic;
}
```
#### Example for a font that contains an oblique (slant) axis
```
@font-face {
font-family: "MyVariableFontName";
src: url("path/to/font/file/myvariablefont.woff2") format("woff2-variations");
font-weight: 125 950;
font-stretch: 75% 125%;
font-style: oblique 0deg 12deg;
}
```
**Note:** Not all browsers have implemented the full syntax for font format, so test carefully. All browsers that support variable fonts will still render them if you set the format to just the file format, rather than format-variations (i.e. `woff2` instead of `woff2-variations`), but it's best to use the proper syntax if possible.
**Note:** Supplying value ranges for `font-weight`, `font-stretch`, and `font-style` will keep the browser from attempting to render an axis outside that range if you are using the appropriate attribute (i.e. `font-weight` or `font-stretch`), but will not block you from supplying an invalid value via `font-variation-settings`, so use with care.
Working with older browsers
---------------------------
Variable font support can be checked with CSS Feature Queries (see [`@supports`](../@supports)), so it's possible to use variable fonts in production and scope the CSS calling the variable fonts inside a feature query block.
```
h1 {
font-family: some-non-variable-font-family;
}
@supports (font-variation-settings: "wdth" 115) {
h1 {
font-family: some-variable-font-family;
}
}
```
Sample pages
------------
The following example pages show two different ways to structure your CSS. The first uses the standard attributes wherever possible. The second example uses CSS Custom Properties to set values for a `font-variation-settings` string and shows how you can more easily update single variable values by overriding a single variable rather than rewriting the whole string. Note the hover effect on the `h2`, which only alters the grade axis custom property value.
Resources
---------
* [W3C CSS Fonts Module 4 Specification](https://drafts.csswg.org/css-fonts-4/) (editor's draft)
* [W3C GitHub issue queue](https://github.com/w3c/csswg-drafts/issues)
* [Microsoft Open Type Variations introduction](https://docs.microsoft.com/typography/opentype/spec/otvaroverview)
* [Microsoft OpenType Design-Variation Axis Tag Registry](https://docs.microsoft.com/typography/opentype/spec/dvaraxisreg)
* [Wakamai Fondue](https://wakamaifondue.com) (a site that will tell you what your font can do via a simple drag-and-drop inspection interface)
* [Axis Praxis](https://www.axis-praxis.org) (the original variable fonts playground site)
* [V-Fonts.com](https://v-fonts.com) (a catalog of variable fonts and where to get them)
* [Font Playground](https://play.typedetail.com) (another playground for variable fonts with some very unique approaches to user interface)
| programming_docs |
css OpenType font features guide OpenType font features guide
============================
Font features or variants refer to different glyphs or character styles contained within an OpenType font. These include things like ligatures (special glyphs that combine characters like 'fi' or 'ffl'), kerning (adjustments to the spacing between specific letterform pairings), fractions, numeral styles, and several others. These are all referred to as OpenType Features, and are made available to use on the web via specific properties and low-level control properties — [`font-feature-settings`](../font-feature-settings). This article provides you with all you need to know about using OpenType font features in CSS.
Some fonts will have one or more of these features enabled by default (kerning and default ligatures are common examples), while others are left to the designer or developer to choose to enable in specific scenarios.
In addition to broad feature sets like ligatures or lining figures (numerals that line up evenly as opposed to 'oldstyle', which look more like lower-case letters), there are also very specific ones such as stylistic sets (which might include several specific variants of glyphs meant to be used together), alternates (which might be one or more variants of the letter 'a'), or even language-specific alterations for East Asian languages. In the latter case, these alterations are actually necessary to properly express the language, so they go beyond the more stylistic preference of most other OpenType features.
**Warning:** There are many CSS attributes defined to leverage font features, but unfortunately many are not fully implemented. They are all defined and shown here, but many will only work using the lower-level [`font-feature-settings`](../font-feature-settings) property. It's possible to write CSS to work both ways but this can become cumbersome. The issue with using `font-feature-settings` for everything is that every time you want to change one of the individual features, you have to redefine the entire string (similar to manipulating variable fonts with [`font-variation-settings`](../font-variation-settings)).
Discovering availability of features in fonts
---------------------------------------------
This is sometimes the trickiest thing to work out if you don't have any documentation that came with the fonts (many type designers and foundries will provide sample pages and CSS just for this very reason). But there are some sites that make it easier to figure out. You can visit [wakamaifondue.com](https://wakamaifondue.com), drop your font file on the circle where instructed, and in a few moments you'll have a full report on all the capabilities and features of your font. [Axis-praxis.org](https://www.axis-praxis.org/) also offers a similar capability, with the ability to click on the features to turn them on or off in a given text block.
Why you would use them?
-----------------------
Given that these features take a bit of work to discover and use, it may seem a fair question to ask why one would bother to use them. The answer lies in the specific features that will make a site more useful, readable, and polished:
* **Ligatures** like 'ff' or 'fi' make letter spacing and reading more even and smooth.
* **Fractions** can make home improvement and recipe sites much easier to read and understand.
* **Numerals** within paragraphs of text set as 'oldstyle' sit more comfortably between lower-case letters, and likewise setting them as 'tabular numbers' will make them line up better when setting a list of costs in a table say. 'lining' figures on the other hand sit more uniformly on their own or in front of capitalized words.
While none of these features individually will render a site useless due to their absence, each of them in turn can make a site easier to use and more memorable for its attention to detail.
> OpenType features are like secret compartments in fonts. Unlock them and you'll find ways to make fonts look and behave differently in subtle and dramatic ways. Not all OpenType features are appropriate to use all of the time, but some features are critical for great typography. *-- Tim Brown, Head of Typography at Adobe*.
>
>
### Sometimes it's substance, not just style
There are some cases — like with [`font-variant-east-asian`](../font-variant-east-asian) — that OpenType features are directly tied to using different forms of certain glyphs, which can impact meaning and readability. In cases such as these, it's more than just a nicety, but rather an integral part of the content itself.
The font features
-----------------
There are a number of different features to consider. They are grouped and explained here according to the main attributes and options covered in the W3C specifications.
**Note:** The examples below show the properties and some example combinations, along with the lower-level syntax equivalents. They may not match exactly due to browser implementation inconsistencies, but in many cases, the first example will match the second. The typefaces shown are Playfair Display, Source Serif Pro, IBM Plex Serif, Dancing Script, and Kokoro (all available and free to use, most are on Google Fonts and other services).
### Kerning
Associated CSS property: [`font-kerning`](../font-kerning)
This refers to the spacing between specific glyph pairings. This is generally on by default (as recommended by the OpenType specification). It should be noted that if [`letter-spacing`](../letter-spacing) is also set on your text, that is applied after kerning.
### Alternates
Associated CSS property: [`font-variant-alternates`](../font-variant-alternates)
Fonts can supply a number of different alternatives for various glyphs, such as different styles of lower case 'a' or more or less elaborate swashes in a script typeface. This property can activate an entire set of alternates or just a specific one, depending on the values supplied. The example below is showing several different aspects of working with alternate characters. Fonts with alternate glyphs can make them available across the board or individually in separate stylistic sets, or even individual characters. In this example you can see two different typefaces, and the introduction of the [`@font-feature-values`](../@font-feature-values) at-rule. This is used to define shortcuts or named options that can be defined per font family. This way you can create a named option that applies to only a single font, or one that is shared and can be applied more generally
In this case, `@stylistic(alternates)` will show all the alternate characters for either font). Applying this to just the word 'My' alters the way the 'M' renders, and applying `@styleset(alt-a)` only changes the lower case 'a'.
Try changing the line
```
font-variant-alternates: styleset(alt-a);
```
to
```
font-variant-alternates: styleset(alt-g);
```
and notice that the lower case 'a' reverts to its regular form and the lower case 'g's changes instead.
#### More about alternates
* <https://www.w3.org/TR/css-fonts-4/#propdef-font-variant-alternates>
* [https://developer.mozilla.org/en-US/docs/Web/CSS/font-variant-alternates](../font-variant-alternates)
### Ligatures
Associated CSS property: [`font-variant-ligatures`](../font-variant-ligatures)
Ligatures are glyphs that replace two or more separate glyphs in order to represent them more smoothly (from a spacing or aesthetic perspective). Some of the most common are letters like 'fi', 'fl', or 'ffl' — but there are many other possibilities. There are the most frequent ones (referred to as common ligatures), and there are also more specialized categories like 'discretionary ligatures', 'historical ligatures', and 'contextual alternates'. While these last ones are not technically ligatures, they are generally similar in that they replace specific combinations of letters when they appear together.
While more common in script typefaces, in the below example they are used to create arrows:
### Position
Associated CSS property: [`font-variant-position`](../font-variant-position)
Position variants are used to enable typographic superscript and subscript glyphs. These are designed to work with the surrounding text without altering the baseline or line spacing. This is especially useful with the [`<sub>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/sub) or [`<sup>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/sup) elements.
### Capitals
Associated CSS property: [`font-variant-caps`](../font-variant-caps)
One of the more common use cases for OpenType features is proper small caps. These are capital letters sized to fit better amongst lower case letters and are generally used for acronyms and abbreviations.
### Numerals
Associated CSS property: [`font-variant-numeric`](../font-variant-numeric)
There are several different styles of numerals commonly included in fonts:
* 'Lining' figures are all the same height and on the same baseline.
* 'Oldstyle' figures are mixed height and designed to have the appearance of ascenders and descenders like other lower case letters. These are designed to be used inline with a copy so the numerals visually blend with the surrounding glyphs in a similar fashion to small caps.
There is also the notion of spacing. Proportional spacing is the normal setting, whereas tabular spacing lines up numerals evenly regardless of character width, making it more appropriate for lining up tables of numbers in financial tables.
There are two types of fractions supported through this property:
* Diagonal slashed fractions.
* Vertically stacked fractions.
Ordinals are also supported (such as '1st' or '3rd'), as is a slashed zero if present in the font.
#### Lining and old-style figures
#### Fractions, ordinals, and slashed zero
### East Asian
Associated CSS property: [`font-variant-east-asian`](../font-variant-east-asian)
This allows access to various alternate forms of glyphs within a font. The example below shows a string of glyphs with only the OpenType set 'jis78' enabled. Uncheck the box below and you'll see more characters displayed.
**Note:** these glyphs were copied out of a font sample and are not intended as prose.
### Font variant shorthand
The [`font-variant`](../font-variant) property is the shorthand syntax for defining all of the above. Setting a value of `normal` resets all properties to their initial value. Setting a value of `none` sets `font-variant-ligatures` to none and all other properties to their initial value. (Meaning that if kerning is on by default, it will still be on even with a value of `none` being supplied here.)
Font feature settings
---------------------
[`font-feature-settings`](../font-feature-settings) is the 'low level syntax' that allows explicit access to every named available OpenType feature. This gives a lot of control but has some disadvantages in how it impacts inheritance and — as mentioned above — if you wish to change one setting, you have to redeclare the entire string (unless you're using [CSS custom properties](../using_css_custom_properties) to set the values). Because of this, it's best to use the standard properties shown above wherever possible.
There are a huge number of possible features. You can see examples of a number of them above, and there are several resources available for finding more of them.
The general syntax looks like this:
```
.small-caps {
font-feature-settings: "smcp", "c2sc";
}
```
According to the specification you can either supply just the 4-character feature code or supply a 1 following the code (for enabling that feature) or a 0 (zero) to disable it. This is helpful if you have a feature like ligatures enabled by default but you would like to turn them off like so:
```
.no-ligatures {
font-feature-settings: "liga" 0, "dlig" 0;
}
```
### More on font-feature-settings codes
* ['The Complete CSS Demo for OpenType Features'](https://sparanoid.com/lab/opentype-features/) (can't vouch for the truth of the name, but it's pretty big)
* [A list of OpenType features on Wikipedia](https://en.wikipedia.org/wiki/List_of_typographic_features)
Using CSS feature detection for implementation
----------------------------------------------
Since not all properties are evenly implemented, it's good practice to set up your CSS using feature detection to utilize the correct properties, with [`font-feature-settings`](../font-feature-settings) as the fallback.
For example, small caps can be set several ways, but if you want to ensure that no matter what the underlying capitalization is that you end up with everything in small caps, it requires 2 settings with `font-feature-settings` versus a single property value using [`font-variant-caps`](../font-variant-caps).
```
.small-caps {
font-feature-settings: "smcp", "c2sc";
}
@supports (font-variant-caps: all-small-caps) {
.small-caps {
font-feature-settings: normal;
font-variant-caps: all-small-caps;
}
}
```
See also
--------
### Demos of CSS OpenType features in CSS
* [The Complete CSS Demo for OpenType Features](https://sparanoid.com/lab/opentype-features/)
### Web font analysis tools
* [Wakamai Fondue](https://wakamaifondue.com)
* [Axis Praxis](https://www.axis-praxis.org/)
### W3C Specifications
* [Font Feature Properties in CSS Fonts Module Level 3](https://drafts.csswg.org/css-fonts-3/#font-rend-props)
* [font-variant-alternatives in CSS Fonts Module Level 4](https://www.w3.org/TR/css-fonts-4/#propdef-font-variant-alternates)
### Other resources
* [Using OpenType features](https://helpx.adobe.com/fonts/using/use-open-type-features.html) by Tim Brown, Head of Typography, Adobe
* [Adobe's Syntax for OpenType features in CSS](https://helpx.adobe.com/fonts/using/open-type-syntax.html)
css Wrapping and breaking text Wrapping and breaking text
==========================
This guide explains the various ways in which overflowing text can be managed in CSS.
What is overflowing text?
-------------------------
In CSS, if you have an unbreakable string such as a very long word, by default it will overflow any container that is too small for it in the inline direction. We can see this happening in the example below: the long word is extending past the boundary of the box it is contained in.
CSS will display overflow in this way, because doing something else could cause data loss. In CSS data loss means that some of your content vanishes. So the initial value of [`overflow`](../overflow) is `visible`, and we can see the overflowing text. It is generally better to be able to see overflow, even if it is messy. If things were to disappear or be cropped as would happen if `overflow` was set to `hidden` you might not spot it when previewing your site. Messy overflow is at least easy to spot, and in the worst case, your visitor will be able to see and read the content even if it looks a bit strange.
In this next example, you can see what happens if `overflow` is set to `hidden`.
Finding the min-content size
----------------------------
To find the minimum size of the box that will contain its contents with no overflows, set the [`width`](../width) or [`inline-size`](../inline-size) property of the box to [`min-content`](../min-content).
Using `min-content` is therefore one possibility for overflowing boxes. If it is possible to allow the box to grow to be the minimum size required for the content, but no bigger, using this keyword will give you that size.
Breaking long words
-------------------
If the box needs to be a fixed size, or you are keen to ensure that long words can't overflow, then the [`overflow-wrap`](../overflow-wrap) property can help. This property will break a word once it is too long to fit on a line by itself.
**Note:** The `overflow-wrap` property acts in the same way as the non-standard property `word-wrap`. The `word-wrap` property is now treated by browsers as an alias of the standard property.
An alternative property to try is [`word-break`](../word-break). This property will break the word at the point it overflows. It will cause a break-even if placing the word onto a new line would allow it to display without breaking.
In this next example, you can compare the difference between the two properties on the same string of text.
This might be useful if you want to prevent a large gap from appearing if there is just enough space for the string. Or, where there is another element that you would not want the break to happen immediately after.
In the example below there is a checkbox and label. Let's say, you want the label to break should it be too long for the box. However, you don't want it to break directly after the checkbox.
Adding hyphens
--------------
To add hyphens when words are broken, use the CSS [`hyphens`](../hyphens) property. Using a value of `auto`, the browser is free to automatically break words at appropriate hyphenation points, following whatever rules it chooses. To have some control over the process, use a value of `manual`, then insert a hard or soft break character into the string. A hard break (`‐`) will always break, even if it is not necessary to do so. A soft break (`­`) only breaks if breaking is needed.
You can also use the [`hyphenate-character`](../hyphenate-character) property to use the string of your choice instead of the hyphen character at the end of the line (before the hyphenation line break).
This property also takes the value `auto`, which will select the correct value to mark a mid-word line break according to the typographic conventions of the current content language.
The `<wbr>` element
-------------------
If you know where you want a long string to break, then it is also possible to insert the HTML [`<wbr>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/wbr) element. This can be useful in cases such as displaying a long URL on a page. You can then add the property in order to break the string in sensible places that will make it easier to read.
In the below example the text breaks in the location of the [`<wbr>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/wbr).
See also
--------
* The HTML [`<wbr>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/wbr) element
* The CSS [`word-break`](../word-break) property
* The CSS [`overflow-wrap`](../overflow-wrap) property
* The CSS [`white-space`](../white-space) property
* The CSS [`hyphens`](../hyphens) property
* [Overflow and Data Loss in CSS](https://www.smashingmagazine.com/2019/09/overflow-data-loss-css/)
css Using CSS transforms Using CSS transforms
====================
By modifying the coordinate space, **CSS transforms** change the shape and position of the affected content without disrupting the normal document flow. This guide provides an introduction to using transforms.
CSS transforms are implemented using a set of CSS properties that let you apply affine linear transformations to HTML elements. These transformations include rotation, skewing, scaling, and translation both in the plane and in the 3D space.
**Warning:** Only transformable elements can be `transform`ed; that is, all elements whose layout is governed by the CSS [box model](../css_box_model) except for: [non-replaced inline boxes](../visual_formatting_model#inline-level_elements_and_inline_boxes), [table-column boxes](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/col), and [table-column-group boxes](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/colgroup).
CSS transforms properties
-------------------------
Two major properties are used to define CSS transforms: [`transform`](../transform) (or the individual [`translate`](../translate), [`rotate`](../rotate), and [`scale`](../scale) properties) and [`transform-origin`](../transform-origin).
[`transform-origin`](../transform-origin) Specifies the position of the origin. By default, it is at the center of the element and can be moved. It is used by several transforms, like rotations, scaling or skewing, that need a specific point as a parameter.
[`transform`](../transform) Specifies the transforms to apply to the element. It is a space-separated list of transforms, which are applied one after the other, as requested by the composition operation. Composite transforms are effectively applied in order from right to left.
Examples
--------
Here is an unaltered image of the MDN logo:
### Rotating
Here is the MDN logo rotated 90 degrees from its bottom-left corner.
```
<img
style="rotate: 90deg;
transform-origin: bottom left;"
src="logo.png"
alt="MDN Logo" />
```
### Skewing and translating
Here is the MDN logo, skewed by 10 degrees and translated by 150 pixels on the X-axis.
```
<img
style="transform: skewx(10deg) translatex(150px);
transform-origin: bottom left;"
src="logo.png"
alt="MDN logo" />
```
3D specific CSS properties
--------------------------
Performing CSS transformations in 3D space is a bit more complex. You have to start by configuring the 3D space by giving it a perspective, then you have to configure how your 2D elements will behave in that space.
### Perspective
The first element to set is the [`perspective`](../perspective). The perspective is what gives us the 3D impression. The farther from the viewer the elements are, the smaller they are.
#### Setting perspective
This example shows a cube with the perspective set at different positions. How quick the cube shrinks is defined by the [`perspective`](../perspective) property. The smaller its value is, the deeper the perspective is.
##### HTML
The HTML below creates four copies of the same box, with the perspective set at different values.
```
<table>
<tbody>
<tr>
<th><code>perspective: 250px;</code></th>
<th><code>perspective: 350px;</code></th>
</tr>
<tr>
<td>
<div class="container">
<div class="cube pers250">
<div class="face front">1</div>
<div class="face back">2</div>
<div class="face right">3</div>
<div class="face left">4</div>
<div class="face top">5</div>
<div class="face bottom">6</div>
</div>
</div>
</td>
<td>
<div class="container">
<div class="cube pers350">
<div class="face front">1</div>
<div class="face back">2</div>
<div class="face right">3</div>
<div class="face left">4</div>
<div class="face top">5</div>
<div class="face bottom">6</div>
</div>
</div>
</td>
</tr>
<tr>
<th><code>perspective: 500px;</code></th>
<th><code>perspective: 650px;</code></th>
</tr>
<tr>
<td>
<div class="container">
<div class="cube pers500">
<div class="face front">1</div>
<div class="face back">2</div>
<div class="face right">3</div>
<div class="face left">4</div>
<div class="face top">5</div>
<div class="face bottom">6</div>
</div>
</div>
</td>
<td>
<div class="container">
<div class="cube pers650">
<div class="face front">1</div>
<div class="face back">2</div>
<div class="face right">3</div>
<div class="face left">4</div>
<div class="face top">5</div>
<div class="face bottom">6</div>
</div>
</div>
</td>
</tr>
</tbody>
</table>
```
##### CSS
The CSS establishes classes that can be used to set the perspective to different distances. It also includes classes for the container box and the cube itself, as well as each of its faces.
```
/\* Shorthand classes for different perspective values \*/
.pers250 {
perspective: 250px;
}
.pers350 {
perspective: 350px;
}
.pers500 {
perspective: 500px;
}
.pers650 {
perspective: 650px;
}
/\* Define the container div, the cube div, and a generic face \*/
.container {
width: 200px;
height: 200px;
margin: 75px 0 0 75px;
border: none;
}
.cube {
width: 100%;
height: 100%;
backface-visibility: visible;
perspective-origin: 150% 150%;
transform-style: preserve-3d;
}
.face {
display: block;
position: absolute;
width: 100px;
height: 100px;
border: none;
line-height: 100px;
font-family: sans-serif;
font-size: 60px;
color: white;
text-align: center;
}
/\* Define each face based on direction \*/
.front {
background: rgba(0, 0, 0, 0.3);
transform: translateZ(50px);
}
.back {
background: rgba(0, 255, 0, 1);
color: black;
transform: rotateY(180deg) translateZ(50px);
}
.right {
background: rgba(196, 0, 0, 0.7);
transform: rotateY(90deg) translateZ(50px);
}
.left {
background: rgba(0, 0, 196, 0.7);
transform: rotateY(-90deg) translateZ(50px);
}
.top {
background: rgba(196, 196, 0, 0.7);
transform: rotateX(90deg) translateZ(50px);
}
.bottom {
background: rgba(196, 0, 196, 0.7);
transform: rotateX(-90deg) translateZ(50px);
}
/\* Make the table a little nicer \*/
th,
p,
td {
background-color: #eeeeee;
padding: 10px;
font-family: sans-serif;
text-align: left;
}
```
##### Result
The second element to configure is the position of the viewer, with the [`perspective-origin`](../perspective-origin) property. By default the perspective is centered on the viewer, which is not always adequate.
#### Changing the perspective origin
This example shows cubes with popular `perspective-origin` values.
##### HTML
```
<section>
<figure>
<figcaption><code>perspective-origin: top left;</code></figcaption>
<div class="container">
<div class="cube potl">
<div class="face front">1</div>
<div class="face back">2</div>
<div class="face right">3</div>
<div class="face left">4</div>
<div class="face top">5</div>
<div class="face bottom">6</div>
</div>
</div>
</figure>
<figure>
<figcaption><code>perspective-origin: top;</code></figcaption>
<div class="container">
<div class="cube potm">
<div class="face front">1</div>
<div class="face back">2</div>
<div class="face right">3</div>
<div class="face left">4</div>
<div class="face top">5</div>
<div class="face bottom">6</div>
</div>
</div>
</figure>
<figure>
<figcaption><code>perspective-origin: top right;</code></figcaption>
<div class="container">
<div class="cube potr">
<div class="face front">1</div>
<div class="face back">2</div>
<div class="face right">3</div>
<div class="face left">4</div>
<div class="face top">5</div>
<div class="face bottom">6</div>
</div>
</div>
</figure>
<figure>
<figcaption><code>perspective-origin: left;</code></figcaption>
<div class="container">
<div class="cube poml">
<div class="face front">1</div>
<div class="face back">2</div>
<div class="face right">3</div>
<div class="face left">4</div>
<div class="face top">5</div>
<div class="face bottom">6</div>
</div>
</div>
</figure>
<figure>
<figcaption><code>perspective-origin: 50% 50%;</code></figcaption>
<div class="container">
<div class="cube pomm">
<div class="face front">1</div>
<div class="face back">2</div>
<div class="face right">3</div>
<div class="face left">4</div>
<div class="face top">5</div>
<div class="face bottom">6</div>
</div>
</div>
</figure>
<figure>
<figcaption><code>perspective-origin: right;</code></figcaption>
<div class="container">
<div class="cube pomr">
<div class="face front">1</div>
<div class="face back">2</div>
<div class="face right">3</div>
<div class="face left">4</div>
<div class="face top">5</div>
<div class="face bottom">6</div>
</div>
</div>
</figure>
<figure>
<figcaption><code>perspective-origin: bottom left;</code></figcaption>
<div class="container">
<div class="cube pobl">
<div class="face front">1</div>
<div class="face back">2</div>
<div class="face right">3</div>
<div class="face left">4</div>
<div class="face top">5</div>
<div class="face bottom">6</div>
</div>
</div>
</figure>
<figure>
<figcaption><code>perspective-origin: bottom;</code></figcaption>
<div class="container">
<div class="cube pobm">
<div class="face front">1</div>
<div class="face back">2</div>
<div class="face right">3</div>
<div class="face left">4</div>
<div class="face top">5</div>
<div class="face bottom">6</div>
</div>
</div>
</figure>
<figure>
<figcaption><code>perspective-origin: bottom right;</code></figcaption>
<div class="container">
<div class="cube pobr">
<div class="face front">1</div>
<div class="face back">2</div>
<div class="face right">3</div>
<div class="face left">4</div>
<div class="face top">5</div>
<div class="face bottom">6</div>
</div>
</div>
</figure>
<figure>
<figcaption><code>perspective-origin: -200% -200%;</code></figcaption>
<div class="container">
<div class="cube po200200neg">
<div class="face front">1</div>
<div class="face back">2</div>
<div class="face right">3</div>
<div class="face left">4</div>
<div class="face top">5</div>
<div class="face bottom">6</div>
</div>
</div>
</figure>
<figure>
<figcaption><code>perspective-origin: 200% 200%;</code></figcaption>
<div class="container">
<div class="cube po200200pos">
<div class="face front">1</div>
<div class="face back">2</div>
<div class="face right">3</div>
<div class="face left">4</div>
<div class="face top">5</div>
<div class="face bottom">6</div>
</div>
</div>
</figure>
<figure>
<figcaption><code>perspective-origin: 200% -200%;</code></figcaption>
<div class="container">
<div class="cube po200200">
<div class="face front">1</div>
<div class="face back">2</div>
<div class="face right">3</div>
<div class="face left">4</div>
<div class="face top">5</div>
<div class="face bottom">6</div>
</div>
</div>
</figure>
</section>
```
##### CSS
```
/\* perspective-origin values (unique per example) \*/
.potl {
perspective-origin: top left;
}
.potm {
perspective-origin: top;
}
.potr {
perspective-origin: top right;
}
.poml {
perspective-origin: left;
}
.pomm {
perspective-origin: 50% 50%;
}
.pomr {
perspective-origin: right;
}
.pobl {
perspective-origin: bottom left;
}
.pobm {
perspective-origin: bottom;
}
.pobr {
perspective-origin: bottom right;
}
.po200200neg {
perspective-origin: -200% -200%;
}
.po200200pos {
perspective-origin: 200% 200%;
}
.po200200 {
perspective-origin: 200% -200%;
}
/\* Define the container div, the cube div, and a generic face \*/
.container {
width: 100px;
height: 100px;
margin: 24px;
border: none;
}
.cube {
width: 100%;
height: 100%;
backface-visibility: visible;
perspective: 300px;
transform-style: preserve-3d;
}
.face {
display: block;
position: absolute;
width: 100px;
height: 100px;
border: none;
line-height: 100px;
font-family: sans-serif;
font-size: 60px;
color: white;
text-align: center;
}
/\* Define each face based on direction \*/
.front {
background: rgba(0, 0, 0, 0.3);
transform: translateZ(50px);
}
.back {
background: rgba(0, 255, 0, 1);
color: black;
transform: rotateY(180deg) translateZ(50px);
}
.right {
background: rgba(196, 0, 0, 0.7);
transform: rotateY(90deg) translateZ(50px);
}
.left {
background: rgba(0, 0, 196, 0.7);
transform: rotateY(-90deg) translateZ(50px);
}
.top {
background: rgba(196, 196, 0, 0.7);
transform: rotateX(90deg) translateZ(50px);
}
.bottom {
background: rgba(196, 0, 196, 0.7);
transform: rotateX(-90deg) translateZ(50px);
}
/\* Make the layout a little nicer \*/
section {
background-color: #eee;
padding: 10px;
font-family: sans-serif;
text-align: left;
display: grid;
grid-template-columns: repeat(3, 1fr);
}
```
##### Result
Once you have done this, you can work on the element in the 3D space.
See also
--------
* The [CSS `transform` property](../transform) and the [CSS `<transform-function>` data types](../transform-function)
* The individual transforms properties: [`translate`](../translate), [`rotate`](../rotate), and [`scale`](../scale) (There is no `skew` property)
* [Using device orientation with 3D Transforms](https://developer.mozilla.org/en-US/docs/Web/API/Device_orientation_events/Using_device_orientation_with_3D_transforms)
* [Intro to CSS 3D transforms](https://3dtransforms.desandro.com/) (Blog post by David DeSandro)
* [CSS Transform Playground](https://css-transform.moro.es/) (Online tool to visualize CSS Transform functions)
| programming_docs |
css Consistent list indentation Consistent list indentation
===========================
One of the most common style changes made to lists is a change in the indentation distance—that is, how far the list items are pushed over to the right. This often leads to frustration, because what works in one browser often doesn't have the same effect in another. For example, if you declare that lists have no left margin, they move over in Internet Explorer, but sit stubbornly in place in Gecko-based browsers. This article will help you understand the problems that can occur and how to avoid them.
To understand why this is the case, and more importantly how to avoid the problem altogether, it's necessary to examine the details of list construction.
Making a List
-------------
First, we consider a single, pure list item. This list item has no marker (otherwise known as a "bullet") and is not yet part of a list itself. It hangs alone in the void, simple and unadorned, as shown in Figure 1.
That dotted red border represents the outer edges of the content area of the list item. Remember that, at this point, the list item has no padding or borders. If we add two more list items, we get a result like that shown in Figure 2.
Now we wrap these in a parent element; in this case, we'll wrap them in an unordered list (i.e., `<ul>`). According to the CSS box model, the list items' boxes must be displayed within the parent element's content area. Since that parent has no padding or margins yet, we get the situation shown in Figure 3.
Here, the dotted blue border shows us the edges of the `<ul>` element's content area. Since we have no padding for the `<ul>` element, its content wraps snugly around the three list items.
Now we add the list item markers. Since this is an unordered list, we'll add traditional filled-circle "bullets," as shown in Figure 4.
Visually, the markers are *outside* the content area of the `<ul>`, but that's not the important part here. What's key is that the markers are placed outside the "principal box" of the `<li>` elements, not the `<ul>`. They're sort of like appendages to the list items, hanging outside the content-area of the `<li>` but still attached to the `<li>`.
This is why, in every browser except Internet Explorer for Windows, markers are placed outside any border set for an `<li>` element, assuming the value of `list-style-position` is `outside`. If it's changed to `inside`, then the markers are brought inside the `<li>`'s content, as though they're an inline box placed at the very beginning of the `<li>`.
Indenting It Twice
------------------
So how will all this appear in a document? At the moment, we have a situation analogous to these styles:
```
ul,
li {
margin-left: 0;
padding-left: 0;
}
```
If we dropped this list into a document as-is, there would be no apparent indentation and the markers would be in danger of falling off the left edge of the browser window.
To avoid this and get some indentation, there are only three options available to browser implementors.
1. Give each `<li>` element a left margin.
2. Give the `<ul>` element a left margin.
3. Give the `<ul>` element some left padding.
As it turns out, nobody seems to have used the first option. The second option was taken by Internet Explorer, and Opera. The third was adopted by Firefox.
Let's look at the two approaches for a moment. In Internet Explorer and Opera, the lists are indented by setting a left margin of 40 pixels on the `<ul>` element. If we apply a background color to the `<ul>` element and leave the list item and `<ul>` borders in place, we get the result shown in Figure 5.
Gecko, on the other hand, sets a left *padding* of 40 pixels for the `<ul>` element, so given the exact same styles as were used to produce Figure 5, loading the example into a Gecko-based browser gives us Figure 6.
As we can see, the markers remain attached to the `<li>` elements, no matter where they are. The difference is entirely in how the `<ul>` is styled. We can only see the difference if we try to set a background or border on the `<ul>` element.
Finding Consistency
-------------------
Boil it all down, and what we're left with is this: if you want consistent rendering of lists between Gecko, Internet Explorer, and Opera, you need to set **both** the left margin and left padding of the `<ul>` element. We can ignore `<li>` altogether for these purposes. If you want to reproduce the default display in Netscape 6.x, you write:
```
ul {
margin-left: 0;
padding-left: 40px;
}
```
If you're more interested in following the Internet Explorer/Opera model, then:
```
ul {
margin-left: 40px;
padding-left: 0;
}
```
Of course, you can fill in your preferred values. Set both to `1.25em`, if you like — there's no reason why you have to stick with pixel-based indentation. If you want to reset lists to have no indentation, then you still have to zero out both padding and margin:
```
ul {
margin-left: 0;
padding-left: 0;
}
```
Remember, though, that in so doing, you'll have the bullets hanging outside the list and its parent element. If the parent is the `body`, there's a strong chance your bullets will be completely outside the browser window, and thus will not be visible.
Conclusion
----------
In the end, we can see that none of the browsers mentioned in this article is right or wrong about how they lay out lists. They use different default styles, and that's where the problems creep in. By making sure you style both the left padding and left margin of lists, you can find much greater cross-browser consistency in your list indentation.
Recommendations
---------------
* When altering the indentation of lists, make sure to set both the padding and margin.
Original Document Information
-----------------------------
* Author(s): Eric A. Meyer, Netscape Communications
* Last Updated Date: Published 30 Aug 2002
* Copyright Information: Copyright © 2001-2003 Netscape. All rights reserved.
* Note: This reprinted article was originally part of the DevEdge site.
css Guide to scroll anchoring Guide to scroll anchoring
=========================
As a user of the web, you are probably familiar with the problem that scroll anchoring solves. You browse to a long page on a slow connection and begin to scroll to read the content; while you are busy reading, the part of the page you are looking at suddenly jumps. This has happened because large images or some other elements have just loaded further up in the content.
Scroll anchoring is a browser feature that aims to solve this problem of content jumping, which happens if content loads in after the user has already scrolled to a new part of the document.
How does it work?
-----------------
Scroll anchoring adjusts the scroll position to compensate for the changes outside of the viewport. This means that the point in the document the user is looking at remains in the viewport, which may mean their scroll position actually changes in terms of how *far* they have moved through the document.
How do I turn on scroll anchoring?
----------------------------------
You don't! The feature is enabled by default in supporting browsers. In most cases anchored scrolling is exactly what you want — content jumping is a poor experience for anyone.
What if I need to debug it?
---------------------------
If your page is not behaving well with scroll anchoring enabled, it is probably because some `scroll` event listener is not handling well the extra scrolling to compensate for the anchor node movement.
You can check whether disabling scroll anchoring fixes the issue in Firefox by changing `layout.css.scroll-anchoring.enabled` to `false` in `about:config`.
If it does, you can check what node is Firefox using as the anchor using the `layout.css.scroll-anchoring.highlight` switch. That will show a purple overlay on top of the anchor node.
If one node doesn't seem appropriate to be an anchor, you can exclude it using [`overflow-anchor`](../overflow-anchor), as described below.
What if I need to disable it?
-----------------------------
The specification provides a new property, [`overflow-anchor`](../overflow-anchor), which can be used to disable scroll anchoring on all or part of the document. It's essentially a way to opt out of the new behavior.
The only possible values are `auto` or `none`:
* `auto` is the initial value; as long as the user has a supported browser the scroll anchoring behavior will happen, and they should see fewer content jumps.
* `none` means that you have explicitly opted the document, or part of the document, out of scroll anchoring.
To opt out the entire document, you can set it on the [`<body>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/body) element:
```
body {
overflow-anchor: none;
}
```
To opt out a certain part of the document use `overflow-anchor: none` on its container element:
```
.container {
overflow-anchor: none;
}
```
**Note:** The specification details that once scroll anchoring has been opted out of, you cannot opt back into it from a child element. For example, if you opt out for the entire document, you will not be able to set `overflow-anchor: auto` elsewhere in the document to turn it back on for a subsection.
### Suppression triggers
The specification also details some *suppression triggers*, which will disable scroll anchoring in places where it might be problematic. If any of the triggers happen on the anchor node, or an ancestor of it, anchoring is suppressed.
These suppression triggers are changes to the computed value of any of the following properties:
* [`top`](../top), [`left`](../left), [`right`](../right), or [`bottom`](../bottom)
* [`margin`](../margin) or [`padding`](../padding)
* Any [`width`](../width) or [`height`](../height)-related properties
* [`transform`](../transform) and the individual transform properties [`translate`](../translate), [`scale`](../scale), and [`rotate`](../rotate)
Additionally, [`position`](../position) changes anywhere inside the scrolling box also disable scroll anchoring.
**Note:** In [bug 1584285](https://bugzilla.mozilla.org/show_bug.cgi?id=1584285) the `layout.css.scroll-anchoring.suppressions.enabled` flag was added to Firefox Nightly in order to allow the disabling of these triggers.
Further reading
---------------
* [Explainer document on the WICG site](https://github.com/WICG/ScrollAnchoring/blob/master/explainer.md)
* [Scroll anchoring for web developers on the Chromium blog](https://blog.chromium.org/2017/04/scroll-anchoring-for-web-developers.html)
* [Implement a pin-to-bottom scrolling element using scroll anchoring](https://blog.eqrion.net/pin-to-bottom/)
Browser compatibility
---------------------
| | Desktop | Mobile |
| --- | --- | --- |
| | Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet |
| `Guide_to_scroll_anchoring` | 56 | 79 | 66 | No | 43 | No | 56 | 56 | No | 43 | No | 6.0 |
### Compatibility notes
If you need to test whether scroll anchoring is available in a browser, use [Feature Queries](../@supports) to test support for the `overflow-anchor` property.
css Understanding CSS z-index Understanding CSS z-index
=========================
In the most basic cases, [HTML](https://developer.mozilla.org/en-US/docs/Web/HTML) pages can be considered two-dimensional, because text, images, and other elements are arranged on the page without overlapping. In this case, there is a single rendering flow, and all elements are aware of the space taken by others. The [`z-index`](../z-index) attribute lets you adjust the order of the layering of objects when rendering content.
> *In CSS 2.1, each box has a position in three dimensions. In addition to their horizontal and vertical positions, boxes lie along a "z-axis" and are formatted one on top of the other. Z-axis positions are particularly relevant when boxes overlap visually.*
>
>
(from [CSS 2.1 Section 9.9.1 - Layered presentation](https://www.w3.org/TR/CSS21/visuren.html#z-index))
This means that CSS style rules allow you to position boxes on layers in addition to the default rendering layer (layer 0). The position on an imaginary z-axis of each layer is expressed as an integer representing the stacking order for rendering. Greater numbers mean closer to the observer. Control the position on this z-axis with the CSS `z-index` property.
Using `z-index` appears extremely easy: a single property assigned a single integer number with an easy-to-understand behavior. When `z-index` is applied to complex hierarchies of HTML elements, its behavior can be hard to understand or predict. This is due to complex stacking rules. In fact, a dedicated section has been reserved in the CSS specification [CSS-2.1 Appendix E](https://www.w3.org/TR/CSS21/zindex.html) to explain these rules better.
This guide will try to explain those rules, with some simplification and several examples.
Articles
--------
1. [Stacking without the z-index property](understanding_z_index/stacking_without_z-index): The stacking rules that apply when `z-index` is not used.
2. [Stacking with floated blocks](understanding_z_index/stacking_and_float): How floating elements are handled with stacking.
3. [Using z-index](understanding_z_index/adding_z-index): How to use `z-index` to change default stacking.
4. [The stacking context](understanding_z_index/the_stacking_context): Notes on the stacking context.
Examples
--------
1. [Stacking context example 1](understanding_z_index/stacking_context_example_1): 2-level HTML hierarchy, `z-index` on the last level
2. [Stacking context example 2](understanding_z_index/stacking_context_example_2): 2-level HTML hierarchy, `z-index` on all levels
3. [Stacking context example 3](understanding_z_index/stacking_context_example_3): 3-level HTML hierarchy, `z-index` on the second level
css Stacking without the z-index property Stacking without the z-index property
=====================================
When the [`z-index`](../../z-index) property is not specified on any element, elements are stacked in the following order (from bottom to top):
1. The background and borders of the root element.
2. Descendant non-positioned elements, in order of appearance in the HTML.
3. Descendant positioned elements, in order of appearance in the HTML.
See [types of positioning](../../position#types_of_positioning) for an explanation of positioned and non-positioned elements.
Keep in mind, when the [`order`](../../order) property alters rendering from the *order of appearance in the HTML* within [`flex`](../../flex) containers, it similarly affects the order for stacking context.
Example
-------
In this example, DIV #1 through DIV #4 are positioned elements. DIV #5 is static, and so is drawn below the other four elements, even though it comes later in the HTML markup.
### HTML
```
<div id="abs1" class="absolute">
<strong>DIV #1</strong><br />position: absolute;
</div>
<div id="rel1" class="relative">
<strong>DIV #2</strong><br />position: relative;
</div>
<div id="rel2" class="relative">
<strong>DIV #3</strong><br />position: relative;
</div>
<div id="abs2" class="absolute">
<strong>DIV #4</strong><br />position: absolute;
</div>
<div id="sta1" class="static">
<strong>DIV #5</strong><br />position: static;
</div>
```
### CSS
```
strong {
font-family: sans-serif;
}
div {
padding: 10px;
border: 1px dashed;
text-align: center;
}
.static {
position: static;
height: 80px;
background-color: #ffc;
border-color: #996;
}
.absolute {
position: absolute;
width: 150px;
height: 350px;
background-color: #fdd;
border-color: #900;
opacity: 0.7;
}
.relative {
position: relative;
height: 80px;
background-color: #cfc;
border-color: #696;
opacity: 0.7;
}
#abs1 {
top: 10px;
left: 10px;
}
#rel1 {
top: 30px;
margin: 0px 50px 0px 50px;
}
#rel2 {
top: 15px;
left: 20px;
margin: 0px 50px 0px 50px;
}
#abs2 {
top: 10px;
right: 10px;
}
#sta1 {
background-color: #ffc;
margin: 0px 50px 0px 50px;
}
```
Result
------
See also
--------
* [Stacking with floated blocks](stacking_and_float): How floating elements are handled with stacking.
* [Using z-index](adding_z-index): How to use `z-index` to change default stacking.
* [The stacking context](the_stacking_context): Notes on the stacking context.
* [Stacking context example 1](stacking_context_example_1): 2-level HTML hierarchy, z-index on the last level
* [Stacking context example 2](stacking_context_example_2): 2-level HTML hierarchy, z-index on all levels
* [Stacking context example 3](stacking_context_example_3): 3-level HTML hierarchy, z-index on the second level
css Stacking context example 1 Stacking context example 1
==========================
Description
-----------
Let's start with a basic example. In the root stacking context, there are two relatively positioned `<div>` elements (DIV #1 and DIV #3) without `z-index` properties. Inside DIV #1, there is an absolutely positioned DIV #2, while in DIV #3, there is an absolutely positioned DIV #4, both without `z-index` properties.
The only stacking context is the root context. Without `z-index` values, elements are stacked in order of occurrence.
If DIV #2 is assigned a positive (non-zero and non-auto) z-index value, it is rendered above all the other DIVs.
Then if DIV #4 is also assigned a positive z-index greater than DIV #2's z-index, it is rendered above all the other DIVs including DIV #2.
In this last example you can see that DIV #2 and DIV #4 are not siblings, because they belong to different parents in the HTML elements' hierarchy. Even so, stacking of DIV #4 with respect of DIV #2 can be controlled through `z-index`. It happens that, since DIV #1 and DIV #3 are not assigned any z-index value, they do not create a stacking context. This means that all their content, including DIV #2 and DIV #4, belongs to the same root stacking context.
In terms of stacking contexts, DIV #1 and DIV #3 are assimilated into the root element, and the resulting hierarchy is the following:
* Root stacking context
+ DIV #2 (`z-index`: 1)
+ DIV #4 (`z-index`: 2)
**Note:** DIV #1 and DIV #3 are not translucent. It is important to remember that assigning an opacity less than 1 to a positioned element implicitly creates a stacking context, just like adding a `z-index` value. And this example shows what happens when a parent element does not create a stacking context.
Example
-------
### HTML
```
<div id="div1">
<br /><span class="bold">DIV #1</span> <br />position: relative;
<div id="div2">
<br /><span class="bold">DIV #2</span> <br />position: absolute;
<br />z-index: 1;
</div>
</div>
<br />
<div id="div3">
<br /><span class="bold">DIV #3</span> <br />position: relative;
<div id="div4">
<br /><span class="bold">DIV #4</span> <br />position: absolute;
<br />z-index: 2;
</div>
</div>
```
### CSS
```
.bold {
font-family: Arial;
font-size: 12px;
font-weight: bold;
}
#div1,
#div3 {
height: 80px;
position: relative;
border: 1px dashed #669966;
background-color: #ccffcc;
padding-left: 5px;
}
#div2 {
opacity: 0.8;
z-index: 1;
position: absolute;
width: 150px;
height: 200px;
top: 20px;
left: 170px;
border: 1px dashed #990000;
background-color: #ffdddd;
text-align: center;
}
#div4 {
opacity: 0.8;
z-index: 2;
position: absolute;
width: 200px;
height: 80px;
top: 65px;
left: 50px;
border: 1px dashed #000099;
background-color: #ddddff;
text-align: left;
padding-left: 10px;
}
```
Result
------
See also
--------
* [Stacking without the z-index property](stacking_without_z-index): The stacking rules that apply when `z-index` is not used.
* [Stacking with floated blocks](stacking_and_float): How floating elements are handled with stacking.
* [Using z-index](adding_z-index): How to use `z-index` to change default stacking.
* [The stacking context](the_stacking_context): Notes on the stacking context.
* [Stacking context example 2](stacking_context_example_2): 2-level HTML hierarchy, `z-index` on all levels
* [Stacking context example 3](stacking_context_example_3): 3-level HTML hierarchy, `z-index` on the second level
| programming_docs |
css Stacking context example 3 Stacking context example 3
==========================
Description
-----------
This last example shows problems that arise when mixing several positioned elements in a multi-level HTML hierarchy and when `z-index` values are assigned using class selectors.
Let's take as an example a three-level hierarchical menu made from several positioned `div` elements. Second-level and third-level `div` elements appear when a user hovers or clicks on their parents. Usually this kind of menu is script-generated either client-side or server-side, so style rules are assigned with a class selector instead of the id selector.
If the three menu levels partially overlap, then managing stacking could become a problem.
The first-level menu is only relatively positioned, so no stacking context is created.
The second-level menu is absolutely positioned inside the parent element. In order to put it above all first-level menus, the `z-index` property is used. The problem is that for each second-level menu, a stacking context is created and each third-level menu belongs to the context of its parent.
So a third-level menu will be stacked under the following second-level menus, because all second-level menus share the same z-index value and the default stacking rules apply.
To better understand the situation, here is the stacking context hierarchy:
* Root stacking context
+ LEVEL #1
- LEVEL #2 (`z-index`: 1)
* LEVEL #3
* …
* LEVEL #3
- LEVEL #2 (`z-index`: 1)
- …
- LEVEL #2 (`z-index`: 1)
+ LEVEL #1
+ …
+ LEVEL #1
This problem can be avoided by removing overlapping between different level menus, or by using individual (and different) z-index values assigned through the id selector instead of class selector, or by flattening the HTML hierarchy.
**Note:** In the source code you will see that second-level and third level menus are made of several `div` elements contained in an absolutely positioned container. This is useful to group and position all of them at once.
Example
-------
### HTML
```
<div class="lev1">
<span class="bold">LEVEL #1</span>
<div id="container1">
<div class="lev2">
<br /><span class="bold">LEVEL #2</span> <br />z-index: 1;
<div id="container2">
<div class="lev3"><span class="bold">LEVEL #3</span></div>
<div class="lev3"><span class="bold">LEVEL #3</span></div>
<div class="lev3"><span class="bold">LEVEL #3</span></div>
<div class="lev3"><span class="bold">LEVEL #3</span></div>
<div class="lev3"><span class="bold">LEVEL #3</span></div>
<div class="lev3"><span class="bold">LEVEL #3</span></div>
<div class="lev3"><span class="bold">LEVEL #3</span></div>
<div class="lev3"><span class="bold">LEVEL #3</span></div>
<div class="lev3"><span class="bold">LEVEL #3</span></div>
<div class="lev3"><span class="bold">LEVEL #3</span></div>
<div class="lev3"><span class="bold">LEVEL #3</span></div>
</div>
</div>
<div class="lev2">
<br /><span class="bold">LEVEL #2</span> <br />z-index: 1;
</div>
</div>
</div>
<div class="lev1">
<span class="bold">LEVEL #1</span>
</div>
<div class="lev1">
<span class="bold">LEVEL #1</span>
</div>
<div class="lev1">
<span class="bold">LEVEL #1</span>
</div>
```
### CSS
```
div {
font: 12px Arial;
}
span.bold {
font-weight: bold;
}
div.lev1 {
width: 250px;
height: 70px;
position: relative;
border: 2px outset #669966;
background-color: #ccffcc;
padding-left: 5px;
}
#container1 {
z-index: 1;
position: absolute;
top: 30px;
left: 75px;
}
div.lev2 {
opacity: 0.9;
width: 200px;
height: 60px;
position: relative;
border: 2px outset #990000;
background-color: #ffdddd;
padding-left: 5px;
}
#container2 {
z-index: 1;
position: absolute;
top: 20px;
left: 110px;
}
div.lev3 {
z-index: 10;
width: 100px;
position: relative;
border: 2px outset #000099;
background-color: #ddddff;
padding-left: 5px;
}
```
Result
------
See also
--------
* [Stacking without the z-index property](stacking_without_z-index): The stacking rules that apply when `z-index` is not used.
* [Stacking with floated blocks](stacking_and_float): How floating elements are handled with stacking.
* [Using z-index](adding_z-index): How to use `z-index` to change default stacking.
* [The stacking context](the_stacking_context): Notes on the stacking context.
* [Stacking context example 1](stacking_context_example_1): 2-level HTML hierarchy, `z-index` on the last level
* [Stacking context example 2](stacking_context_example_2): 2-level HTML hierarchy, `z-index` on all levels
**Note:** the reason the sample image looks wrong - with the second level 2 overlapping the level 3 menus - is because level 2 has opacity, which creates a new stacking context. Basically, this whole sample page is incorrect and misleading.
css Stacking context example 2 Stacking context example 2
==========================
Description
-----------
This is a very simple example, but it is the key for understanding the concept of *stacking context*. There are the same four DIVs of the previous example, but now `z-index` properties are assigned on both levels of the hierarchy.
You can see that DIV #2 (`z-index`: 2) is above DIV #3 (`z-index`: 1), because they both belong to the same stacking context (the root one), so z-index values rule how elements are stacked.
What can be considered strange is that DIV #2 (`z-index`: 2) is above DIV #4 (`z-index`: 10), despite their z-index values. The reason is that they do not belong to the same stacking context. DIV #4 belongs to the stacking context created by DIV #3, and as explained previously DIV #3 (and all its content) is under DIV #2.
To better understand the situation, this is the stacking context hierarchy:
* Root stacking context
+ DIV #2 (`z-index`: 2)
+ DIV #3 (`z-index`: 1)
- DIV #4 (`z-index`: 10)
**Note:** It is worth remembering that in general the HTML hierarchy is different from the stacking context hierarchy. In the stacking context hierarchy, elements that do not create a stacking context are collapsed on their parent.
Example
-------
### HTML
```
<div id="div1">
<br />
<span class="bold">DIV #1</span><br />
position: relative;
<div id="div2">
<br />
<span class="bold">DIV #2</span><br />
position: absolute;<br />
z-index: 2;
</div>
</div>
<br />
<div id="div3">
<br />
<span class="bold">DIV #3</span><br />
position: relative;<br />
z-index: 1;
<div id="div4">
<br />
<span class="bold">DIV #4</span><br />
position: absolute;<br />
z-index: 10;
</div>
</div>
```
### CSS
```
div {
font: 12px Arial;
}
span.bold {
font-weight: bold;
}
#div2 {
z-index: 2;
}
#div3 {
z-index: 1;
}
#div4 {
z-index: 10;
}
#div1,
#div3 {
height: 80px;
position: relative;
border: 1px dashed #669966;
background-color: #ccffcc;
padding-left: 5px;
}
#div2 {
opacity: 0.8;
position: absolute;
width: 150px;
height: 200px;
top: 20px;
left: 170px;
border: 1px dashed #990000;
background-color: #ffdddd;
text-align: center;
}
#div4 {
opacity: 0.8;
position: absolute;
width: 200px;
height: 70px;
top: 65px;
left: 50px;
border: 1px dashed #000099;
background-color: #ddddff;
text-align: left;
padding-left: 10px;
}
```
Result
------
See also
--------
* [Stacking without the z-index property](stacking_without_z-index): The stacking rules that apply when `z-index` is not used.
* [Stacking with floated blocks](stacking_and_float): How floating elements are handled with stacking.
* [Using z-index](adding_z-index): How to use `z-index` to change default stacking.
* [The stacking context](the_stacking_context): Notes on the stacking context.
* [Stacking context example 1](stacking_context_example_1): 2-level HTML hierarchy, `z-index` on the last level
* [Stacking context example 3](stacking_context_example_3): 3-level HTML hierarchy, `z-index` on the second level
css Using z-index Using z-index
=============
The first article of this guide, [Stacking without the z-index property](stacking_without_z-index), explains how stacking is arranged by default. If you want to create a custom stacking order, you can use the [`z-index`](../../z-index) property on a [positioned](../../position#types_of_positioning) element.
The `z-index` property can be specified with an integer value (positive, zero, or negative), which represents the position of the element along an imaginary z-axis. If you are not familiar with the term 'z-axis', imagine the page as a stack of layers, each one having a number. Layers are rendered in numerical order, with larger numbers above smaller numbers (*X* represents an arbitrary positive integer):
| Layer | Description |
| --- | --- |
| Bottom layer | Farthest from the observer |
| Layer -X | Layers with negative `z-index` values |
| Layer 0 | Default rendering layer |
| Layer X | Layers with positive `z-index` values |
| Top layer | Closest to the observer |
**Note:**
* When no `z-index` property is specified, elements are rendered on the default rendering layer (Layer 0).
* If several elements share the same `z-index` value (i.e., they are placed on the same layer), stacking rules explained in the section [Stacking without the z-index property](stacking_without_z-index) apply.
Example
-------
In this example, the layers' stacking order is rearranged using `z-index`. The `z-index` of DIV #5 has no effect since it is not a positioned element.
### HTML
```
<div id="abs1">
<strong>DIV #1</strong>
<br />position: absolute; <br />z-index: 5;
</div>
<div id="rel1">
<strong>DIV #2</strong>
<br />position: relative; <br />z-index: 3;
</div>
<div id="rel2">
<strong>DIV #3</strong>
<br />position: relative; <br />z-index: 2;
</div>
<div id="abs2">
<strong>DIV #4</strong>
<br />position: absolute; <br />z-index: 1;
</div>
<div id="sta1">
<strong>DIV #5</strong>
<br />no positioning <br />z-index: 8;
</div>
```
### CSS
```
div {
padding: 10px;
opacity: 0.7;
text-align: center;
}
strong {
font-family: sans-serif;
}
#abs1 {
z-index: 5;
position: absolute;
width: 150px;
height: 350px;
top: 10px;
left: 10px;
border: 1px dashed #900;
background-color: #fdd;
}
#rel1 {
z-index: 3;
height: 100px;
position: relative;
top: 30px;
border: 1px dashed #696;
background-color: #cfc;
margin: 0px 50px 0px 50px;
}
#rel2 {
z-index: 2;
height: 100px;
position: relative;
top: 15px;
left: 20px;
border: 1px dashed #696;
background-color: #cfc;
margin: 0px 50px 0px 50px;
}
#abs2 {
z-index: 1;
position: absolute;
width: 150px;
height: 350px;
top: 10px;
right: 10px;
border: 1px dashed #900;
background-color: #fdd;
}
#sta1 {
z-index: 8;
height: 70px;
border: 1px dashed #996;
background-color: #ffc;
margin: 0px 50px 0px 50px;
}
```
Result
------
See also
--------
* [Stacking without the z-index property](stacking_without_z-index): The stacking rules that apply when `z-index` is not used.
* [Stacking with floated blocks](stacking_and_float): How floating elements are handled with stacking.
* [The stacking context](the_stacking_context): Notes on the stacking context.
* [Stacking context example 1](stacking_context_example_1): 2-level HTML hierarchy, z-index on the last level
* [Stacking context example 2](stacking_context_example_2): 2-level HTML hierarchy, z-index on all levels
* [Stacking context example 3](stacking_context_example_3): 3-level HTML hierarchy, z-index on the second level
css The stacking context The stacking context
====================
The **stacking context** is a three-dimensional conceptualization of HTML elements along an imaginary z-axis relative to the user, who is assumed to be facing the viewport or the webpage. HTML elements occupy this space in priority order based on element attributes.
Description
-----------
In the previous article of this guide, [Using z-index](adding_z-index), we showed that the rendering order of certain elements is influenced by their `z-index` value. This occurs because these elements have special properties which cause them to form a *stacking context*.
A stacking context is formed, anywhere in the document, by any element in the following scenarios:
* Root element of the document (`<html>`).
* Element with a [`position`](../../position) value `absolute` or `relative` and [`z-index`](../../z-index) value other than `auto`.
* Element with a [`position`](../../position) value `fixed` or `sticky` (sticky for all mobile browsers, but not older desktop browsers).
* Element that is a child of a [flex](../../css_flexible_box_layout/basic_concepts_of_flexbox) container, with [`z-index`](../../z-index) value other than `auto`.
* Element that is a child of a [`grid`](../../grid) container, with [`z-index`](../../z-index) value other than `auto`.
* Element with an [`opacity`](../../opacity) value less than `1` (See [the specification for opacity](https://www.w3.org/TR/css-color-3/#transparency)).
* Element with a [`mix-blend-mode`](../../mix-blend-mode) value other than `normal`.
* Element with any of the following properties with value other than `none`:
+ [`transform`](../../transform)
+ [`filter`](../../filter)
+ [`backdrop-filter`](../../backdrop-filter)
+ [`perspective`](../../perspective)
+ [`clip-path`](../../clip-path)
+ [`mask`](../../mask) / [`mask-image`](../../mask-image) / [`mask-border`](../../mask-border)
* Element with an [`isolation`](../../isolation) value `isolate`.
* Element with a [`will-change`](../../will-change) value specifying any property that would create a stacking context on non-initial value (see [this post](https://dev.opera.com/articles/css-will-change-property/)).
* Element with a [`contain`](../../contain) value of `layout`, or `paint`, or a composite value that includes either of them (i.e. `contain: strict`, `contain: content`).
Within a stacking context, child elements are stacked according to the same rules explained just above. Importantly, the `z-index` values of its child stacking contexts only have meaning in this parent. Stacking contexts are treated atomically as a single unit in the parent stacking context.
In summary:
* Stacking contexts can be contained in other stacking contexts, and together create a hierarchy of stacking contexts.
* Each stacking context is completely independent of its siblings: only descendant elements are considered when stacking is processed.
* Each stacking context is self-contained: after the element's contents are stacked, the whole element is considered in the stacking order of the parent stacking context.
**Note:** The hierarchy of stacking contexts is a subset of the hierarchy of HTML elements because only certain elements create stacking contexts. We can say that elements that do not create their own stacking contexts are *assimilated* by the parent stacking context.
Example
-------
In this example, every positioned element creates its own stacking context, because of their positioning and `z-index` values. The hierarchy of [stacking contexts](the_stacking_context) is organized as follows:
* Root
+ DIV #1
+ DIV #2
+ DIV #3
- DIV #4
- DIV #5
- DIV #6
It is important to note that DIV #4, DIV #5 and DIV #6 are children of DIV #3, so stacking of those elements is completely resolved within DIV #3. Once stacking and rendering within DIV #3 is completed, the whole DIV #3 element is passed for stacking in the root element with respect to its sibling's DIV.
DIV #4 is rendered under DIV #1 because DIV #1's z-index (5) is valid within the stacking context of the root element, while DIV #4's z-index (6) is valid within the stacking context of DIV #3. So, DIV #4 is under DIV #1, because DIV #4 belongs to DIV #3, which has a lower z-index value.
For the same reason DIV #2 (`z-index`: 2) is rendered under DIV#5 (`z-index`: 1) because DIV #5 belongs to DIV #3, which has a higher z-index value.
DIV #3's z-index is 4, but this value is independent from z-index of DIV #4, DIV #5 and DIV #6, because it belongs to a different stacking context.
An easy way to figure out the *rendering order* of stacked elements along the z-axis is to think of it as a "version number" of sorts, where child elements are minor version numbers underneath their parent's major version numbers. This way we can easily see how an element with a z-index of 1 (DIV #5) is stacked above an element with a z-index of 2 (DIV #2), and how an element with a z-index of 6 (DIV #4) is stacked below an element with a z-index of 5 (DIV #1).
In our example (sorted according to the final rendering order):
* Root
+ DIV #2: (`z-index`: 2)
+ DIV #3: (`z-index`: 4)
- DIV #5: (`z-index`: 1), stacked under an element (`z-index`: 4), which results in a rendering order of 4.1
- DIV #6: (`z-index`: 3), stacked under an element (`z-index`: 4), which results in a rendering order of 4.3
- DIV #4: (`z-index`: 6), stacked under an element (`z-index`: 4), which results in a rendering order of 4.6
+ DIV #1: (`z-index`: 5)
### HTML
```
<div id="div1">
<h1>Division Element #1</h1>
<code>
position: relative;<br />
z-index: 5;
</code>
</div>
<div id="div2">
<h1>Division Element #2</h1>
<code>
position: relative;<br />
z-index: 2;
</code>
</div>
<div id="div3">
<div id="div4">
<h1>Division Element #4</h1>
<code>
position: relative;<br />
z-index: 6;
</code>
</div>
<h1>Division Element #3</h1>
<code>
position: absolute;<br />
z-index: 4;
</code>
<div id="div5">
<h1>Division Element #5</h1>
<code>
position: relative;<br />
z-index: 1;
</code>
</div>
<div id="div6">
<h1>Division Element #6</h1>
<code>
position: absolute;<br />
z-index: 3;
</code>
</div>
</div>
```
### CSS
```
\* {
margin: 0;
}
html {
padding: 20px;
font: 12px/20px Arial, sans-serif;
}
div {
opacity: 0.7;
position: relative;
}
h1 {
font: inherit;
font-weight: bold;
}
#div1,
#div2 {
border: 1px dashed #696;
padding: 10px;
background-color: #cfc;
}
#div1 {
z-index: 5;
margin-bottom: 190px;
}
#div2 {
z-index: 2;
}
#div3 {
z-index: 4;
opacity: 1;
position: absolute;
top: 40px;
left: 180px;
width: 330px;
border: 1px dashed #900;
background-color: #fdd;
padding: 40px 20px 20px;
}
#div4,
#div5 {
border: 1px dashed #996;
background-color: #ffc;
}
#div4 {
z-index: 6;
margin-bottom: 15px;
padding: 25px 10px 5px;
}
#div5 {
z-index: 1;
margin-top: 15px;
padding: 5px 10px;
}
#div6 {
z-index: 3;
position: absolute;
top: 20px;
left: 180px;
width: 150px;
height: 125px;
border: 1px dashed #009;
padding-top: 125px;
background-color: #ddf;
text-align: center;
}
```
Result
------
See also
--------
* [Stacking without the z-index property](stacking_without_z-index): The stacking rules that apply when `z-index` is not used.
* [Stacking with floated blocks](stacking_and_float): How floating elements are handled with stacking.
* [Using z-index](adding_z-index): How to use `z-index` to change default stacking.
* [Stacking context example 1](stacking_context_example_1): 2-level HTML hierarchy, `z-index` on the last level
* [Stacking context example 2](stacking_context_example_2): 2-level HTML hierarchy, `z-index` on all levels
* [Stacking context example 3](stacking_context_example_3): 3-level HTML hierarchy, `z-index` on the second level
css Stacking with floated blocks Stacking with floated blocks
============================
For floated elements, the stacking order is a bit different. Floating elements are placed between non-positioned elements and positioned elements:
1. The background and borders of the root element.
2. Descendant non-positioned elements, in order of appearance in the HTML.
3. *Floating elements*.
4. Descendant positioned elements, in order of appearance in the HTML.
See [types of positioning](../../position#types_of_positioning) for an explanation of positioned and non-positioned elements.
**Note:** If an `opacity` value is applied to a non-positioned element (i.e., DIV #4 in the example below), something strange happens: the background and border of that block pop up above the floating blocks and the positioned blocks. This is due to a peculiar part of the specification: applying an `opacity` value creates a new stacking context (see [What No One Told You About Z-Index](https://philipwalton.com/articles/what-no-one-told-you-about-z-index/)).
Example
-------
You can see in this example that the background and border of the non-positioned element (DIV #4) is completely unaffected by floating elements, but the content is affected. This happens according to standard float behavior which can be shown with a rule added to the above list:
1. The background and borders of the root element.
2. Descendant non-positioned elements, in order of appearance in the HTML.
3. Floating elements.
4. *Descendant non-positioned inline elements*.
5. Descendant positioned elements, in order of appearance in the HTML.
### HTML
```
<div id="abs1"><strong>DIV #1</strong><br />position: absolute;</div>
<div id="flo1"><strong>DIV #2</strong><br />float: left;</div>
<div id="flo2"><strong>DIV #3</strong><br />float: right;</div>
<br />
<div id="sta1"><strong>DIV #4</strong><br />no positioning</div>
<div id="abs2"><strong>DIV #5</strong><br />position: absolute;</div>
<div id="rel1"><strong>DIV #6</strong><br />position: relative;</div>
```
### CSS
```
div {
padding: 10px;
text-align: center;
}
strong {
font-family: sans-serif;
}
#abs1 {
position: absolute;
width: 150px;
height: 200px;
top: 10px;
right: 140px;
border: 1px dashed #900;
background-color: #fdd;
}
#sta1 {
height: 100px;
border: 1px dashed #996;
background-color: #ffc;
margin: 0px 10px 0px 10px;
text-align: left;
}
#flo1 {
margin: 0px 10px 0px 20px;
float: left;
width: 150px;
height: 200px;
border: 1px dashed #090;
background-color: #cfc;
}
#flo2 {
margin: 0px 20px 0px 10px;
float: right;
width: 150px;
height: 200px;
border: 1px dashed #090;
background-color: #cfc;
}
#abs2 {
position: absolute;
width: 150px;
height: 100px;
top: 80px;
left: 100px;
border: 1px dashed #990;
background-color: #fdd;
}
#rel1 {
position: relative;
border: 1px dashed #996;
background-color: #cff;
margin: 0px 10px 0px 10px;
text-align: left;
}
```
Result
------
See also
--------
* [Stacking without the z-index property](stacking_without_z-index): The stacking rules that apply when `z-index` is not used.
* [Using z-index](adding_z-index): How to use `z-index` to change default stacking.
* [The stacking context](the_stacking_context): Notes on the stacking context.
* [Stacking context example 1](stacking_context_example_1): 2-level HTML hierarchy, z-index on the last level
* [Stacking context example 2](stacking_context_example_2): 2-level HTML hierarchy, z-index on all levels
* [Stacking context example 3](stacking_context_example_3): 3-level HTML hierarchy, z-index on the second level
| programming_docs |
css Auto-placement in grid layout Auto-placement in grid layout
=============================
In addition to the ability to place items accurately onto a created grid, the CSS Grid Layout specification contains rules that control what happens when you create a grid and do not place some or all of the child items. You can see auto-placement in action in the simplest of ways by creating a grid on a set of items.
Default placement
-----------------
If you give the items no placement information they will position themselves on the grid, one in each grid cell.
```
.wrapper {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 10px;
}
```
```
<div class="wrapper">
<div>One</div>
<div>Two</div>
<div>Three</div>
<div>Four</div>
<div>Five</div>
</div>
```
Default rules for auto-placement
--------------------------------
As you can see with the above example, if you create a grid all child items will lay themselves out one into each grid cell. The default flow is to arrange items by row. Grid will lay an item out into each cell of row 1. If you have created additional rows using the `grid-template-rows` property then grid will continue placing items in these rows. If the grid does not have enough rows in the explicit grid to place all of the items new *implicit* rows will be created.
### Sizing rows in the implicit grid
The default for automatically created rows in the implicit grid is for them to be auto-sized. This means that they will contain the content added to them without causing an overflow.
You can however control the size of these rows with the property `grid-auto-rows`. To cause all created rows to be 100 pixels tall for example you would use:
```
<div class="wrapper">
<div>One</div>
<div>Two</div>
<div>Three</div>
<div>Four</div>
<div>Five</div>
</div>
```
```
.wrapper {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 10px;
grid-auto-rows: 100px;
}
```
### Sizing rows using minmax()
You can use [`minmax()`](../minmax) in your value for [`grid-auto-rows`](../grid-auto-rows) enabling the creation of rows that are a minimum size but then grow to fit content if it is taller.
```
<div class="wrapper">
<div>One</div>
<div>Two</div>
<div>Three</div>
<div>
Four <br />This cell <br />Has extra <br />content. <br />Max is auto
<br />so the row expands.
</div>
<div>Five</div>
</div>
```
```
.wrapper {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 10px;
grid-auto-rows: minmax(100px, auto);
}
```
### Sizing rows using a track listing
You can also pass in a track listing, this will repeat. The following track listing will create an initial implicit row track as 100 pixels and a second as `200px`. This will continue for as long as content is added to the implicit grid.
```
<div class="wrapper">
<div>One</div>
<div>Two</div>
<div>Three</div>
<div>Four</div>
<div>Five</div>
<div>Six</div>
<div>Seven</div>
<div>Eight</div>
</div>
```
```
.wrapper {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 10px;
grid-auto-rows: 100px 200px;
}
```
### Auto-placement by column
You can also ask grid to auto-place items by column. Using the property [`grid-auto-flow`](../grid-auto-flow) with a value of `column`. In this case grid will add items in rows that you have defined using [`grid-template-rows`](../grid-template-rows). When it fills up a column it will move onto the next explicit column, or create a new column track in the implicit grid. As with implicit row tracks, these column tracks will be auto sized. You can control the size of implicit column tracks with [`grid-auto-columns`](../grid-auto-columns), this works in the same way as [`grid-auto-rows`](../grid-auto-rows).
In this next example I have created a grid with three row tracks of 200 pixels height. I am auto-placing by column and the columns created will be a column width of 300 pixels, then a column width of 100 pixels until there are enough column tracks to hold all of the items.
```
.wrapper {
display: grid;
grid-template-rows: repeat(3, 200px);
gap: 10px;
grid-auto-flow: column;
grid-auto-columns: 300px 100px;
}
```
```
<div class="wrapper">
<div>One</div>
<div>Two</div>
<div>Three</div>
<div>Four</div>
<div>Five</div>
<div>Six</div>
<div>Seven</div>
<div>Eight</div>
</div>
```
The order of auto placed items
------------------------------
A grid can contain a mixture of items. Some of the items may have a position on the grid, but others may be auto-placed. This can be helpful, if you have a document order that reflects the order in which items sit on the grid you may not need to write CSS rules to place absolutely everything. The specification contains a long section detailing the [Grid item placement algorithm](https://drafts.csswg.org/css-grid/#auto-placement-algo), however for most of us we just need to remember a few simple rules for our items.
### Order modified document order
Grid places items that have not been given a grid position in what is described in the specification as "order modified document order". This means that if you have used the `order` property at all, the items will be placed by that order, not their DOM order. Otherwise they will stay by default in the order that they are entered in the document source.
### Items with placement properties
The first thing grid will do is place any items that have a position. In the example below I have 12 grid items. Item 2 and item 5 have been placed using line based placement on the grid. You can see how those items are placed and the other items then auto-place in the spaces. The auto-placed items will place themselves before the placed items in DOM order, they don't start after the position of a placed item that comes before them.
```
<div class="wrapper">
<div>One</div>
<div>Two</div>
<div>Three</div>
<div>Four</div>
<div>Five</div>
<div>Six</div>
<div>Seven</div>
<div>Eight</div>
<div>Nine</div>
<div>Ten</div>
<div>Eleven</div>
<div>Twelve</div>
</div>
```
```
.wrapper {
display: grid;
grid-template-columns: repeat(4, 1fr);
grid-auto-rows: 100px;
gap: 10px;
}
.wrapper div:nth-child(2) {
grid-column: 3;
grid-row: 2 / 4;
}
.wrapper div:nth-child(5) {
grid-column: 1 / 3;
grid-row: 1 / 3;
}
```
### Deal with items that span tracks
You can use placement properties while still taking advantage of auto-placement. In this next example I have added to the layout by setting odd items to span two tracks both for rows and columns. I do this with the [`grid-column-end`](../grid-column-end) and [`grid-row-end`](../grid-row-end) properties and setting the value of this to `span 2`. What this means is that the start line of the item will be set by auto-placement, and the end line will span two tracks.
You can see how this then leaves gaps in the grid, as for the auto-placed items if grid comes across an item that doesn't fit into a track, it will move to the next row until it finds a space the item can fit in.
```
<div class="wrapper">
<div>One</div>
<div>Two</div>
<div>Three</div>
<div>Four</div>
<div>Five</div>
<div>Six</div>
<div>Seven</div>
<div>Eight</div>
<div>Nine</div>
<div>Ten</div>
<div>Eleven</div>
<div>Twelve</div>
</div>
```
```
.wrapper {
display: grid;
grid-template-columns: repeat(4, 1fr);
grid-auto-rows: 100px;
gap: 10px;
}
.wrapper div:nth-child(4n + 1) {
grid-column-end: span 2;
grid-row-end: span 2;
background-color: #ffa94d;
}
.wrapper div:nth-child(2) {
grid-column: 3;
grid-row: 2 / 4;
}
.wrapper div:nth-child(5) {
grid-column: 1 / 3;
grid-row: 1 / 3;
}
```
### Filling in the gaps
So far, other than items we have specifically placed, grid is always progressing forward and keeping items in DOM order. This is generally what you want, if you are laying out a form for example you wouldn't want the labels and fields to become jumbled up in order to fill in some gap. However sometimes, we are laying things out that don't have a logical order and we would like to create a layout that doesn't have gaps in it.
To do this, add the property [`grid-auto-flow`](../grid-auto-flow) with a value of `dense` to the container. This is the same property you use to change the flow order to `column`, so if you were working in columns you would add both values `grid-auto-flow: column dense`.
Having done this, grid will now backfill the gaps, as it moves through the grid it leaves gaps as before, but then if it finds an item that will fit in a previous gap it will pick it up and take it out of DOM order to place it in the gap. As with any other reordering in grid this does not change the logical order. Tab order for example, will still follow the document order. We will take a look at the potential accessibility issues of Grid Layout in a later guide, but you should take care when creating this disconnect between the visual order and display order.
```
<div class="wrapper">
<div>One</div>
<div>Two</div>
<div>Three</div>
<div>Four</div>
<div>Five</div>
<div>Six</div>
<div>Seven</div>
<div>Eight</div>
<div>Nine</div>
<div>Ten</div>
<div>Eleven</div>
<div>Twelve</div>
</div>
```
```
.wrapper div:nth-child(4n + 1) {
grid-column-end: span 2;
grid-row-end: span 2;
background-color: #ffa94d;
}
.wrapper div:nth-child(2) {
grid-column: 3;
grid-row: 2 / 4;
}
.wrapper div:nth-child(5) {
grid-column: 1 / 3;
grid-row: 1 / 3;
}
.wrapper {
display: grid;
grid-template-columns: repeat(4, 1fr);
grid-auto-rows: 100px;
gap: 10px;
grid-auto-flow: dense;
}
```
### Anonymous grid items
There is a mention in the specification of anonymous grid items. These are created if you have a string of text inside your grid container, that is not wrapped in any other element. In the example below we have three grid items, assuming you had set the parent with a class of `grid` to `display: grid`. The first is an anonymous item as it has no enclosing markup, this item will always be dealt with via the auto-placement rules. The other two are grid items enclosed in a div, they might be auto-placed or you could place these with a positioning method onto your grid.
```
<div class="grid">
I am a string and will become an anonymous item
<div>A grid item</div>
<div>A grid item</div>
</div>
```
Anonymous items are always auto-placed because there is no way to target them. Therefore if you have some unwrapped text for some reason in your grid, be aware that it might show up somewhere unexpected as it will be auto-placed according to the auto-placement rules.
### Use cases for auto-placement
Auto-placement is useful whenever you have a collection of items. That could be items that do not have a logical order such as a gallery of photos, or product listing. In that case you might choose to use the dense packing mode to fill in any holes in your grid. In my image gallery example I have some landscape and some portrait images. I have set landscape images – with a class of `landscape` to span two column tracks. I then use `grid-auto-flow: dense` to create a densely packed grid.
Try removing the line `grid-auto-flow: dense` to see the content reflow to leave gaps in the layout.
Auto-placement can also help you lay out interface items which do have logical order. An example is the definition list in this next example. Definition lists are an interesting challenge to style as they are flat, there is nothing wrapping the groups of `dt` and `dd` items. In my example I am allowing auto-placement to place the items, however I have classes that start a `dt` in column 1, and `dd` in column 2, this ensure that terms go on one side and definitions on the other - no matter how many of each we have.
```
<div class="wrapper">
<dl>
<dt>Mammals</dt>
<dd>Cat</dd>
<dd>Dog</dd>
<dd>Mouse</dd>
<dt>Fish</dt>
<dd>Guppy</dd>
<dt>Birds</dt>
<dd>Pied Wagtail</dd>
<dd>Owl</dd>
</dl>
</div>
```
```
dl {
display: grid;
grid-template-columns: auto 1fr;
max-width: 300px;
margin: 1em;
line-height: 1.4;
}
dt {
grid-column: 1;
font-weight: bold;
}
dd {
grid-column: 2;
}
```
What can't we do with auto-placement (yet)?
-------------------------------------------
There are a couple of things that often come up as questions. Currently we can't do things like target every other cell of the grid with our items. A related issue may have already come to mind if you followed the last guide about named lines on the grid. It would be to define a rule that said "auto-place items against the next line named "n", and grid would then skip other lines. There is [an issue raised about this](https://github.com/w3c/csswg-drafts/issues/796) on the CSSWG GitHub repository, and you would be welcome to add your own use cases to this.
It may be that you come up with your own use cases for auto-placement or any other part of grid layout. If you do, raise them as issues or add to an existing issue that could solve your use case. This will help to make future versions of the specification better.
css Basic concepts of grid layout Basic concepts of grid layout
=============================
[CSS Grid Layout](../css_grid_layout) introduces a two-dimensional grid system to CSS. Grids can be used to lay out major page areas or small user interface elements. This article introduces the CSS Grid Layout and the new terminology that is part of the CSS Grid Layout Level 1 specification. The features shown in this overview will then be explained in greater detail in the rest of this guide.
What is a grid?
---------------
A grid is a set of intersecting horizontal and vertical lines defining columns and rows. Elements can be placed onto the grid within these column and row lines. CSS grid layout has the following features:
### Fixed and flexible track sizes
You can create a grid with fixed track sizes – using pixels for example. This sets the grid to the specified pixel which fits to the layout you desire. You can also create a grid using flexible sizes with percentages or with the `fr` unit designed for this purpose.
### Item placement
You can place items into a precise location on the grid using line numbers, names or by targeting an area of the grid. Grid also contains an algorithm to control the placement of items not given an explicit position on the grid.
### Creation of additional tracks to hold content
You can define an explicit grid with grid layout. The Grid Layout specification is flexible enough to add additional rows and columns when needed. Features such as adding "as many columns that will fit into a container" are included.
### Alignment control
Grid contains alignment features so we can control how the items align once placed into a grid area, and how the entire grid is aligned.
### Control of overlapping content
More than one item can be placed into a grid cell or area and they can partially overlap each other. This layering may then be controlled with the [`z-index`](../z-index) property.
Grid is a powerful specification that, when combined with other parts of CSS such as [flexbox](../css_flexible_box_layout), can help you create layouts that were previously impossible to build in CSS. It all starts by creating a grid in your **grid container**.
Grid container
--------------
We create a *grid container* by declaring `display: grid` or `display: inline-grid` on an element. As soon as we do this, all *direct children* of that element become *grid items*.
In this example, I have a containing div with a class of wrapper and, inside are five child elements.
```
<div class="wrapper">
<div>One</div>
<div>Two</div>
<div>Three</div>
<div>Four</div>
<div>Five</div>
</div>
```
I make the `.wrapper` a grid container.
```
.wrapper {
display: grid;
}
```
All the direct children are now grid items. In a web browser, you won't see any difference to how these items are displayed before turning them into a grid, as grid has created a single column grid for the items. At this point, you may find it useful to work with the [Grid Inspector](https://firefox-source-docs.mozilla.org/devtools-user/page_inspector/how_to/examine_grid_layouts/index.html), available as part of Firefox's Developer Tools. If you view this example in Firefox and inspect the grid, you will see a small icon next to the value `grid`. Click this and then the grid on this element will be overlaid in the browser window.
As you learn and then work with the CSS Grid Layout, this tool will give you a better idea of what is happening with your grids visually.
If we want to start making this more grid-like we need to add column tracks.
Grid tracks
-----------
We define rows and columns on our grid with the [`grid-template-rows`](../grid-template-rows) and [`grid-template-columns`](../grid-template-columns) properties. These define grid tracks. A *grid track* is the space between any two adjacent lines on the grid. The image below shows a highlighted track – this is the first-row track in our grid.
Grid tracks are defined in the explicit grid by using the `grid-template-columns` and `grid-template-rows` properties or the shorthand `grid` or `grid-template` properties. Tracks are also created in the implicit grid by positioning a grid item outside of the tracks created in the explicit grid.
### Basic example
I can add to our earlier example by adding the `grid-template-columns` property, then defining the size of the column tracks.
I have now created a grid with three 200-pixel-wide column tracks. The child items will be laid out on this grid one in each grid cell.
```
<div class="wrapper">
<div>One</div>
<div>Two</div>
<div>Three</div>
<div>Four</div>
<div>Five</div>
</div>
```
```
.wrapper {
display: grid;
grid-template-columns: 200px 200px 200px;
}
```
### The fr unit
Tracks can be defined using any length unit. Grid also introduces an additional length unit to help us create flexible grid tracks. The new `fr` unit represents a fraction of the available space in the grid container. The next grid definition would create three equal width tracks that grow and shrink according to the available space.
```
<div class="wrapper">
<div>One</div>
<div>Two</div>
<div>Three</div>
<div>Four</div>
<div>Five</div>
</div>
```
```
.wrapper {
display: grid;
grid-template-columns: 1fr 1fr 1fr;
}
```
### Unequal sizes
In this next example, we create a definition with a `2fr` track then two `1fr` tracks. The available space is split into four. Two parts are given to the first track and one part each to the next two tracks.
```
<div class="wrapper">
<div>One</div>
<div>Two</div>
<div>Three</div>
<div>Four</div>
<div>Five</div>
</div>
```
```
.wrapper {
display: grid;
grid-template-columns: 2fr 1fr 1fr;
}
```
### Mixing flexible and absolute sizes
In this final example, we mix absolute sized tracks with `fr` units. The first track is 500 pixels, so the fixed width is taken away from the available space. The remaining space is divided into three and assigned in proportion to the two flexible tracks.
```
<div class="wrapper">
<div>One</div>
<div>Two</div>
<div>Three</div>
<div>Four</div>
<div>Five</div>
</div>
```
```
.wrapper {
display: grid;
grid-template-columns: 500px 1fr 2fr;
}
```
### Track listings with repeat() notation
Large grids with many tracks can use the `repeat()` notation, to repeat all or a section of the track listing. For example the grid definition:
```
.wrapper {
display: grid;
grid-template-columns: 1fr 1fr 1fr;
}
```
Can also be written as:
```
.wrapper {
display: grid;
grid-template-columns: repeat(3, 1fr);
}
```
Repeat notation can be used for a part of the track listing. In this next example I have created a grid with an initial 20-pixel track, then a repeating section of 6 `1fr` tracks then a final 20-pixel track.
```
.wrapper {
display: grid;
grid-template-columns: 20px repeat(6, 1fr) 20px;
}
```
Repeat notation takes the track listing, and uses it to create a repeating pattern of tracks. In this next example, my grid will consist of 10 tracks, a `1fr` track, and then followed by a `2fr` track. This pattern will be repeated five times.
```
.wrapper {
display: grid;
grid-template-columns: repeat(5, 1fr 2fr);
}
```
### Implicit and explicit grids
When creating our example grid we specifically defined our column tracks with the [`grid-template-columns`](../grid-template-columns) property, but the grid also created rows on its own. These rows are part of the implicit grid. Whereas the explicit grid consists of any rows and columns defined with [`grid-template-columns`](../grid-template-columns) or [`grid-template-rows`](../grid-template-rows).
If you place something outside of the defined grid—or due to the amount of content, more grid tracks are needed—then the grid creates rows and columns in the implicit grid. These tracks will be auto-sized by default, resulting in their size being based on the content that is inside them.
You can also define a set size for tracks created in the implicit grid with the [`grid-auto-rows`](../grid-auto-rows) and [`grid-auto-columns`](../grid-auto-columns) properties.
In the below example, we use `grid-auto-rows` to ensure that tracks created in the implicit grid are 200 pixels tall.
```
<div class="wrapper">
<div>One</div>
<div>Two</div>
<div>Three</div>
<div>Four</div>
<div>Five</div>
</div>
```
```
.wrapper {
display: grid;
grid-template-columns: repeat(3, 1fr);
grid-auto-rows: 200px;
}
```
### Track sizing and minmax
When setting up an explicit grid or defining the sizing for automatically created rows or columns we may want to give tracks a minimum size, but also ensure they expand to fit any content that is added. For example, I may want my rows to never collapse smaller than 100 pixels, but if my content stretches to 300 pixels in height, then I would like the row to stretch to that height.
Grid has a solution for this with the [`minmax()`](../minmax) function. In this next example I am using `minmax()` in the value of [`grid-auto-rows`](../grid-auto-rows). This means automatically created rows will be a minimum of 100 pixels tall, and a maximum of `auto`. Using `auto` means that the size will look at the content size and will stretch to give space for the tallest item in a cell, in this row.
```
.wrapper {
display: grid;
grid-template-columns: repeat(3, 1fr);
grid-auto-rows: minmax(100px, auto);
}
```
```
<div class="wrapper">
<div>One</div>
<div>
Two
<p>I have some more content in.</p>
<p>This makes me taller than 100 pixels.</p>
</div>
<div>Three</div>
<div>Four</div>
<div>Five</div>
</div>
```
Grid lines
----------
It should be noted that when we define a grid we define the grid tracks, not the lines. Grid then gives us numbered lines to use when positioning items. In our three column, two row grid we have four column lines.
Lines are numbered according to the writing mode of the document. In a left-to-right language, line 1 is on the left-hand side of the grid. In a right-to-left language, it is on the right-hand side of the grid. Lines can also be named, and we will look at how to do this in a later guide in this series.
### Positioning items against lines
We will be exploring line based placement in full detail in a later article. The following example demonstrates doing this in a simple way. When placing an item, we target the line – rather than the track.
In the following example I am placing the first two items on our three column track grid, using the [`grid-column-start`](../grid-column-start), [`grid-column-end`](../grid-column-end), [`grid-row-start`](../grid-row-start) and [`grid-row-end`](../grid-row-end) properties. Working from left to right, the first item is placed against column line 1, and spans to column line 4, which in our case is the far-right line on the grid. It begins at row line 1 and ends at row line 3, therefore spanning two row tracks.
The second item starts on grid column line 1, and spans one track. This is the default so I do not need to specify the end line. It also spans two row tracks from row line 3 to row line 5. The other items will place themselves into empty spaces on the grid.
```
<div class="wrapper">
<div class="box1">One</div>
<div class="box2">Two</div>
<div class="box3">Three</div>
<div class="box4">Four</div>
<div class="box5">Five</div>
</div>
```
```
.wrapper {
display: grid;
grid-template-columns: repeat(3, 1fr);
grid-auto-rows: 100px;
}
.box1 {
grid-column-start: 1;
grid-column-end: 4;
grid-row-start: 1;
grid-row-end: 3;
}
.box2 {
grid-column-start: 1;
grid-row-start: 3;
grid-row-end: 5;
}
```
**Note:** Don't forget that you can use the [Grid Inspector](https://firefox-source-docs.mozilla.org/devtools-user/page_inspector/how_to/examine_grid_layouts/index.html) in Firefox Developer Tools to see how the items are positioned against the lines of the grid.
### Line-positioning shorthands
The longhand values used above can be compressed onto one line for columns with [`grid-column`](../grid-column), and one line for rows with [`grid-row`](../grid-row). The following example would give the same positioning as in the previous code, but with far less CSS. The value before the forward slash character (`/`) is the start line, the value after the end line.
You can omit the end value if the area only spans one track.
```
.wrapper {
display: grid;
grid-template-columns: repeat(3, 1fr);
grid-auto-rows: 100px;
}
.box1 {
grid-column: 1 / 4;
grid-row: 1 / 3;
}
.box2 {
grid-column: 1;
grid-row: 3 / 5;
}
```
Grid cells
----------
A *grid cell* is the smallest unit on a grid. Conceptually it is like a table cell. As we saw in our earlier examples, once a grid is defined as a parent the child items will lay themselves out in one cell each of the defined grid. In the below image, I have highlighted the first cell of the grid.
Grid areas
----------
Items can span one or more cells both by row or by column, and this creates a *grid area*. Grid areas must be rectangular – it isn't possible to create an L-shaped area for example. The highlighted grid area spans two row and two column tracks.
Gutters
-------
*Gutters* or *alleys* between grid cells can be created using the [`column-gap`](../column-gap) and [`row-gap`](../row-gap) properties, or the shorthand [`gap`](../gap). In the below example, I am creating a 10-pixel gap between columns and a `1em` gap between rows.
```
.wrapper {
display: grid;
grid-template-columns: repeat(3, 1fr);
column-gap: 10px;
row-gap: 1em;
}
```
**Note:** When grid first shipped in browsers the [`column-gap`](../column-gap), [`row-gap`](../row-gap) and [`gap`](../gap) were prefixed with the `grid-` prefix as `grid-column-gap`, `grid-row-gap` and `grid-gap` respectively.
Browsers all now support unprefixed values, however the prefixed versions will be maintained as aliases making them safe to use.
```
<div class="wrapper">
<div>One</div>
<div>Two</div>
<div>Three</div>
<div>Four</div>
<div>Five</div>
</div>
```
Any space used by gaps will be accounted for before space is assigned to the flexible length `fr` tracks, and gaps act for sizing purposes like a regular grid track, however you cannot place anything into a gap. In terms of line-based positioning, the gap acts like a thick line.
Nesting grids
-------------
A grid item can become a grid container. In the following example, I have the three-column grid that I created earlier, with our two positioned items. In this case the first item has some sub-items. As these items are not direct children of the grid they do not participate in grid layout and so display in a normal document flow.
### Nesting without subgrid
If I set `box1` to `display: grid` I can give it a track definition and it too will become a grid. The items then lay out on this new grid.
```
.box1 {
grid-column-start: 1;
grid-column-end: 4;
grid-row-start: 1;
grid-row-end: 3;
display: grid;
grid-template-columns: repeat(3, 1fr);
}
```
```
\* {
box-sizing: border-box;
}
.wrapper {
border: 2px solid #f76707;
border-radius: 5px;
gap: 3px;
background-color: #fff4e6;
display: grid;
grid-template-columns: repeat(3, 1fr);
}
.box {
border: 2px solid #ffa94d;
border-radius: 5px;
background-color: #ffd8a8;
padding: 1em;
color: #d9480f;
}
.box1 {
grid-column: 1 / 4;
}
.nested {
border: 2px solid #ffec99;
border-radius: 5px;
background-color: #fff9db;
padding: 1em;
}
```
In this case the nested grid has no relationship to the parent. As you can see in the example it has not inherited the [`gap`](../gap) of the parent and the lines in the nested grid do not align to the lines in the parent grid.
### Subgrid
In the working draft of the Level 2 Grid specification there is a feature called *subgrid*, which would let us create nested grids that use the track definition of the parent grid.
**Note:** This feature shipped in Firefox 71, which is currently the only browser to implement subgrid.
In the current specification, we would edit the above nested grid example to change the track definition of `grid-template-columns: repeat(3, 1fr)`, to `grid-template-columns: subgrid`. The nested grid will then use the parent grid tracks to layout items.
```
.box1 {
grid-column-start: 1;
grid-column-end: 4;
grid-row-start: 1;
grid-row-end: 3;
display: grid;
grid-template-columns: subgrid;
}
```
Layering items with z-index
---------------------------
Grid items can occupy the same cell, and in this case we can use the [`z-index`](../z-index) property to control the order in which overlapping items stack.
### Overlapping without z-index
If we return to our example with items positioned by line number, we can change this to make two items overlap.
```
<div class="wrapper">
<div class="box box1">One</div>
<div class="box box2">Two</div>
<div class="box box3">Three</div>
<div class="box box4">Four</div>
<div class="box box5">Five</div>
</div>
```
```
.wrapper {
display: grid;
grid-template-columns: repeat(3, 1fr);
grid-auto-rows: 100px;
}
.box1 {
grid-column-start: 1;
grid-column-end: 4;
grid-row-start: 1;
grid-row-end: 3;
}
.box2 {
grid-column-start: 1;
grid-row-start: 2;
grid-row-end: 4;
}
```
The item `box2` is now overlapping `box1`, it displays on top as it comes later in the source order.
### Controlling the order
We can control the order in which items stack up by using the `z-index` property - just like positioned items. If we give `box2` a lower `z-index` than `box1` it will display below `box1` in the stack.
```
.wrapper {
display: grid;
grid-template-columns: repeat(3, 1fr);
grid-auto-rows: 100px;
}
.box1 {
grid-column-start: 1;
grid-column-end: 4;
grid-row-start: 1;
grid-row-end: 3;
z-index: 2;
}
.box2 {
grid-column-start: 1;
grid-row-start: 2;
grid-row-end: 4;
z-index: 1;
}
```
Next steps
----------
In this article, we took a very quick look at the possibilities of grid layouts. Explore and play with the code examples, and then move on to [the next part of this guide](relationship_of_grid_layout), where we will really start to dig into the details of CSS Grid Layout.
| programming_docs |
css Grids, logical values, and writing modes Grids, logical values, and writing modes
========================================
In these guides, I have already touched on an important feature of grid layout: the support for different writing modes that is built into the specification. For this guide, we will look at this feature of grid and other modern layout methods, learning a little about writing modes and logical vs. physical properties as we do so.
Logical and physical properties and values
------------------------------------------
CSS is full of **physical** positioning keywords – left and right, top and bottom. If we position an item using absolute positioning, we use these physical keywords as offset values to push the item around. In the code snippet below, the item is placed 20 pixels from the top, and 30 pixels from the left of the container:
```
.container {
position: relative;
}
.item {
position: absolute;
top: 20px;
left: 30px;
}
```
```
<div class="container">
<div class="item">Item</div>
</div>
```
Another place you might see physical keywords in use, is when using `text-align: right` to align text to the right. There are also physical **properties** in CSS. We add margins, padding, and borders using these physical properties of [`margin-left`](../margin-left), [`padding-left`](../padding-left), and so on.
We call these keywords and properties *physical* because they relate to the screen you are looking at. Left is always left, no matter what direction your text is running.
This can become an issue when developing a site that has to work in multiple languages, including languages that have text starting on the right, rather than the left. Browsers are pretty good at dealing with text direction, and you don't even need to be working in a [rtl](https://developer.mozilla.org/en-US/docs/Glossary/RTL) language to take a look. In the example below, I have two paragraphs. The first paragraph has [`text-align`](../text-align) set to `left`, the second has no `text-align` property set. I have added `dir="rtl"` to the `html` element, which switches the writing mode from the default for an English language document of `ltr`. You can see that the first paragraph remains left to right, due to the `text-align` value being `left`. The second however, switches direction and the text runs from right to left .
This is a very simple example of the problem with physical values and properties being used in CSS. They prevent the browser being able to do the work to switch writing mode, as they make the assumption that the text is flowing left to right and top to bottom.
### Logical properties and values
Logical properties and values do not make an assumption about text direction. Which is why in Grid Layout we use the keyword `start` when aligning something to the start of the container. For me, working in English, `start` may well be on the left, however it doesn't have to be, and the word `start` infers no physical location.
Block and Inline
----------------
Once we begin dealing with logical, rather than physical properties, we stop seeing the world as left to right, and top to bottom. We need a new reference point, and this is where understanding the *block* and *inline* axes, that we met previously in the guide to *alignment*, becomes very useful. If you can start to see layout in terms of block and inline, the way things work in grid start to make a lot more sense.
CSS writing modes
-----------------
I'm going to introduce another specification here, that I will be using in my examples: the CSS Writing Modes specification. This spec details how we can use these different writing modes in CSS, not just for the support of languages that have a different writing mode to English, but also for creative purposes. I'll be using the [`writing-mode`](../writing-mode) property to make changes to the writing mode applied to our grid, in order to demonstrate how the logical values work. If you want to dig into writing modes further, however, then I would recommend that you read Jen Simmons excellent article on [CSS Writing Modes](https://24ways.org/2016/css-writing-modes/). This goes into more depth on that specification than we will touch upon here.
### writing-mode
Writing Modes are more than just left to right and right to left text, and the `writing-mode` property helps us display text running in other directions. The [`writing-mode`](../writing-mode) property can have values of:
* `horizontal-tb`
* `vertical-rl`
* `vertical-lr`
* `sideways-rl`
* `sideways-lr`
The value `horizontal-tb` is the default for text on the web. It is the direction in which you are reading this guide. The other properties will change the way that text flows in our document, matching the different writing modes found around the world. Again, for full details of these see [Jen's article](https://24ways.org/2016/css-writing-modes/). As a simple example, I have two paragraphs below. The first uses the default `horizontal-tb`, and the second uses `vertical-rl`. In the mode text still runs left to right, however the direction of the text is vertical - inline text now runs down the page, from top to bottom.
```
<div class="wrapper">
<p style="writing-mode: horizontal-tb">
I have writing mode set to the default <code>horizontal-tb</code>
</p>
<p style="writing-mode: vertical-rl">
I have writing mode set to <code>vertical-rl</code>
</p>
</div>
```
Writing modes in grid layouts
-----------------------------
If we now take a look at a grid layout example, we can see how changing the writing mode means changing our idea of where the Block and Inline Axis are.
### Default writing mode
The grid in this example has three columns and two row tracks. This means there are three tracks running down the block axis. In default writing mode, grid auto-places items starting at the top left, moving along to the right, filling up the three cells on the inline axis. It then moves onto the next line, creating a new Row track, and fills in more items:
```
.wrapper {
display: grid;
grid-template-columns: repeat(3, 100px);
grid-template-rows: repeat(2, 100px);
gap: 10px;
}
```
```
<div class="wrapper">
<div class="item1">Item 1</div>
<div class="item2">Item 2</div>
<div class="item3">Item 3</div>
<div class="item4">Item 4</div>
<div class="item5">Item 5</div>
</div>
```
### Setting writing mode
If we add `writing-mode: vertical-lr` to the grid container, we can see that the block and inline Axis are now running in a different direction. The block or *column* axis now runs across the page from left to right, Inline runs down the page, creating rows from top to bottom.
```
.wrapper {
writing-mode: vertical-lr;
display: grid;
grid-template-columns: repeat(3, 100px);
grid-template-rows: repeat(2, 100px);
gap: 10px;
}
```
```
<div class="wrapper">
<div class="item1">Item 1</div>
<div class="item2">Item 2</div>
<div class="item3">Item 3</div>
<div class="item4">Item 4</div>
<div class="item5">Item 5</div>
</div>
```
Logical values for alignment
----------------------------
With the block and inline axis able to change direction, the logical values for the alignment properties start to make more sense.
In this next example, I am using alignment to align items inside a grid that is set to `writing-mode: vertical-lr`. The `start` and `end` properties work in exactly the same way that they do in the default writing mode, and remain logical in a way that using left and right, top and bottom to align items would not do. This occurs once we've flipped the grid onto the side, like this:
```
.wrapper {
writing-mode: vertical-lr;
display: grid;
grid-template-columns: repeat(3, 1fr);
grid-template-rows: repeat(3, 100px);
gap: 10px;
}
.item1 {
grid-column: 1 / 4;
align-self: start;
}
.item2 {
grid-column: 1 / 3;
grid-row: 2 / 4;
align-self: start;
}
.item3 {
grid-column: 3;
grid-row: 2 / 4;
align-self: end;
justify-self: end;
}
```
```
<div class="wrapper">
<div class="item1">Item 1</div>
<div class="item2">Item 2</div>
<div class="item3">Item 3</div>
</div>
```
If you want to see how these work, with a right to left as well as top to bottom writing mode, switch `vertical-lr` to `vertical-rl`, which is a vertical writing mode running from right to left.
Auto-placement and Writing Modes
--------------------------------
In the example already shown, you can see how writing mode changes the direction in which items place themselves onto the grid. Items will, by default, place themselves along the Inline axis then move onto a new row. However, that inline axis may not always run from left to right.
Line-based placement and Writing Modes
--------------------------------------
The key thing to remember when placing items by line number, is that line 1 is the start line, no matter which writing mode you are in. Line -1 is the end line, no matter which writing mode you are in.
### Line-based placement with left to right text
In this next example, I have a grid which is in the default `ltr` direction. I have positioned three items using line-based placement.
* Item 1 starts at column line 1, spanning one track.
* Item 2 starts at column line -1, spanning to -3.
* Item 3 starts at column line 1, spanning to column line 3.
```
.wrapper {
display: grid;
grid-template-columns: repeat(3, 1fr);
grid-template-rows: repeat(2, 100px);
gap: 10px;
}
.item1 {
grid-column: 1;
}
.item2 {
grid-column: -1 / -3;
}
.item3 {
grid-column: 1 / 3;
grid-row: 2;
}
```
```
<div class="wrapper">
<div class="item1">Item 1</div>
<div class="item2">Item 2</div>
<div class="item3">Item 3</div>
</div>
```
### Line-based placement with right to left text
If I now add the [`direction`](../direction) property with a value of `rtl` to the grid container, line 1 becomes the right-hand side of the grid, and line -1 on the left.
```
.wrapper {
direction: rtl;
display: grid;
grid-template-columns: repeat(3, 1fr);
grid-template-rows: repeat(2, 100px);
gap: 10px;
}
.item1 {
grid-column: 1;
}
.item2 {
grid-column: -1 / -3;
}
.item3 {
grid-column: 1 / 3;
grid-row: 2;
}
```
```
<div class="wrapper">
<div class="item1">Item 1</div>
<div class="item2">Item 2</div>
<div class="item3">Item 3</div>
</div>
```
What this demonstrates, is that if you are switching the direction of your text, either for entire pages or for parts of pages, and are using lines: you may want to name your lines, if you do not want the layout to completely switch direction. For some things, for example, where a grid contains text content, this switching may be exactly what you want. For other usage it may not.
### The strange order of values in the `grid-area` property
You can use the [`grid-area`](../grid-area) property to specify all four lines of a grid area as one value. When people first encounter this, they are often surprised that the values do not follow the same order as the shorthand for margin – which runs clockwise: top, right, bottom, left.
The order of `grid-area` values is:
* `grid-row-start`
* `grid-column-start`
* `grid-row-end`
* `grid-column-end`
Which for English, in left-to-right means the order is:
* `top`
* `left`
* `bottom`
* `right`
This is anti-clockwise! So the reverse of what we do for margins and padding. Once you realize that `grid-area` sees the world as "block and inline", you can remember that we are setting the two starts, then the two ends. It becomes much more logical once you know!
Mixed writing modes and grid layout
-----------------------------------
In addition to displaying documents, using the correct writing mode for the language, writing modes can be used creatively within documents that are otherwise `ltr`. In this next example I have a grid layout with a set of links down one side. I've used writing modes to turn these on their side in the column track:
```
.wrapper {
display: grid;
grid-gap: 20px;
grid-template-columns: 1fr auto;
font: 1em Helvetica, Arial, sans-serif;
}
.wrapper nav {
writing-mode: vertical-lr;
}
.wrapper ul {
list-style: none;
margin: 0;
padding: 1em;
display: flex;
justify-content: space-between;
}
.wrapper a {
text-decoration: none;
}
```
```
<div class="wrapper">
<div class="content">
<p>
Turnip greens yarrow ricebean rutabaga endive cauliflower sea lettuce
kohlrabi amaranth water spinach avocado daikon napa cabbage asparagus
winter purslane kale. Celery potato scallion desert raisin horseradish
spinach carrot soko. Lotus root water spinach fennel kombu maize bamboo
shoot green bean swiss chard seakale pumpkin onion chickpea gram corn pea.
Brussels sprout coriander water chestnut gourd swiss chard wakame kohlrabi
beetroot carrot watercress. Corn amaranth salsify bunya nuts nori azuki
bean chickweed potato bell pepper artichoke.
</p>
<p>
Nori grape silver beet broccoli kombu beet greens fava bean potato
quandong celery. Bunya nuts black-eyed pea prairie turnip leek lentil
turnip greens parsnip. Sea lettuce lettuce water chestnut eggplant winter
purslane fennel azuki bean earthnut pea sierra leone bologi leek soko
chicory celtuce parsley jícama salsify.
</p>
</div>
<nav>
<ul>
<li><a href="">Link 1</a></li>
<li><a href="">Link 2</a></li>
<li><a href="">Link 3</a></li>
</ul>
</nav>
</div>
```
Physical values and grid layout
-------------------------------
We encounter physical properties frequently when building websites, and while the grid placement and alignment properties and values respect writing modes, there are things you may want to do with Grid that force you to use physical properties and values. In the guide to [Box alignment and grids](box_alignment_in_css_grid_layout), I demonstrated how auto margins work in a grid area. Using an auto margin to push one item away from the others is a common flexbox trick too, however this also ties the layout to the physical space.
If you use absolute positioning within a grid area, then you will again be using physical offsets to push the item around inside the grid area. The key thing is to be aware of, is the tension between physical and logical properties and values. For example, be aware that you may need to make changes to your CSS to cope with a switch from `ltr` to `rtl`.
### Logical properties for everything!
Our new layout methods give us the ability to use these logical values to place items, however, as soon as we start to combine them with the physical properties used for margins and padding, we need to remember that those physical properties will not change according to writing mode.
The [CSS Logical Properties specification](https://drafts.csswg.org/css-logical/) means that you can use the [logical equivalents](../css_logical_properties) for properties, such as [`margin-left`](../margin-left) and [`margin-right`](../margin-right), in your CSS. These properties and values have good support in modern browsers. Your understanding of block and inline through grid will help you to understand how to use these too.
css CSS Grid Layout and progressive enhancement CSS Grid Layout and progressive enhancement
===========================================
In Spring of 2017, we saw for the first time a major specification like Grid being shipped into browsers almost simultaneously, and we now have CSS Grid Layout support in the public versions of Firefox, Chrome, Opera, Safari and Edge. However, while evergreen browsers mean that many of us are going to see the majority of users having Grid Layout support very quickly, there are also old or non-supporting browsers to contend with. In this guide we will walk through a variety of strategies for support.
The supporting browsers
-----------------------
Other than in Internet Explorer, CSS Grid Layout is unprefixed in Safari, Chrome, Opera, Firefox and Edge. Support for all the properties and values detailed in these guides is interoperable across browsers. This means that if you write some Grid Layout code in Firefox, it should work in the same way in Chrome. This is no longer an experimental specification, and you are safe to use it in production.
The Internet Explorer and Edge situation
----------------------------------------
It should be remembered that the original implementation of CSS Grid Layout happened in Internet Explorer 10. This early specification did not contain all of the properties and values that the up-to-date specification has. There are also substantial differences between what shipped in IE10 and the current specification, even where the properties and values appear the same. This early implementation is also the version of Grid Layout implemented in Edge up to version 15.
The IE/Edge (≤15) version of the specification is prefixed with an `-ms` prefix and the properties implemented in IE/Edge (≤15) are as follows:
* [`grid-template-columns`](../grid-template-columns) as `-ms-grid-columns`
* [`grid-template-rows`](../grid-template-rows) as `-ms-grid-rows`
* [`grid-row-start`](../grid-row-start) as `-ms-grid-row`
* [`grid-column-start`](../grid-column-start) as `-ms-grid-column`
* [`align-self`](../align-self) as `-ms-grid-row-align`
* [`justify-self`](../justify-self) as `-ms-grid-column-align`
The IE version has additional properties not required in the new specification of `-ms-grid-column-span` and `-ms-grid-row-span`. This version does not include auto-placement capability, or grid template areas. Some simple grid layouts could be implemented for IE10, through to Edge 15, using the `-ms` properties. As these properties are vendor prefixed, they will not effect any browser supporting the up to date and unprefixed specification.
### Autoprefixer grid layout support
If you are still supporting Internet Explorer, the popular tool *[Autoprefixer](https://github.com/postcss/autoprefixer)* has been updated to support the `-ms-` grid version. By default, grid prefixes are disabled, but you can enable it with `grid: true` option.
```
autoprefixer({ grid: 'autoplace' })
```
Grid prefixes are disabled by default because some properties can't be prefixed.
Is it safe to use CSS grids for my layout?
------------------------------------------
Yes. As with any front-end technology choice, the decision to use CSS Grid Layout will come down to the browsers your site visitors are typically using. If your site serves a market sector that is tied to older browsers, you may consider the above `-ms-` fallback for IE.
Starting to use Grid in production
----------------------------------
It is worth noting that you do not have to use grid in an *all or nothing* way. Start by enhancing elements in your design with grid, that could otherwise display using an older method. Overwriting of legacy methods with grid layout works surprisingly well, due to the way grid interacts with these other methods.
### Floats
[Floats](https://developer.mozilla.org/en-US/docs/Learn/CSS/CSS_layout/Floats) used to be used to create multiple column layouts. If you're supporting an old codebase with floated layouts, there will be no conflict. Grid items ignore the float property; the fact is that *a grid item takes precedence.* In the example below, I have a simple media object. If the [`float`](../float) is not removed from legacy CSS, as the container is a grid container, it's OK. We can use the alignment properties that are implemented in CSS Grids.
The [`float`](../float) no longer applies, and I can use the CSS Box Alignment property [`align-self`](../align-self) to align my content to the end of the container:
```
\* {box-sizing: border-box;}
img {
max-width: 100%;
display: block;
}
.media {
border: 2px solid #f76707;
border-radius: 5px;
background-color: #fff4e6;
max-width: 400px;
display: grid;
grid-template-columns: 1fr 2fr;
grid-template-areas: "img content";
margin-bottom: 1em;
}
.media::after {
content: "";
display: block;
clear: both;
}
.media .text {
padding: 10px;
align-self: end;
}
/\* old code we can't remove \*/
.media .image {
float: left;
width: 150px;
margin-right: 20px;
}
```
```
<div class="media">
<div class="image">
<img src="https://via.placeholder.com/150x150" alt="placeholder" />
</div>
<div class="text">
This is a media object example. I am using floats for older browsers and
grid for new ones.
</div>
</div>
```
The image below shows the media object in a non-supporting browser on the left, and a supporting one on the right:
### Using feature queries
The above example is very simple, and we can get away without needing to write code that would be a problem to browsers that do not support grid, and legacy code is not an issue to our grid supporting browsers. However, things are not always so simple.
#### A more complex example
In this next example, I have a set of floated cards. I have given the cards a [`width`](../width), in order to [`float`](../float) them. To create gaps between the cards, I use a [`margin`](../margin) on the items, and then a negative margin on the container:
```
.wrapper ul {
overflow: hidden;
margin: 0 -10px;
padding: 0;
list-style: none;
}
.wrapper li {
float: left;
width: calc(33.333333% - 20px);
margin: 0 10px 20px 10px;
}
```
```
<div class="wrapper">
<ul>
<li class="card">
<h2>One</h2>
<p>We can use CSS Grid to overwrite older methods.</p>
</li>
<li class="card">
<h2>Two</h2>
<p>We can use CSS Grid to overwrite older methods.</p>
</li>
<li class="card">
<h2>Three</h2>
<p>We can use CSS Grid to overwrite older methods.</p>
</li>
<li class="card">
<h2>Four</h2>
<p>We can use CSS Grid to overwrite older methods.</p>
</li>
<li class="card">
<h2>Five</h2>
<p>We can use CSS Grid to overwrite older methods.</p>
</li>
<li class="card">
<h2>Six</h2>
<p>We can use CSS Grid to overwrite older methods.</p>
</li>
</ul>
</div>
```
The example demonstrates the typical problem that we have with floated layouts: if additional content is added to any one card, the layout breaks.
As a concession for older browsers, I have set a [`min-height`](../min-height) on the items, and hope that my content editors won't add too much content and make a mess of the layout!
I then enhance the layout using grid. I can turn my [`<ul>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/ul) into a grid container with three column tracks. However, the width I have assigned to the list items themselves still applies, and it now makes those items a third of the width of the track:
If I reset the width to `auto`, then this will stop the float behavior happening for older browsers. I need to be able to define the width for older browsers, and remove the width for grid supporting browsers. Thanks to [CSS Feature Queries](../@supports) I can do this, right in my CSS.
#### A solution using feature queries
*Feature queries* will look very familiar if you have ever used a [media query](../media_queries) to create a responsive layout. Rather than checking a [viewport](https://developer.mozilla.org/en-US/docs/Glossary/Viewport) width, or some feature of the browser or device, we check for support of a CSS property and value pair using an [`@supports`](../@supports) rule. Inside the feature query, we can then write any CSS we need to apply our modern layout, and remove anything required for the older layout.
```
@supports (display: grid) {
.wrapper {
/\* do anything for grid supporting browsers here. \*/
}
}
```
Feature queries have excellent browser support, and all of the browsers that support the updated grid specification support feature queries too. You can use them to deal with the issue we have with our enhanced: floated layout.
I use an `@supports` rule to check for support of `display: grid`. I then do my grid code on the [`<ul>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/ul), set my width and [`min-height`](../min-height) on the [`<li>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/li) to `auto`. I also remove the margins and negative margins, and replace the spacing with the [`gap`](../gap) property. This means I don't get a final margin on the last row of boxes. The layout now works, even if there is more content in one of the cards, than the others:
```
.wrapper ul {
overflow: hidden;
margin: 0 -10px;
padding: 0;
list-style: none;
}
.wrapper li {
float: left;
width: calc(33.333333% - 20px);
margin: 0 10px 20px 10px;
}
@supports (display: grid) {
.wrapper ul {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 20px;
margin: 0;
}
.wrapper li {
width: auto;
min-height: auto;
margin: 0;
}
}
```
```
<div class="wrapper">
<ul>
<li class="card">
<h2>One</h2>
<p>We can use CSS Grid to overwrite older methods.</p>
</li>
<li class="card">
<h2>Two</h2>
<p>We can use CSS Grid to overwrite older methods.</p>
<p>We can use CSS Grid to overwrite older methods.</p>
</li>
<li class="card">
<h2>Three</h2>
<p>We can use CSS Grid to overwrite older methods.</p>
</li>
<li class="card">
<h2>Four</h2>
<p>We can use CSS Grid to overwrite older methods.</p>
</li>
<li class="card">
<h2>Five</h2>
<p>We can use CSS Grid to overwrite older methods.</p>
</li>
<li class="card">
<h2>Six</h2>
<p>We can use CSS Grid to overwrite older methods.</p>
</li>
</ul>
</div>
```
Overwriting other values of `display`
-------------------------------------
Due to the problems of creating grids of items using floats, many of us would use a different method to the floated method shown above to layout a set of cards. Using `display: inline-block` is an alternate method.
Once again I can use feature queries to overwrite a layout that uses `display: inline-block`, and again I don't need to overwrite everything. An item that is set to `inline-block` becomes a grid item, and so the behavior of `inline-block` no longer applies. I have used the [`vertical-align`](../vertical-align) property on my item when in the `inline-block` display mode, but this property does not apply to grid items and, therefore, is ignored once the item becomes a grid item:
```
.wrapper ul {
margin: 0 -10px;
padding: 0;
list-style: none;
}
.wrapper li {
display: inline-block;
vertical-align: top;
width: calc(33.333333% - 20px);
margin: 0 10px 20px 10px;
}
@supports (display: grid) {
.wrapper ul {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 20px;
margin: 0;
}
.wrapper li {
width: auto;
margin: 0;
}
}
```
```
<div class="wrapper">
<ul>
<li class="card">
<h2>One</h2>
<p>We can use CSS Grid to overwrite older methods.</p>
</li>
<li class="card">
<h2>Two</h2>
<p>We can use CSS Grid to overwrite older methods.</p>
<p>We can use CSS Grid to overwrite older methods.</p>
</li>
<li class="card">
<h2>Three</h2>
<p>We can use CSS Grid to overwrite older methods.</p>
</li>
<li class="card">
<h2>Four</h2>
<p>We can use CSS Grid to overwrite older methods.</p>
</li>
<li class="card">
<h2>Five</h2>
<p>We can use CSS Grid to overwrite older methods.</p>
</li>
<li class="card">
<h2>Six</h2>
<p>We can use CSS Grid to overwrite older methods.</p>
</li>
</ul>
</div>
```
Once again it is the width on the item we need to address, and then any other properties we want to enhance. In this example I have again used `gap`, rather than margins and negative margins to create my gutters.
How does the specification define these overrides?
--------------------------------------------------
The CSS Grid Layout specification details why we can overwrite the behavior of certain properties when something becomes a grid item. The key sections of the specification are:
* [Establishing Grid Containers](https://drafts.csswg.org/css-grid/#grid-containers)
* [Grid Items](https://drafts.csswg.org/css-grid/#grid-items)
* [Grid Item Display](https://drafts.csswg.org/css-grid/#grid-item-display)
As this behavior is detailed in the specification, you are safe to rely on using these overrides in your support for older browsers. Nothing described here should be seen as a "hack". Rather, we are taking advantage of the fact that the grid specification details the interaction between different layout methods.
### Other values of display
When an element has a parent set to `display: grid` it is *blockified*, as defined in the [CSS display specification](https://drafts.csswg.org/css-display-3/#blockify). In the case of our item set to `inline-block`, this is why `display: inline-block` no longer applied.
If you are using `display: table` for your legacy layout, an item set to `display: table-cell` generates anonymous boxes. Therefore, if you use `display: table-cell` without any parent element set to `display-table`, an anonymous table wrapper is created around any adjacent cells, just as if you had wrapped them in a div or other element set to `display: table`. If you have an item set to `display: table-cell`, and then in a feature query change the parent to `display: grid`, this anonymous box creation will not happen. This means you can overwrite `display: table` based layouts, without having additional anonymous boxes.
### Floated elements
As we have already seen, [`float`](../float) and also [`clear`](../clear) have no effect on a grid item. Therefore you do not need to explicitly set items to `float: none`.
### Vertical alignment
The alignment property [`vertical-align`](../vertical-align) has no effect on a grid item. In layouts using `display: inline-block` or `display: table`, you might use the vertical-align property to perform basic alignment. In your grid layout you then have the far more powerful box alignment properties.
### Multiple-column layout
You can also use multiple column layout as your legacy browser plan, as the `column-*` properties do not apply when applied to a grid container.
Further reading
---------------
* For an excellent explanation of feature queries, and how to use them well, see [Using Feature Queries in CSS (2016)](https://hacks.mozilla.org/2016/08/using-feature-queries-in-css/).
* A write-up of the differences between the IE/Edge (≤15) Grid implementation and the modern implementation, also covering *autoprefixer* support, take a look at: *[Should I try to use the IE implementation of CSS Grid Layout? (2016)](https://rachelandrew.co.uk/archives/2016/11/26/should-i-try-to-use-the-ie-implementation-of-css-grid-layout/)*
* [Autoprefixer and Grid Autoplacement support in IE](https://github.com/postcss/autoprefixer#grid-autoplacement-support-in-ie)
* [CSS Grid and the New Autoprefixer (2018)](https://css-tricks.com/css-grid-in-ie-css-grid-and-the-new-autoprefixer/)
| programming_docs |
css Subgrid Subgrid
=======
Level 2 of the CSS Grid Layout specification includes a `subgrid` value for [`grid-template-columns`](../grid-template-columns) and [`grid-template-rows`](../grid-template-rows). This guide details what subgrid does, and gives some use cases and design patterns that are solved by the feature.
Introduction to subgrid
-----------------------
When you add `display: grid` to a grid container, only the direct children become grid items and can then be placed on the grid that you have created. The children of these items display in normal flow.
You can "nest" grids by making a grid item a grid container. These grids however are independent of the parent grid and of each other, meaning that they do not take their track sizing from the parent grid. This makes it difficult to line nested grid items up with the main grid.
If you set the value `subgrid` on `grid-template-columns`, `grid-template-rows` or both, instead of creating a new track listing the nested grid uses the tracks defined on the parent.
For example, if you use `grid-template-columns: subgrid` and the nested grid spans three column tracks of the parent, the nested grid will have three column tracks of the same size as the parent grid. Gaps are inherited but can also be overridden with a different [`gap`](../gap) value. Line names can be passed from the parent into the subgrid, and the subgrid can also declare its own line names.
Subgrid for columns
-------------------
In the example below I have a grid layout with nine `1fr` column tracks and four rows that are a minimum of 100px tall.
I place `.item` from column line 2 to 7, and row 2 to 4. I then make this grid item into a grid, giving it column tracks that are a subgrid and defining rows as normal. As the item spans five column tracks, this means that the subgrid has five column tracks. I can then place `.subitem` on this grid.
The rows in this example are not a subgrid and so behave as a nested grid does normally. The grid area on the parent expands to be large enough for this nested grid.
Note that line numbering restarts inside the subgrid — column line 1, when inside the subgrid, is the first line of the subgrid. The subgridded element doesn't inherit the line numbers of the parent grid. This means that you can safely lay out a component that may be placed in different positions on the main grid, knowing that the line numbers on the component will always be the same.
Subgrid for rows
----------------
The next example is the same setup, however we are using `subgrid` as the value of `grid-template-rows` and defining explicit column tracks. So the column tracks behave as a regular nested grid, but the rows are tied to the two tracks that the child spans.
A subgrid in both dimensions
----------------------------
You can of course define both rows and columns as a subgrid, as in the example below. This means that your subgrid is tied in both dimensions to the number of tracks on the parent.
### No implicit grid in a subgridded dimension
If you need to autoplace items, and do not know how many items you will have, take care when creating a subgrid, as it will prevent additional rows being created to hold those items.
Take a look at the next example — it uses the same parent and child grid as in the example above, however inside the subgrid I have twelve items trying to autoplace into ten grid cells. As the subgrid is on both dimensions there is nowhere for the extra two items to go and so they go into the last track of the grid, as defined in the specification.
If we remove the `grid-template-rows` value we enable regular creation of implicit tracks and, although these won't line up with the tracks of the parent, as many as are required will be created.
The gap properties and subgrid
------------------------------
If you have a [`gap`](../gap), [`column-gap`](../column-gap), or [`row-gap`](../row-gap) specified on the parent, this will be passed into the subgrid, so it will have the same spacing between tracks as the parent. In some situations however you may wish the subgrid tracks to have a different gap or no gap. This can be achieved by using the `gap-*` properties on the grid container of the subgrid.
You can see this in the example below. The parent grid has a gap of 20px for rows and columns. The subgrid has `row-gap` set to `0`.
If you inspect this in the Firefox Grid Inspector you can see how the line of the grid is in the correct place down the center of the gap, so when we set the gap to 0, it acts in a similar way to applying a negative margin to an element, giving the space from the gap back to the item.
Named grid lines
----------------
When using CSS Grid you can name lines on your grid and then position items based on those names rather than the line number. The line names on the parent grid are passed into the subgrid, and you can place items using them. In the below example I have named lines on the parent `col-start` and `col-end` and then used those to place the subitem.
You can also specify line names on the subgrid. This is achieved by adding a list of line names enclosed in square brackets after the `subgrid` keyword. If you have four lines in your subgrid, to name them all you could use the syntax `grid-template-columns: subgrid [line1] [line2] [line3] [line4]`
Lines specified on the subgrid are added to any lines specified on the parent so you can use either or both. To demonstrate this, I have positioned one item in the example below using the parent lines, and one using the subgrid lines.
Using subgrids
--------------
Other than needing to take care of items that do not fit in your subgrid, a subgrid acts very similarly to any nested grid; the only difference is that the track sizing of the subgrid is set on the parent grid. As with any nested grid however, the size of content in the subgrid can change the track sizing, assuming a track sizing method is used that allows content to affect the size. In such a case, auto-sized row tracks for example will grow to fit content in the main grid and content in the subgrid.
As the subgrid value acts in much the same way as a regular nested grid, it is easy to switch between the two. For example, if you realize that you need an implicit grid for rows, all you would need to do is remove the `subgrid` value of `grid-template-rows` and perhaps give a value for `grid-auto-rows` to control the implicit track sizing.
Specifications
--------------
| Specification |
| --- |
| [CSS Grid Layout Module Level 2 # subgrids](https://w3c.github.io/csswg-drafts/css-grid/#subgrids) |
Browser compatibility
---------------------
| | Desktop | Mobile |
| --- | --- | --- |
| | Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet |
| `Subgrid` | No
See [bug 618969](https://crbug.com/618969). | No
See [bug 618969](https://crbug.com/618969). | 71 | No | No
See [bug 618969](https://crbug.com/618969). | 16 | No
See [bug 618969](https://crbug.com/618969). | No
See [bug 618969](https://crbug.com/618969). | No | No
See [bug 618969](https://crbug.com/618969). | 16 | No
See [bug 618969](https://crbug.com/618969). |
See also
--------
* On the Mozilla Developer YouTube Channel, see the videos [Laying out forms using subgrid](https://www.youtube.com/watch?v=gmQlK3kRft4) and [Don't Wait To Use Subgrid For Better Card Layouts](https://www.youtube.com/watch?v=lLnFtK1LNu4)
* [Hello Subgrid!](https://noti.st/rachelandrew/i6gUcF/hello-subgrid) A presentation from CSSConf.eu
css Realizing common layouts using grids Realizing common layouts using grids
====================================
To round off this set of guides to CSS Grid Layout, we're going to walk through a few different layouts, which demonstrate some of the different techniques you can use when designing with grid layout. We will look at an example using [grid-template-areas](grid_template_areas), a typical 12-column flexible grid system, and also a product listing using auto-placement. As you can see from this set of examples, there is often more than one way to achieve the result you want with grid layout. Choose the method you find most helpful for the problems that you are solving and the designs that you need to implement.
A responsive layout with 1 to 3 fluid columns using `grid-template-areas`
-------------------------------------------------------------------------
Many websites are a variation of this type of layout, with content, sidebars, a header and a footer. In a responsive design, you may want to display the layout as a single column, adding a sidebar at a certain breakpoint and then bring in a three-column layout for wider screens.
We're going to create this layout using the *named template areas* that we learned about in the guide *[Grid template areas](grid_template_areas)*.
The markup is a container with elements inside for a header, footer, main content, navigation, sidebar, and a block to place advertising.
```
<div class="wrapper">
<header class="main-head">The header</header>
<nav class="main-nav">
<ul>
<li><a href="">Nav 1</a></li>
<li><a href="">Nav 2</a></li>
<li><a href="">Nav 3</a></li>
</ul>
</nav>
<article class="content">
<h1>Main article area</h1>
<p>
In this layout, we display the areas in source order for any screen less
that 500 pixels wide. We go to a two column layout, and then to a three
column layout by redefining the grid, and the placement of items on the
grid.
</p>
</article>
<aside class="side">Sidebar</aside>
<div class="ad">Advertising</div>
<footer class="main-footer">The footer</footer>
</div>
```
As we are using [`grid-template-areas`](../grid-template-areas) to create the layout. Outside of any media queries we need to name the areas. We name areas using the [`grid-area`](../grid-area) property.
```
.main-head {
grid-area: header;
}
.content {
grid-area: content;
}
.main-nav {
grid-area: nav;
}
.side {
grid-area: sidebar;
}
.ad {
grid-area: ad;
}
.main-footer {
grid-area: footer;
}
```
This will not create any layout, however the items now have names we can use to do so. Staying outside of any media queries we're now going to set up the layout for the mobile width. Here we're keeping everything in source order, trying to avoid any disconnect between the source and display as described in the guide *[Grid layout and accessibility](css_grid_layout_and_accessibility)*. We've not defined any column or row tracks but this layout dictates a single column, and rows will be created as needed for each of the items in the implicit grid.
```
.wrapper {
display: grid;
gap: 20px;
grid-template-areas:
"header"
"nav"
"content"
"sidebar"
"ad"
"footer";
}
```
With our mobile layout in place, we can now proceed to add a [media query](../media_queries) to adapt this layout for bigger screens with enough real estate to display two columns.
```
@media (min-width: 500px) {
.wrapper {
grid-template-columns: 1fr 3fr;
grid-template-areas:
"header header"
"nav nav"
"sidebar content"
"ad footer";
}
nav ul {
display: flex;
justify-content: space-between;
}
}
```
You can see the layout taking shape in the value of [`grid-template-areas`](../grid-template-areas). The `header` spans over two column tracks, as does the `nav`. In the third row track we have the `sidebar` alongside the `content`. In the fourth row track I have chosen to place my `ad` content – so it appears under the sidebar, then the `footer` next to it under the content. We're using a flexbox on the navigation to display it in a row spaced out.
We can now add a final breakpoint to move to a three-column layout.
```
@media (min-width: 700px) {
.wrapper {
grid-template-columns: 1fr 4fr 1fr;
grid-template-areas:
"header header header"
"nav content sidebar"
"nav content ad"
"footer footer footer";
}
nav ul {
flex-direction: column;
}
}
```
The three-column layout has two `1fr` unit side columns and a middle column that has `4fr` as the track size. This means that the available space in the container is split into 6 and assigned in proportion to our three tracks – one part each to the side columns and 4 parts to the center.
In this layout we're displaying the `nav` in the left column, alongside the `content`. In the right column we have the `sidebar` and underneath it the advertisements (`ad`). The `footer` now spans right across the bottom of the layout. I then use a flexbox to display the navigation as a column.
This is a simple example but demonstrates how we can use a grid layout to rearrange our layout for different breakpoints. In particular we're changing the location of that `ad` block, as appropriate in my different column setups. I find this named areas method very helpful at a prototyping stage, it is easy to play around with the location of elements. You could always begin to use grid in this way for prototyping, even if you can't rely on it fully in production due to the browsers that visit your site.
A flexible 12-column layout
---------------------------
If you have been working with one of the many frameworks or grid systems you may be accustomed to laying out your site on a 12- or 16-column flexible grid. We can create this type of system using CSS Grid Layout. As a simple example, let's create a 12-column flexible grid that has 12 `1fr`-unit column tracks, they all have a start line named `col-start`. This means that we will have twelve grid lines named `col-start`.
```
.wrapper {
display: grid;
grid-template-columns: repeat(12, [col-start] 1fr);
gap: 20px;
}
```
To demonstrate how this grid system works I have four child elements inside my wrapper.
```
<div class="wrapper">
<div class="item1">Start column line 1, span 3 column tracks.</div>
<div class="item2">
Start column line 6, span 4 column tracks. 2 row tracks.
</div>
<div class="item3">Start row 2 column line 2, span 2 column tracks.</div>
<div class="item4">
Start at column line 3, span to the end of the grid (-1).
</div>
</div>
```
We can then place these on the grid using the named lines, and also the span keyword.
```
.item1 {
grid-column: col-start / span 3;
}
.item2 {
grid-column: col-start 6 / span 4;
grid-row: 1 / 3;
}
.item3 {
grid-column: col-start 2 / span 2;
grid-row: 2;
}
.item4 {
grid-column: col-start 3 / -1;
grid-row: 3;
}
```
As described in the [guide to named lines](layout_using_named_grid_lines), we are using the named line to place our item. As we have 12 lines all with the same name we use the name, and then the index of the line. You could also use the line index itself if you prefer and avoid using named lines at all.
Rather than setting the end line number, I have chosen to say how many tracks this element should span, using the `span` keyword. I like this approach as when working with a multiple-column layout system we usually think of blocks in terms of the number of tracks of the grid they span, and adjust that for different breakpoints. To see how the blocks align themselves to the tracks, use the [Firefox Grid Inspector](https://firefox-source-docs.mozilla.org/devtools-user/page_inspector/how_to/examine_grid_layouts/index.html). It clearly demonstrates how our items are placed.
There are some key differences with how a grid layout works over the grid systems you may have used previously. As you can see, we do not need to add any markup to create a row, grid systems need to do this to stop elements popping up into the row above. With CSS Grid Layout, we can place things into rows, with no danger of them rising up into the row above if it is left empty. Due to this *strict* column and row placement we can also easily leave white space in our layout. We also don't need special classes to pull or push things, to indent them into the grid. All we need to do is specify the start and end line for the item.
Building a layout using the 12-column system
--------------------------------------------
To see how this layout method works in practice, we can create the same layout that we created with [`grid-template-areas`](../grid-template-areas), this time using the 12-column grid system. Let's start with the same markup as used for the grid template areas example.
```
<div class="wrapper">
<header class="main-head">The header</header>
<nav class="main-nav">
<ul>
<li><a href="">Nav 1</a></li>
<li><a href="">Nav 2</a></li>
<li><a href="">Nav 3</a></li>
</ul>
</nav>
<article class="content">
<h1>Main article area</h1>
<p>
In this layout, we display the areas in source order for any screen less
that 500 pixels wide. We go to a two column layout, and then to a three
column layout by redefining the grid, and the placement of items on the
grid.
</p>
</article>
<aside class="side">Sidebar</aside>
<div class="ad">Advertising</div>
<footer class="main-footer">The footer</footer>
</div>
```
We can then set up our grid, as for the example 12-column layout above.
```
.wrapper {
display: grid;
grid-template-columns: repeat(12, [col-start] 1fr);
gap: 20px;
}
```
We are once again going to make this a responsive layout, this time however using named lines. Every breakpoint will use a 12-column grid, however the number of tracks that items will span changes depending on the size of the screen.
We start mobile first, and all we want for the narrowest screens is for the items to remain in source order, and all span right across the grid.
```
.wrapper > \* {
grid-column: col-start / span 12;
}
```
At the next breakpoint we want to move to a two-column layout. Our header and navigation still span the full grid, so we do not need to specify any positioning for them. The sidebar is starting on the first column line named col-start, spanning 3 lines. It goes after row line 3, as the header and navigation are in the first two row tracks.
The ad panel is below the sidebar, so starts at grid row line 4. Then we have the content and footer starting at col-start 4 and spanning 9 tracks taking them to the end of the grid.
```
@media (min-width: 500px) {
.side {
grid-column: col-start / span 3;
grid-row: 3;
}
.ad {
grid-column: col-start / span 3;
grid-row: 4;
}
.content,
.main-footer {
grid-column: col-start 4 / span 9;
}
nav ul {
display: flex;
justify-content: space-between;
}
}
```
Finally we go to the three-column version of this layout. The header continues to span right across the grid, but now the navigation moves down to become the first sidebar, with the content and then the sidebar next to it. The footer now also spans across the full layout.
```
@media (min-width: 700px) {
.main-nav {
grid-column: col-start / span 2;
grid-row: 2 / 4;
}
.content {
grid-column: col-start 3 / span 8;
grid-row: 2 / 4;
}
.side {
grid-column: col-start 11 / span 2;
grid-row: 2;
}
.ad {
grid-column: col-start 11 / span 2;
grid-row: 3;
}
.main-footer {
grid-column: col-start / span 12;
}
nav ul {
flex-direction: column;
}
}
```
Once again the [Grid Inspector](https://firefox-source-docs.mozilla.org/devtools-user/page_inspector/how_to/examine_grid_layouts/index.html) is useful to help us see how our layout has taken shape.
Something to note as we create this layout is that we haven't needed to explicitly position every element on the grid at each breakpoint. We have been able to inherit the placement set up for earlier breakpoints – an advantage of working "mobile first". We are also able to take advantage of grid auto-placement. By keeping elements in a logical order, auto-placement does quite a lot of work for us in placing items onto the grid. In the final example in this guide we will create a layout that entirely relies on auto-placement.
A product listing with auto-placement
-------------------------------------
Many layouts are essentially sets of "cards" – product listings, image galleries, and so on. A grid can make it very easy to create these listings in a way that is responsive without needing to add [media queries](../media_queries) to make it so. In this next example I'm combining CSS Grid and Flexbox Layouts to make a simple product listing layout.
The markup for my listing is an unordered list of items. Each item contains a heading, some text of varying height, and a call to action link.
```
<ul class="listing">
<li>
<h2>Item One</h2>
<div class="body">
<p>The content of this listing item goes here.</p>
</div>
<div class="cta">
<a href="">Call to action!</a>
</div>
</li>
<li>
<h2>Item Two</h2>
<div class="body">
<p>The content of this listing item goes here.</p>
</div>
<div class="cta">
<a href="">Call to action!</a>
</div>
</li>
<li class="wide">
<h2>Item Three</h2>
<div class="body">
<p>The content of this listing item goes here.</p>
<p>This one has more text than the other items.</p>
<p>Quite a lot more</p>
<p>Perhaps we could do something different with it?</p>
</div>
<div class="cta">
<a href="">Call to action!</a>
</div>
</li>
<li>
<h2>Item Four</h2>
<div class="body">
<p>The content of this listing item goes here.</p>
</div>
<div class="cta">
<a href="">Call to action!</a>
</div>
</li>
<li>
<h2>Item Five</h2>
<div class="body">
<p>The content of this listing item goes here.</p>
</div>
<div class="cta">
<a href="">Call to action!</a>
</div>
</li>
</ul>
```
We are going to create a grid with a flexible number of flexible columns. I want them never to become smaller than 200 pixels, and then to share any available remaining space equally – so we always get equal width column tracks. We achieve this with the `minmax()` function in our repeat notation for track sizing.
```
.listing {
list-style: none;
margin: 2em;
display: grid;
gap: 20px;
grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}
```
As soon as we add this CSS, the items start to lay out as a grid. If we make the window smaller or wider the number of column tracks changes – without us needing to add breakpoints using media queries and redefine the grid.
We can then tidy up the internals of the boxes using a little touch of flexbox. I set the list item to `display: flex` and the `flex-direction` to `column`. We can then use an auto margin on the `.cta` to push this bar down to the bottom of the box.
```
.listing li {
border: 1px solid #ffe066;
border-radius: 5px;
display: flex;
flex-direction: column;
}
.listing .cta {
margin-top: auto;
border-top: 1px solid #ffe066;
padding: 10px;
text-align: center;
}
.listing .body {
padding: 10px;
}
```
This is really one of the key reasons someone would use flexbox rather than grid, if he/she's just aligning or distributing something in a single dimension, that's a flexbox use case.
Preventing gaps with the dense keyword
--------------------------------------
This is all looking fairly complete now, however we sometimes have these cards which contain far more content than the others. It might be nice to cause those to span two tracks, and then they won't be so tall. We have a class of `wide` on my larger item, and we add a rule [`grid-column-end`](../grid-column-end) with a value of `span 2`. Now when grid encounters this item, it will assign it two tracks. At some breakpoints, this means that we'll get a gap in the grid – where there isn't space to lay out a two-track item.
We can cause a grid to backfill those gaps by setting [`grid-auto-flow`](../grid-auto-flow)`: dense` on the grid container. Take care when doing this however as it does take items away from their logical source order. You should only do this if your items do not have a set order – and be aware of the [issues](css_grid_layout_and_accessibility#visual_not_logical_re-ordering) of the tab order following the source and not your reordered display.
```
.listing {
list-style: none;
margin: 2em;
display: grid;
gap: 20px;
grid-auto-flow: dense;
grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}
.listing .wide {
grid-column-end: span 2;
}
```
This technique of using auto-placement with some rules applied to certain items is very useful, and can help you to deal with content that is being output by a CMS for example, where you have repeated items and can perhaps add a class to certain ones as they are rendered into the HTML.
Further exploration
-------------------
The best way to learn to use grid layout is to continue to build examples like the ones we have covered here. Pick something that you normally build using your framework of choice, or using floats, and see if you can build it using grid. Don't forget to find examples that are impossible to build with current methods. That might mean taking inspiration from magazines or other non-web sources. Grid Layout opens up possibilities that we have not had before, we don't need to be tied to the same old layouts to use it.
* [CSS Grid Layout](../css_grid_layout)
* [CSS Layout: Grids](https://developer.mozilla.org/en-US/docs/Learn/CSS/CSS_layout/Grids)
* [Grid by Example](https://gridbyexample.com)
* [A Complete Guide to Grid](https://css-tricks.com/snippets/css/complete-guide-grid/)
* [CSS Grid Website Layout Examples](https://www.quackit.com/css/grid/examples/css_grid_website_layout_examples.cfm)
| programming_docs |
css Masonry layout Masonry layout
==============
Level 3 of the [CSS Grid Layout](../css_grid_layout) specification includes a `masonry` value for [`grid-template-columns`](../grid-template-columns) and [`grid-template-rows`](../grid-template-rows). This guide details what masonry layout is, and how to use it.
**Warning:** This feature is only implemented in Firefox, and can be enabled by setting the flag `layout.css.grid-template-masonry-value.enabled` to `true` in `about:config`, in order to allow testing and providing of feedback.
Masonry layout is a layout method where one axis uses a typical strict grid layout, most often columns, and the other a masonry layout. On the masonry axis, rather than sticking to a strict grid with gaps being left after shorter items, the items in the following row rise up to completely fill the gaps.
Creating a masonry layout
-------------------------
To create the most common masonry layout, your columns will be the grid axis and the rows the masonry axis. Define this layout with `grid-template-columns` and `grid-template-rows`:
```
.container {
display: grid;
gap: 10px;
grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
grid-template-rows: masonry;
}
```
The child elements of this container will now lay out item by item along the rows, as they would with regular grid layout automatic placement. However, as they move onto a new row the items will display according to the masonry algorithm. Items will load into the column with the most room causing a tightly packed layout without strict row tracks.
It is also possible to create a masonry layout with items loading into rows.
Controlling the grid axis
-------------------------
On the grid axis, things will work just as you expect them to in grid layout. You can cause items to span multiple tracks while remaining in auto-placement, using the `span` keyword. Items may also be positioned using line-based positioning.
### Masonry layout with spanning items
In this example two of the items span two tracks, and the masonry items work around them.
This example includes an item which has positioning for columns. Items with definite placement are placed before the masonry layout happens.
Controlling the masonry axis
----------------------------
The masonry axis operates under different rules as it is following the masonry layout rules rather than normal grid auto-placement rules. To control this axis we have three additional properties defined in the Grid Level 3 specification [`align-tracks`](../align-tracks), [`justify-tracks`](../justify-tracks), and [`masonry-auto-flow`](../masonry-auto-flow).
### masonry-auto-flow
The `masonry-auto-flow` property gives you a way to change how the masonry algorithm behaves. Give it a value of `next` and items will display in order on the grid axis, rather than going into whichever track has the most free space. The value `positioned` will ignore items with definite placement and place items in order-modified document order.
### align-tracks
The `align-tracks` property allows for the alignment of items in grid containers with masonry in their block axis. The property aligns the items within their track, much in the way flex layout works. The property takes the same values as `align-content`, however you can specify multiple values to have different alignment values per track on the grid axis.
If you specify more values than tracks the additional values are ignored. If there are more tracks than values any additional tracks will use the last specified value.
### justify-tracks
The `justify-tracks` property works in the same way as align-tracks, however it is used when the masonry axis is the inline axis.
Fallback
--------
In browsers that do not support masonry, regular grid auto-placement will be used instead.
See also
--------
* [Native CSS Masonry Layout In CSS Grid](https://www.smashingmagazine.com/native-css-masonry-layout-css-grid/)
css Grid layout using named grid lines Grid layout using named grid lines
==================================
In previous guides we've looked at placing items by the lines created by defining grid tracks and also how to place items using named template areas. In this guide we are going to look at how these two things work together when we use named lines. Line naming is incredibly useful, but some of the more baffling looking grid syntax comes from this combination of names and track sizes. Once you work through some examples it should become clearer and easier to work with.
Naming lines when defining a grid
---------------------------------
You can assign some or all of the lines in your grid a name when you define your grid with the `grid-template-rows` and `grid-template-columns` properties. To demonstrate I'll use the simple layout created in the guide on line-based placement. This time I'll create the grid using named lines.
When defining the grid, I name my lines inside square brackets. Those names can be anything you like. I have defined a name for the start and end of the container, both for rows and columns. Then defined the center block of the grid as `content-start` and `content-end` again, both for columns and rows although you do not need to name all of the lines on your grid. You might choose to name just some key lines for your layout.
```
.wrapper {
display: grid;
grid-template-columns: [main-start] 1fr [content-start] 1fr [content-end] 1fr [main-end];
grid-template-rows: [main-start] 100px [content-start] 100px [content-end] 100px [main-end];
}
```
Once the lines have names, we can use the name to place the item rather than the line number.
```
.box1 {
grid-column-start: main-start;
grid-row-start: main-start;
grid-row-end: main-end;
}
.box2 {
grid-column-start: content-end;
grid-row-start: main-start;
grid-row-end: content-end;
}
.box3 {
grid-column-start: content-start;
grid-row-start: main-start;
}
.box4 {
grid-column-start: content-start;
grid-column-end: main-end;
grid-row-start: content-end;
}
```
```
<div class="wrapper">
<div class="box1">One</div>
<div class="box2">Two</div>
<div class="box3">Three</div>
<div class="box4">Four</div>
</div>
```
Everything else about line-based placement still works in the same way and you can mix named lines and line numbers. Naming lines is useful when creating a responsive design where you redefine the grid, rather than then needing to redefine the content position by changing the line number in your media queries, you can ensure that the line is always named the same in your definitions.
### Giving lines multiple names
You may want to give a line more than one name, perhaps it denotes the sidebar-end and the main-start for example. To do this add the names inside the square brackets with whitespace between them `[sidebar-end main-start]`. You can then refer to that line by either of the names.
Implicit grid areas from named lines
------------------------------------
When naming the lines, I mentioned that you can name these anything you like. The name is a [custom ident](https://drafts.csswg.org/css-values-4/#custom-idents), an author-defined name. When choosing the name you need to avoid words that might appear in the specification and be confusing - such as `span`. Idents are not quoted.
While you can choose any name, if you append `-start` and `-end` to the lines around an area, as I have in the example above, grid will create you a named area of the main name used. Taking the above example, I have `content-start` and `content-end` both for rows and for columns. This means I get a grid area named `content`, and could place something in that area should I wish to.
I'm using the same grid definitions as above, however this time I am going to place a single item into the named area `content`.
```
.wrapper {
display: grid;
grid-template-columns: [main-start] 1fr [content-start] 1fr [content-end] 1fr [main-end];
grid-template-rows: [main-start] 100px [content-start] 100px [content-end] 100px [main-end];
}
.thing {
grid-area: content;
}
```
```
<div class="wrapper">
<div class="thing">I am placed in an area named content.</div>
</div>
```
We don't need to define where our areas are with `grid-template-areas` as our named lines have created an area for us.
Implicit Grid lines from named areas
------------------------------------
We have seen how named lines create a named area, and this also works in reverse. Named template areas create named lines that you can use to place your items. If we take the layout created in the guide to Grid Template Areas, we can use the lines created by our areas to see how this works.
In this example I have added an extra div with a class of `overlay`. We have named areas created using the `grid-area` property, then a layout created in `grid-template-areas`. The area names are:
* `hd`
* `ft`
* `main`
* `sd`
This gives us column and row lines:
* `hd-start`
* `hd-end`
* `sd-start`
* `sd-end`
* `main-start`
* `main-end`
* `ft-start`
* `ft-end`
You can see the named lines in the image, note that some lines have two names - for example `sd-end` and `main-start` refer to the same column line.
To position `overlay` using these implicit named lines is the same as positioning an item using lines that we have named.
```
.wrapper {
display: grid;
grid-template-columns: repeat(9, 1fr);
grid-auto-rows: minmax(100px, auto);
grid-template-areas:
"hd hd hd hd hd hd hd hd hd"
"sd sd sd main main main main main main"
"ft ft ft ft ft ft ft ft ft";
}
.header {
grid-area: hd;
}
.footer {
grid-area: ft;
}
.content {
grid-area: main;
}
.sidebar {
grid-area: sd;
}
.wrapper > div.overlay {
z-index: 10;
grid-column: main-start / main-end;
grid-row: hd-start / ft-end;
border: 4px solid rgb(92, 148, 13);
background-color: rgba(92, 148, 13, 0.4);
color: rgb(92, 148, 13);
font-size: 150%;
}
```
```
<div class="wrapper">
<div class="header">Header</div>
<div class="sidebar">Sidebar</div>
<div class="content">Content</div>
<div class="footer">Footer</div>
<div class="overlay">Overlay</div>
</div>
```
Given that we have this ability to position created lines from named areas and areas from named lines, it is worth taking a little bit of time to plan your naming strategy when starting out creating your grid layout. By selecting names that will make sense to you and your team you will help everyone to use the layouts you create more easily.
Multiple lines with the same name with repeat()
-----------------------------------------------
If you want to give all of the lines in your grid a unique name then you will need to write out the track definition long-hand rather than using the repeat syntax, as you need to add the name in square brackets while defining the tracks. If you do use the repeat syntax you will end up with multiple lines that have the same name, however this can be very useful too.
### Twelve-column grid using repeat()
In this next example I am creating a grid with twelve equal width columns. Before defining the 1fr size of the column track I am also defining a line name of `[col-start]`. This means that we will end up with a grid that has 12 column lines all named `col-start` before a `1fr` width column.
```
.wrapper {
display: grid;
grid-template-columns: repeat(12, [col-start] 1fr);
}
```
Once you have created the grid you can place items onto it. As we have multiple lines named `col-start` if you place an item to start after line `col-start` grid uses the first line named `col-start`, in our case that will be the far left line. To address another line use the name, plus the number for that line. To place our item from the first line named col-start to the 5th, we can use:
```
.item1 {
grid-column: col-start / col-start 5;
}
```
You can also use the `span` keyword here. My next item will be placed from the 7th line named `col-start` and span 3 lines.
```
.item2 {
grid-column: col-start 7 / span 3;
}
```
```
<div class="wrapper">
<div class="item1">I am placed from col-start line 1 to col-start 5</div>
<div class="item2">I am placed from col-start line 7 spanning 3 lines</div>
</div>
```
If you take a look at this layout in the Firefox Grid Highlighter you can see how the column lines are shown, and how our items are placed against these lines.
### Defining named lines with a track list
The repeat syntax can also take a track list, it doesn't just need to be a single track size that is being repeated. The code below would create an eight track grid, with a narrower `1fr` width column named `col1-start` followed by a wider `3fr` column named `col2-start`.
```
.wrapper {
grid-template-columns: repeat(4, [col1-start] 1fr [col2-start] 3fr);
}
```
If your repeating syntax puts two lines next to each other then they will be merged, and create the same result as giving a line multiple names in a non-repeating track definition. The following definition, creates four `1fr` tracks, which each have a start and end line.
```
.wrapper {
grid-template-columns: repeat(4, [col-start] 1fr [col-end]);
}
```
If we write this definition out without using repeat notation it would look like this.
```
.wrapper {
grid-template-columns: [col-start] 1fr [col-end col-start] 1fr [col-end col-start] 1fr [col-end col-start] 1fr [col-end];
}
```
If you have used a track list then you can use the `span` keyword not just to span a number of lines but also to span a number of lines of a certain name.
```
.wrapper {
display: grid;
grid-template-columns: repeat(6, [col1-start] 1fr [col2-start] 3fr);
}
.item1 {
grid-column: col1-start / col2-start 2;
}
.item2 {
grid-row: 2;
grid-column: col1-start 2 / span 2 col1-start;
}
```
```
<div class="wrapper">
<div class="item1">
I am placed from col1-start line 1 to col2-start line 2
</div>
<div class="item2">
I am placed from col1-start line 2 spanning 2 lines named col1-start
</div>
</div>
```
### Twelve-column grid framework
Over the last three guides you have discovered that there are a lot of different ways to place items using grid. This can seem a little bit overcomplicated at first, but remember you don't need to use all of them. In practice I find that for straightforward layouts, using named template areas works well, it gives that nice visual representation of what your layout looks like, and it is then easy to move things around on the grid.
If working with a strict multiple column layout for example the named lines demonstration in the last part of this guide works very well. If you consider grid systems such as those found in frameworks like Foundation or Bootstrap, these are based on a 12 column grid. The framework then imports the code to do all of the calculations to make sure that the columns add up to 100%. With grid layout the only code we need for our grid "framework" is:
```
.wrapper {
display: grid;
gap: 10px;
grid-template-columns: repeat(12, [col-start] 1fr);
}
```
We can then use that framework to layout our page. For example, to create a three column layout with a header and footer, I might have the following markup.
```
<div class="wrapper">
<header class="main-header">I am the header</header>
<aside class="side1">I am sidebar 1</aside>
<article class="content">I am the main article</article>
<aside class="side2">I am sidebar 2</aside>
<footer class="main-footer">I am the footer</footer>
</div>
```
I could then place this on my grid layout framework like this.
```
.main-header,
.main-footer {
grid-column: col-start / span 12;
}
.side1 {
grid-column: col-start / span 3;
grid-row: 2;
}
.content {
grid-column: col-start 4 / span 6;
grid-row: 2;
}
.side2 {
grid-column: col-start 10 / span 3;
grid-row: 2;
}
```
Once again, the grid highlighter is helpful to show us how the grid we have placed our items on works.
That's all I need. I don't need to do any calculations, grid automatically removed my 10 pixel gutter track before assigning the space to the `1fr` column tracks. As you start to build out your own layouts, you will find that the syntax becomes more familiar and you choose the ways that work best for you and the type of projects you like to build. Try building some common patterns with these various methods, and you will soon find your most productive way to work. Then, in the next guide we will look at how grid can position items for us - without us needing to use placement properties at all!
css Grid layout and accessibility Grid layout and accessibility
=============================
Those of us who have been doing web development for more years than we care to remember might consider that CSS Grid is a little bit like using "tables for layout". Back in the early days of web design, the way we constructed page layout was to use HTML tables, then fragment our design into the cells of those tables in order to create a layout. This had some advantages over the "CSS Positioning" that came afterwards, in that we could take advantage of the alignment and full height columns offered by table display. The biggest downside however was that it tied our design to the markup, often creating accessibility issues as it did so. In order to lay the design out in the table we often broke up the content in ways that made no sense at all when read out by a screen reader for example.
In moving to CSS we often spoke about CSS for layout enabling a separation of content and markup and presentation. The ultimate aim being that we could create a semantic and well structured document, then apply CSS to create the layout we desired. Sites such as the [CSS Zen Garden](http://www.csszengarden.com/) showcased this ability. The CSS Zen Garden challenged us to take identical markup and create a unique design using CSS.
[CSS Grid Layout](../css_grid_layout) does not have the same issues that tables did, our grid structure is defined in CSS rather than in the markup. If we need to add an element we can use something with no semantic meaning. On paper grid helps us properly fulfill that promise of content separated from markup, however is it possible to go too far with this idea? Is it possible that we could *create* an accessibility issue through our use of grids?
Re-ordering content in CSS Grid Layout
--------------------------------------
We've already seen in these guides that grid gives us power to re-order the content of our page in various ways. We can use the [`order`](../order) property, which will change how items auto-place. We can use `grid-auto-flow: dense` which will take items visually out of DOM order. We can also position items using line-based placement of grid template areas, without considering their location in the source.
The [specification](https://drafts.csswg.org/css-grid/#order-accessibility) includes a section that covers Reordering and Accessibility. In the introduction to that section are details of what the specification expects browsers to do when the content is visually reordered using Grid Layout.
> Grid layout gives authors great powers of rearrangement over the document. However, these are not a substitute for correct ordering of the document source. The order property and grid placement do not affect ordering in non-visual media (such as speech). Likewise, rearranging grid items visually does not affect the default traversal order of sequential navigation modes (such as cycling through links, see e.g. [tabindex](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/tabindex) HTML5).
>
>
If you reorder things visually using grid layout, this will not change how the items are ordered if the content is being read out by a screen reader, or other text to speech user agent. In addition, the reordering will not change tab order. This means that someone navigating using the keyboard could be tabbing through links on your site and suddenly find themselves jumping from the top to the bottom of the document due to a reordered item being next in line.
The specification warns authors (the CSSWG term for web developers) not to do this reordering.
> Authors must use order and the grid-placement properties only for visual, not logical, reordering of content. Style sheets that use these features to perform logical reordering are non-conforming.
>
>
What does this mean for designing with grid layout in practice?
### Visual not logical re-ordering
Any time you reorder things with grid layout – or with flexbox – you only perform *visual reordering*. The underlying source is what controls things like text to speech, and the tab order of the document. You can see how this works with a very simple example.
In this example I have used grid to lay out a set of boxes that contain links. I have used the line-based placement properties to position box 1 on the second row of the grid. Visually it now appears as the fourth item in the list. However, if I tab from link to link the tab order still begins with box 1, as it comes first in the source.
```
.wrapper {
display: grid;
grid-template-columns: repeat(3, 1fr);
grid-auto-rows: 100px;
}
.box1 {
grid-column: 1;
grid-row: 2;
}
```
```
<div class="wrapper">
<div class="box box1"><a href="">One</a></div>
<div class="box box2"><a href="">Two</a></div>
<div class="box box3"><a href="">Three</a></div>
<div class="box box4"><a href="">Four</a></div>
<div class="box box5"><a href="">Five</a></div>
</div>
```
The specification says that in this scenario, if box 1 really makes sense logically in that position, we should go back to our source and make the change there rather than reordering using grid layout. This is what is meant by visual versus logical reordering, logical ordering is important for the meaning and structure of our document, and we should make sure that we preserve that structure.
How should we approach accessibility for grid layout?
-----------------------------------------------------
From the specification we know that we need to ensure our document maintains the logical order of our content. How should we approach our development to make sure that we maintain accessibility for the different users and the ways that they interact with our pages?
Start with a structured and accessible document A grid layout should mean we do not need to change our document source in order to get the layout that we want. Therefore the starting point of your page should be a well structured and accessible source document. As is noted in the CSS Grid Layout specification, this is quite often going to give you a good structure for *your smallest screen devices too*. If a user is scrolling through a long document on mobile, the priorities for that user quite often map to what should be a priority in the source.
Create a responsive, and responsible grid With a solid document you can begin to add your layout, it is likely you will be using [media queries](../media_queries) to create additional columns and make changes for different screen sizes and devices. Grid can be really very useful here, elements deprioritized in the mobile source order can be moved into a sidebar in a desktop layout, for example. The key here is to keep testing, a very simple test is to *tab around the document*. Does that order still make sense? Check that you do not end up leaping from the top to the bottom of the layout in a peculiar way. If so that would be a sign that you need to address something about the layout.
Returning to the source If at any time in the design process you find yourself using grid to relocate the position of an element, consider whether you should return to your document and make a change to the logical order too. The nice thing about using CSS Grid Layout is that you should be able to move an item in the source to match the logical order, without needing to make big changes to your layout. This is a huge improvement over a [`float`](../float)-based layout for example, where document source matters a lot in order to get layouts at different breakpoints. However the onus is on us as developers to remember to go back to our source and update it to maintain logical order.
Grid and the danger of markup flattening
----------------------------------------
Another issue to be aware of in CSS Grid Layout and to a lesser extent in CSS Flexbox, is the temptation to *flatten* markup. As we have discovered, for an item to become a grid item it needs to be a direct child of the grid container. Therefore, where you have a [`<ul>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/ul) element inside a grid container, *that* `ul` becomes a grid item – the child [`<li>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/li) elements do not.
The <subgrid> value of `grid-template-columns` and `grid-template-rows` will solve this problem once widely implemented. It will allow the grid to be inherited by grid items and passed down the tree.
Given that interoperable support for subgrid is limited, there is a definite temptation when developing a site using CSS Grid Layout to flatten out the markup, to remove semantic elements in order to make it simpler to create a layout. An example would be where some content was semantically marked up as a list but you decide to use a set of [`<div>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/div) elements instead as then you can have the element to be a direct child of a container set to `display: grid`. Be aware of this temptation and find ways to develop your design without stripping out the markup. Starting out with a well-structured document is a very good way to avoid the problem, as you will be aware that you are removing semantic elements in order to make the layout work if you actually have to go into the document and do so!
Further reading
---------------
There is not a lot of existing material regarding accessibility and CSS Grid Layout. Many of the issues are similar to those raised regarding CSS Flexbox, which also gives methods of reordering content with [`flex-direction`](../flex-direction) and the [`order`](../order) property.
The concept of visual display following document source order is detailed in the *WCAG Techniques for Success Criteria – [Technique C27](https://www.w3.org/TR/WCAG20-TECHS/C27.html)*.
As a way to start thinking about these issues, as you use CSS Grid Layout I would suggest reading *[Flexbox & the Keyboard Navigation Disconnect](https://tink.uk/flexbox-the-keyboard-navigation-disconnect/)* from Léonie Watson. Also [the video of Léonie's presentation from ffconf](https://www.youtube.com/watch?v=spxT2CmHoPk) is helpful to understand more about how screen readers work with the visual representation of things in CSS. Adrian Roselli has also posted regarding [tab order in various browsers](https://adrianroselli.com/2015/10/html-source-order-vs-css-display-order.html) – although this was prior to grid support being fully implemented in Firefox.
| programming_docs |
css Grid layout using line-based placement Grid layout using line-based placement
======================================
In the [article covering the basic concepts of grid layout](basic_concepts_of_grid_layout), we started to look at how to position items on a grid using line numbers. In this article we will fully explore how this fundamental feature of the specification works.
Starting your exploration of grid with numbered lines is the most logical place to begin, as when you use grid layout you always have numbered lines. The lines are numbered for columns and rows, and are indexed from 1. Note that grid is indexed according to the writing mode of the document. In a left to right language such as English line 1 is on the left-hand side of the grid. If you are working in a right-to-left language such as Arabic then line 1 will be the far right of the grid. We will learn more about the interaction between writing modes and grids in a later guide.
A basic example
---------------
As a very simple example we can take a grid with 3 column tracks and 3 row tracks. This gives us 4 lines in each dimension.
Inside our grid container we have four child elements. If we do not place these on to the grid in any way they will lay out according to the auto-placement rules, one item in each of the first four cells. If you use the [Firefox Grid Highlighter](https://firefox-source-docs.mozilla.org/devtools-user/page_inspector/how_to/examine_grid_layouts/index.html) you can see how the grid has defined columns and rows.
```
.wrapper {
display: grid;
grid-template-columns: repeat(3, 1fr);
grid-template-rows: repeat(3, 100px);
}
```
```
<div class="wrapper">
<div class="box1">One</div>
<div class="box2">Two</div>
<div class="box3">Three</div>
<div class="box4">Four</div>
</div>
```
Positioning items by line number
--------------------------------
We can use line-based placement to control where these items sit on the grid. We would like the first item to start on the far left of the grid and span a single column track. It should also start on the first row line, at the top of the grid and span to the fourth row line.
```
.box1 {
grid-column-start: 1;
grid-column-end: 2;
grid-row-start: 1;
grid-row-end: 4;
}
```
As you position some items, other items on the grid will continue to be laid out using the auto-placement rules. We will take a proper look at how these work in a later guide but you can see as you work that grid is laying out un-placed items into empty cells of the grid.
Addressing each item individually we can place all four items spanning row and column tracks. Note that we can leave cells empty if we wish. One of the very nice things about Grid Layout is the ability to have white space in our designs without having to push things around using margins to prevent floats from rising up into the space we have left.
```
<div class="wrapper">
<div class="box1">One</div>
<div class="box2">Two</div>
<div class="box3">Three</div>
<div class="box4">Four</div>
</div>
```
```
.box1 {
grid-column-start: 1;
grid-column-end: 2;
grid-row-start: 1;
grid-row-end: 4;
}
.box2 {
grid-column-start: 3;
grid-column-end: 4;
grid-row-start: 1;
grid-row-end: 3;
}
.box3 {
grid-column-start: 2;
grid-column-end: 3;
grid-row-start: 1;
grid-row-end: 2;
}
.box4 {
grid-column-start: 2;
grid-column-end: 4;
grid-row-start: 3;
grid-row-end: 4;
}
```
The `grid-column` and `grid-row` shorthands
-------------------------------------------
We have quite a lot of code here to position each item. It should come as no surprise to know there is a [shorthand](../shorthand_properties). The [`grid-column-start`](../grid-column-start) and [`grid-column-end`](../grid-column-end) properties can be combined into [`grid-column`](../grid-column), [`grid-row-start`](../grid-row-start) and [`grid-row-end`](../grid-row-end) into [`grid-row`](../grid-row).
```
<div class="wrapper">
<div class="box1">One</div>
<div class="box2">Two</div>
<div class="box3">Three</div>
<div class="box4">Four</div>
</div>
```
```
.box1 {
grid-column: 1 / 2;
grid-row: 1 / 4;
}
.box2 {
grid-column: 3 / 4;
grid-row: 1 / 3;
}
.box3 {
grid-column: 2 / 3;
grid-row: 1 / 2;
}
.box4 {
grid-column: 2 / 4;
grid-row: 3 / 4;
}
```
Default spans
-------------
In the above examples, we specified every end row and column line, in order to demonstrate the properties, however in practice if an item only spans one track you can omit the `grid-column-end` or `grid-row-end` value. Grid defaults to spanning one track.
### Default spans with longhand placement
This means that our initial, long-hand, example would look like this:
```
<div class="wrapper">
<div class="box1">One</div>
<div class="box2">Two</div>
<div class="box3">Three</div>
<div class="box4">Four</div>
</div>
```
```
.box1 {
grid-column-start: 1;
grid-row-start: 1;
grid-row-end: 4;
}
.box2 {
grid-column-start: 3;
grid-row-start: 1;
grid-row-end: 3;
}
.box3 {
grid-column-start: 2;
grid-row-start: 1;
}
.box4 {
grid-column-start: 2;
grid-column-end: 4;
grid-row-start: 3;
}
```
### Default spans with shorthand placement
Our shorthand would look like the following code, with no forward slash and second value for the items spanning one track only.
```
<div class="wrapper">
<div class="box1">One</div>
<div class="box2">Two</div>
<div class="box3">Three</div>
<div class="box4">Four</div>
</div>
```
```
.box1 {
grid-column: 1;
grid-row: 1 / 4;
}
.box2 {
grid-column: 3;
grid-row: 1 / 3;
}
.box3 {
grid-column: 2;
grid-row: 1;
}
.box4 {
grid-column: 2 / 4;
grid-row: 3;
}
```
The `grid-area` property
------------------------
We can take things a step further and define each area with a single property – [`grid-area`](../grid-area). The order of the values for grid-area are as follows.
* grid-row-start
* grid-column-start
* grid-row-end
* grid-column-end
```
<div class="wrapper">
<div class="box1">One</div>
<div class="box2">Two</div>
<div class="box3">Three</div>
<div class="box4">Four</div>
</div>
```
```
.box1 {
grid-area: 1 / 1 / 4 / 2;
}
.box2 {
grid-area: 1 / 3 / 3 / 4;
}
.box3 {
grid-area: 1 / 2 / 2 / 3;
}
.box4 {
grid-area: 3 / 2 / 4 / 4;
}
```
This order of values for `grid-area` can seem a little strange, it is the opposite of the direction in which we specify margins and padding as a shorthand for example. It may help to realize that this is due to grid using the flow-relative directions defined in the CSS Writing Modes specification. We will explore how grids work with writing modes in a later article however we have the concept of four flow-relative directions:
* block-start
* block-end
* inline-start
* inline-end
We are working in English, a left-to-right language. Our block-start is the top row line of the grid container, block-end is the final row line of the container. Our inline-start is the left-hand column line as inline-start is always the point from which text would be written in the current writing mode, inline-end is the final column line of our grid.
When we specify our grid area using the `grid-area` property we first define both start lines `block-start` and `inline-start`, then both end lines `block-end` and `inline-end`. This seems unusual at first as we are used to the physical properties of top, right, bottom and left but makes more sense if you start to think of websites as being multi-directional in writing mode.
Counting backwards
------------------
We can also count backwards from the block and inline end of the grid, for English that would be the right-hand column line and final row line. These lines can be addressed as `-1`, and you can count back from there – so the second last line is `-2`. It is worth noting that the final line is the final line of the *explicit grid*, the grid defined by `grid-template-columns` and `grid-template-rows`, and does not take into account any rows or columns added in the *implicit grid* outside of that.
In this next example, we have flipped the layout we were working with by working from the right and bottom of our grid when placing the items.
```
<div class="wrapper">
<div class="box1">One</div>
<div class="box2">Two</div>
<div class="box3">Three</div>
<div class="box4">Four</div>
</div>
```
```
.box1 {
grid-column-start: -1;
grid-column-end: -2;
grid-row-start: -1;
grid-row-end: -4;
}
.box2 {
grid-column-start: -3;
grid-column-end: -4;
grid-row-start: -1;
grid-row-end: -3;
}
.box3 {
grid-column-start: -2;
grid-column-end: -3;
grid-row-start: -1;
grid-row-end: -2;
}
.box4 {
grid-column-start: -2;
grid-column-end: -4;
grid-row-start: -3;
grid-row-end: -4;
}
```
### Stretching an item across the grid
Being able to address the start and end lines of the grid is useful as you can then stretch an item right across the grid with:
```
.item {
grid-column: 1 / -1;
}
```
Gutters or Alleys
-----------------
The CSS Grid Specification includes the ability to add gutters between column and row tracks with the [`column-gap`](../column-gap) and [`row-gap`](../row-gap) properties. These specify a gap that acts much like the [`column-gap`](../column-gap) property in multi-column layout.
**Note:** When grid first shipped in browsers the [`column-gap`](../column-gap), [`row-gap`](../row-gap) and [`gap`](../gap) properties were prefixed with the `grid-` prefix as `grid-column-gap`, `grid-row-gap` and `grid-gap` respectively.
Browsers are updating their rendering engines to remove this prefix, however the prefixed versions will be maintained as aliases, making them safe to use.
Gaps only appear between tracks of the grid, they do not add space to the top and bottom, left or right of the container. We can add gaps to our earlier example by using these properties on the grid container.
```
<div class="wrapper">
<div class="box1">One</div>
<div class="box2">Two</div>
<div class="box3">Three</div>
<div class="box4">Four</div>
</div>
```
```
.box1 {
grid-column: 1;
grid-row: 1 / 4;
}
.box2 {
grid-column: 3;
grid-row: 1 / 3;
}
.box3 {
grid-column: 2;
grid-row: 1;
}
.box4 {
grid-column: 2 / 4;
grid-row: 3;
}
.wrapper {
display: grid;
grid-template-columns: repeat(3, 1fr);
grid-template-rows: repeat(3, 100px);
column-gap: 20px;
row-gap: 1em;
}
```
### The gap shorthand
The two properties can also be expressed as a shorthand, [`gap`](../gap). If you only give one value for `gap` it will apply to both column and row gaps. If you specify two values, the first is used for `row-gap` and the second for `column-gap`.
```
.wrapper {
display: grid;
grid-template-columns: repeat(3, 1fr);
grid-template-rows: repeat(3, 100px);
gap: 1em 20px;
}
```
In terms of line-based positioning of items, the gap acts as if the line has gained extra width. Anything starting at that line starts after the gap and you cannot address the gap or place anything into it. If you want gutters that act more like regular tracks you can of course define a track for the purpose instead.
Using the `span` keyword
------------------------
In addition to specifying the start and end lines by number, you can specify a start line and then the number of tracks you would like the area to span.
```
<div class="wrapper">
<div class="box1">One</div>
<div class="box2">Two</div>
<div class="box3">Three</div>
<div class="box4">Four</div>
</div>
```
```
.box1 {
grid-column: 1;
grid-row: 1 / span 3;
}
.box2 {
grid-column: 3;
grid-row: 1 / span 2;
}
.box3 {
grid-column: 2;
grid-row: 1;
}
.box4 {
grid-column: 2 / span 2;
grid-row: 3;
}
```
You can also use the `span` keyword in the value of `grid-row-start`/`grid-row-end` and `grid-column-start/grid-column-end`. The following two examples will create the same grid area. In the first we set the start row line, then the end line we explain that we want to span 3 lines. The area will start at line 1 and span 3 lines to line 4.
```
.box1 {
grid-column-start: 1;
grid-row-start: 1;
grid-row-end: span 3;
}
```
In the second example, we specify the end row line we want the item to finish at and then set the start line as `span 3`. This means the item will need to span upwards from the specified row line. The area will start at line 4 and span 3 lines to line 1.
```
.box1 {
grid-column-start: 1;
grid-row-start: span 3;
grid-row-end: 4;
}
```
To become familiar with line based positioning in grid try to build a few common layouts by placing items onto grids with varying numbers of columns. Remember that if you do not place all of the items, any leftover items will be placed according to auto-placement rules. This may result in the layout you want, but if something is appearing somewhere unexpected, check that you have set a position for it.
Also, remember that items on the grid can overlap each other when you place them explicitly like this. That can create some nice effects, however you can also end up with things overlapping incorrectly if you specify the wrong start or end line. The [Firefox Grid Highlighter](https://firefox-source-docs.mozilla.org/devtools-user/page_inspector/how_to/examine_grid_layouts/index.html) can be very useful as you learn, especially if your grid is quite complicated.
css Box alignment in grid layout Box alignment in grid layout
============================
CSS Grid Layout implements the specification [Box Alignment Level 3](https://drafts.csswg.org/css-align/) which is the same standard [flexbox](../css_flexible_box_layout) uses for aligning items in its flex container. This specification details how alignment should work in all the different layout methods. Layout methods will conform to the specification where possible and implement individual behavior based on their differences (features and constraints). While the specification currently specifies alignment details for all layout methods, browsers have not fully implemented all of the specification; however, the CSS Grid Layout method has been widely adopted.
This guide presents demonstrations of how box alignment in grid layout works. You will see many similarities in how these properties and values work in flexbox. Due to grid being two-dimensional and flexbox one-dimensional there are some small differences that you should watch out for. So we will start by looking at the two axes that we deal with when aligning things in a grid.
The two axes of a grid layout
-----------------------------
When working with grid layout you have two axes available to align things against – the *block axis* and the *inline axis*. The block axis is the axis upon which blocks are laid out in block layout. If you have two paragraphs on your page they display one below the other, so it is this direction we describe as the block axis.
The *inline axis* runs across the block axis, it is the direction in which text in regular inline flow runs.
We are able to align the content inside grid areas, and the grid tracks themselves on these two axes.
Aligning items on the Block Axis
--------------------------------
The [`align-self`](../align-self) and [`align-items`](../align-items) properties control alignment on the block axis. When we use these properties, we are changing the alignment of the item within the grid area you have placed it.
### Using align-items
In the following example, I have four grid areas within my grid. I can use the [`align-items`](../align-items) property on the grid container, to align the items using one of the following values:
* `auto`
* `normal`
* `start`
* `end`
* `center`
* `stretch`
* `baseline`
* `first baseline`
* `last baseline`
```
.wrapper {
display: grid;
grid-template-columns: repeat(8, 1fr);
gap: 10px;
grid-auto-rows: 100px;
grid-template-areas:
"a a a a b b b b"
"a a a a b b b b"
"c c c c d d d d"
"c c c c d d d d";
align-items: start;
}
.item1 {
grid-area: a;
}
.item2 {
grid-area: b;
}
.item3 {
grid-area: c;
}
.item4 {
grid-area: d;
}
```
```
<div class="wrapper">
<div class="item1">Item 1</div>
<div class="item2">Item 2</div>
<div class="item3">Item 3</div>
<div class="item4">Item 4</div>
</div>
```
Keep in mind that once you set `align-items: start`, the height of each child `<div>` will be determined by the contents of the `<div>`. This is in contrast to omitting [`align-items`](../align-items) completely, in which case the height of each `<div>` stretches to fill its grid area.
The [`align-items`](../align-items) property sets the [`align-self`](../align-self) property for all of the child grid items. This means that you can set the property individually, by using `align-self` on a grid item.
### Using align-self
In this next example, I am using the `align-self` property, to demonstrate the different alignment values. The first area, is showing the default behavior of `align-self`, which is to stretch. The second item, has an `align-self` value of `start`, the third `end` and the fourth `center`.
```
.wrapper {
display: grid;
grid-template-columns: repeat(8, 1fr);
gap: 10px;
grid-auto-rows: 100px;
grid-template-areas:
"a a a a b b b b"
"a a a a b b b b"
"c c c c d d d d"
"c c c c d d d d";
}
.item1 {
grid-area: a;
}
.item2 {
grid-area: b;
align-self: start;
}
.item3 {
grid-area: c;
align-self: end;
}
.item4 {
grid-area: d;
align-self: center;
}
```
```
<div class="wrapper">
<div class="item1">Item 1</div>
<div class="item2">Item 2</div>
<div class="item3">Item 3</div>
<div class="item4">Item 4</div>
</div>
```
### Items with an intrinsic aspect ratio
The specification details that the default behavior in [`align-self`](../align-self) is to stretch, except for items which have an intrinsic aspect ratio, in this case they behave as `start`. The reason for this, is that if items with an aspect ratio are set to stretch, this default would distort them.
This behavior has now been clarified in the specification, with browsers yet to implement the correct behavior. Until that happens, you can ensure that items do not stretch, such as images, which are direct children of the grid, by setting [`align-self`](../align-self) and [`justify-self`](../justify-self) to start. This will mimic the correct behavior once implemented.
Justifying Items on the Inline Axis
-----------------------------------
As [`align-items`](../align-items) and [`align-self`](../align-self) deal with the alignment of items on the block axis, [`justify-items`](../justify-items) and [`justify-self`](../justify-self) do the same job on the inline axis. The values you can choose from are the same as for `align-self`.
* `auto`
* `normal`
* `start`
* `end`
* `center`
* `stretch`
* `baseline`
* `first baseline`
* `last baseline`
You can see the same example as used for [`align-items`](../align-items), below. This time we are applying the [`justify-self`](../justify-self) property.
Once again the default is `stretch`, other than for items with an intrinsic aspect ratio. This means that by default, grid items will cover their grid area, unless you change that by setting alignment. The first item in the example demonstrates this default alignment:
```
.wrapper {
display: grid;
grid-template-columns: repeat(8, 1fr);
gap: 10px;
grid-auto-rows: 100px;
grid-template-areas:
"a a a a b b b b"
"a a a a b b b b"
"c c c c d d d d"
"c c c c d d d d";
}
.item1 {
grid-area: a;
}
.item2 {
grid-area: b;
justify-self: start;
}
.item3 {
grid-area: c;
justify-self: end;
}
.item4 {
grid-area: d;
justify-self: center;
}
```
```
<div class="wrapper">
<div class="item1">Item 1</div>
<div class="item2">Item 2</div>
<div class="item3">Item 3</div>
<div class="item4">Item 4</div>
</div>
```
As with [`align-self`](../align-self) and [`align-items`](../align-items), you can apply [`justify-items`](../justify-items) to the grid container, to set the [`justify-self`](../justify-self) value for all items.
The [`justify-self`](../justify-self) and [`justify-items`](../justify-items) properties are not implemented in flexbox. This is due to the one-dimensional nature of [flexbox](../css_flexible_box_layout), and that there may be multiple items along the axis, making it impossible to justify a single item. To align items along the main, inline axis in flexbox you use the [`justify-content`](../justify-content) property.
### Shorthand properties
The [`place-items`](../place-items) property is shorthand for [`align-items`](../align-items) and [`justify-items`](../justify-items).
The [`place-self`](../place-self) property is shorthand for [`align-self`](../align-self) and [`justify-self`](../justify-self).
Center an item in the area
--------------------------
By combining the align and justify properties we can easily center an item inside a grid area.
```
.wrapper {
display: grid;
grid-template-columns: repeat(4, 1fr);
gap: 10px;
grid-auto-rows: 200px;
grid-template-areas:
". a a ."
". a a .";
}
.item1 {
grid-area: a;
align-self: center;
justify-self: center;
}
```
```
<div class="wrapper">
<div class="item1">Item 1</div>
</div>
```
Aligning the grid tracks on the block axis
------------------------------------------
If you have a situation where your grid tracks use an area that is smaller than the grid container, then you can align the grid tracks themselves, inside that container. Once again, this operates on the block and inline axes, with [`align-content`](../align-content) aligning tracks on the block axis, and [`justify-content`](../justify-content) performing alignment on the inline axis. The [`place-content`](../place-content) property is shorthand for [`align-content`](../align-content) and [`justify-content`](../justify-content). The values for [`align-content`](../align-content), [`justify-content`](../justify-content) and [`place-content`](../place-content) are:
* `normal`
* `start`
* `end`
* `center`
* `stretch`
* `space-around`
* `space-between`
* `space-evenly`
* `baseline`
* `first baseline`
* `last baseline`
In the below example I have a grid container of 500 pixels by 500 pixels. I have defined 3 row and column tracks each of 100 pixels with a 10 pixel gutter. This means that there is space inside the grid container both in the block and inline directions.
The `align-content` property is applied to the grid container as it works on the entire grid.
### Default alignment
The default behavior in grid layout is `start`, which is why our grid tracks are in the top left corner of the grid, aligned against the start grid lines:
```
\* {
box-sizing: border-box;
}
.wrapper {
border: 2px solid #f76707;
border-radius: 5px;
background-color: #fff4e6;
}
.wrapper > div {
border: 2px solid #ffa94d;
border-radius: 5px;
background-color: #ffd8a8;
padding: 1em;
color: #d9480f;
}
```
```
.wrapper {
display: grid;
grid-template-columns: repeat(3, 100px);
grid-template-rows: repeat(3, 100px);
height: 500px;
width: 500px;
gap: 10px;
grid-template-areas:
"a a b"
"a a b"
"c d d";
}
.item1 {
grid-area: a;
}
.item2 {
grid-area: b;
}
.item3 {
grid-area: c;
}
.item4 {
grid-area: d;
}
```
```
<div class="wrapper">
<div class="item1">Item 1</div>
<div class="item2">Item 2</div>
<div class="item3">Item 3</div>
<div class="item4">Item 4</div>
</div>
```
### Setting align-content: end
If I add `align-content` to my container, with a value of `end`, the tracks all move to the end line of the grid container in the block dimension:
```
.wrapper {
display: grid;
grid-template-columns: repeat(3, 100px);
grid-template-rows: repeat(3, 100px);
height: 500px;
width: 500px;
gap: 10px;
grid-template-areas:
"a a b"
"a a b"
"c d d";
align-content: end;
}
.item1 {
grid-area: a;
}
.item2 {
grid-area: b;
}
.item3 {
grid-area: c;
}
.item4 {
grid-area: d;
}
```
```
<div class="wrapper">
<div class="item1">Item 1</div>
<div class="item2">Item 2</div>
<div class="item3">Item 3</div>
<div class="item4">Item 4</div>
</div>
```
### Setting align-content: space-between
We can also use values for this property that you may be familiar with from flexbox; the space distribution values of `space-between`, `space-around` and `space-evenly`. If we update [`align-content`](../align-content) to `space-between`, you can see how the elements on our grid space out:
```
.wrapper {
display: grid;
grid-template-columns: repeat(3, 100px);
grid-template-rows: repeat(3, 100px);
height: 500px;
width: 500px;
gap: 10px;
grid-template-areas:
"a a b"
"a a b"
"c d d";
align-content: space-between;
}
.item1 {
grid-area: a;
}
.item2 {
grid-area: b;
}
.item3 {
grid-area: c;
}
.item4 {
grid-area: d;
}
```
```
<div class="wrapper">
<div class="item1">Item 1</div>
<div class="item2">Item 2</div>
<div class="item3">Item 3</div>
<div class="item4">Item 4</div>
</div>
```
It is worth noting, that using these space distribution values may cause items on your grid to become larger. If an item spans more than one grid track, as further space is added between the tracks, that item needs to become large to absorb the space. We're always working in a strict grid. Therefore, if you decide to use these values, ensure that the content of your tracks can cope with the extra space, or that you have used alignment properties on the items, to cause them to move to the start rather than stretch.
In the below image I have placed the grid with `align-content`, with a value of `start` alongside the grid when `align-content` has a value of `space-between`. You can see how items 1 and 2, which span two row tracks have taken on extra height as they gain the additional space added to the gap between those two tracks:
Justifying the grid tracks on the inline axis
---------------------------------------------
On the inline axis, we can use [`justify-content`](../justify-content) to perform the same type of alignment that we used [`align-content`](../align-content) for in the block axis.
Using the same example, I am setting [`justify-content`](../justify-content) to `space-around`. This once again causes tracks which span more than one column track to gain extra space:
```
.wrapper {
display: grid;
grid-template-columns: repeat(3, 100px);
grid-template-rows: repeat(3, 100px);
height: 500px;
width: 500px;
gap: 10px;
grid-template-areas:
"a a b"
"a a b"
"c d d";
align-content: space-between;
justify-content: space-around;
}
.item1 {
grid-area: a;
}
.item2 {
grid-area: b;
}
.item3 {
grid-area: c;
}
.item4 {
grid-area: d;
}
```
```
<div class="wrapper">
<div class="item1">Item 1</div>
<div class="item2">Item 2</div>
<div class="item3">Item 3</div>
<div class="item4">Item 4</div>
</div>
```
Alignment and auto margins
--------------------------
Another way to align items inside their area is to use auto margins. If you have ever centered your layout in the viewport, by setting the right and left margin of the container block to `auto`, you know that an auto margin absorbs all of the available space. By setting the margin to `auto` on both sides, it pushes the block into the middle as both margins attempt to take all of the space.
In this next example, I have given item 1 a left margin of `auto`. You can see how the content is now pushed over to the right side of the area, as the auto margin takes up remaining space, after room for the content of that item has been assigned:
```
.wrapper {
display: grid;
grid-template-columns: repeat(3, 100px);
grid-template-rows: repeat(3, 100px);
height: 500px;
width: 500px;
gap: 10px;
grid-template-areas:
"a a b"
"a a b"
"c d d";
}
.item1 {
grid-area: a;
margin-left: auto;
}
.item2 {
grid-area: b;
}
.item3 {
grid-area: c;
}
.item4 {
grid-area: d;
}
```
```
<div class="wrapper">
<div class="item1">Item 1</div>
<div class="item2">Item 2</div>
<div class="item3">Item 3</div>
<div class="item4">Item 4</div>
</div>
```
You can see how the item is aligned by using the [Firefox Grid Highlighter](https://firefox-source-docs.mozilla.org/devtools-user/page_inspector/how_to/examine_grid_layouts/index.html):
Alignment and Writing Modes
---------------------------
In all of these examples I have been working in English, which is a left-to-right language. This means that our start lines are top and left of our grid when thinking in physical directions.
CSS Grid Layout, and the Box Alignment specification are designed to work with writing modes in CSS. This means that if you are working in a right to left language, such as Arabic, the start of the grid would be the top and right, so the default of `justify-content: start` would be for grid tracks to start on the right-hand side of the grid.
Setting auto margins, using `margin-right` or `margin-left` however, or absolutely positioning items using the `top`, `right`, `bottom` and `left` offsets would not honor writing modes. In the next guide, we will look further into this interaction between CSS grid layout, box alignment and writing modes. This will be important to understand, if you develop sites that are then displayed in multiple languages, or if you want to mix languages or writing modes in a design.
| programming_docs |
css Relationship of grid layout to other layout methods Relationship of grid layout to other layout methods
===================================================
CSS Grid Layout has been designed to work alongside other parts of CSS, as part of a complete system for doing the layout. In this guide, I will explain how a grid fits together with other techniques you may already be using.
Grid and flexbox
----------------
The basic difference between CSS Grid Layout and [CSS Flexbox Layout](../css_flexible_box_layout) is that flexbox was designed for layout in one dimension - either a row *or* a column. Grid was designed for two-dimensional layout - rows, and columns at the same time. The two specifications share some common features, however, and if you have already learned how to use flexbox, the similarities should help you get to grips with Grid.
### One-dimensional versus two-dimensional layout
A simple example can demonstrate the difference between one- and two-dimensional layouts.
In this first example, I am using flexbox to lay out a set of boxes. I have five child items in my container, and I have given the flex properties values so that they can grow and shrink from a flex-basis of 150 pixels.
I have also set the [`flex-wrap`](../flex-wrap) property to `wrap`, so that if the space in the container becomes too narrow to maintain the flex basis, items will wrap onto a new row.
```
<div class="wrapper">
<div>One</div>
<div>Two</div>
<div>Three</div>
<div>Four</div>
<div>Five</div>
</div>
```
```
.wrapper {
width: 500px;
display: flex;
flex-wrap: wrap;
}
.wrapper > div {
flex: 1 1 150px;
}
```
In the image, you can see that two items have wrapped onto a new line. These items are sharing the available space and not lining up underneath the items above. This is because when you wrap flex items, each new row (or column when working by column) is an independent flex line in the flex container. Space distribution happens across the flex line.
A common question then is how to make those items line up. This is where you want a two-dimensional layout method: You want to control the alignment by row and column, and this is where grid comes in.
### The same layout with CSS grids
In this next example, I create the same layout using Grid. This time we have three `1fr` column tracks. We do not need to set anything on the items themselves; they will lay themselves out one into each cell of the created grid. As you can see they stay in a strict grid, lining up in rows and columns. With five items, we get a gap on the end of row two.
```
<div class="wrapper">
<div>One</div>
<div>Two</div>
<div>Three</div>
<div>Four</div>
<div>Five</div>
</div>
```
```
.wrapper {
display: grid;
grid-template-columns: repeat(3, 1fr);
}
```
A simple question to ask yourself when deciding between grid or flexbox is:
* do I only need to control the layout by row *or* column – use a flexbox
* do I need to control the layout by row *and* column – use a grid
### Content out or layout in?
In addition to the one-dimensional versus two-dimensional distinction, there is another way to decide if you should use flexbox or grid for a layout. Flexbox works from the content out. An ideal use case for flexbox is when you have a set of items and want to space them out evenly in a container. You let the size of the content decide how much individual space each item takes up. If the items wrap onto a new line, they will work out their spacing based on their size and the available space *on that line*.
Grid works from the layout in. When you use CSS Grid Layout you create a layout and then you place items into it, or you allow the auto-placement rules to place the items into the grid cells according to that strict grid. It is possible to create tracks that respond to the size of the content, however, they will also change the entire track.
If you are using flexbox and find yourself disabling some of the flexibility, you probably need to use CSS Grid Layout. An example would be if you are setting a percentage width on a flex item to make it line up with other items in a row above. In that case, a grid is likely to be a better choice.
### Box alignment
The feature of flexbox that was most exciting to many of us was that it gave us proper alignment control for the first time. It made it easy to center a box on the page. Flex items can stretch to the height of the flex container, meaning that equal height columns were possible. These were things we have wanted to do for a very long time, and have come up with all kinds of hacks to accomplish, at least visually.
The alignment properties from the flexbox specification have been added to a new specification called [Box Alignment Level 3](https://drafts.csswg.org/css-align/). This means that they can be used in other specifications, including Grid Layout. In the future, they may well apply to other layout methods as well.
In a later guide in this series, I'll be taking a proper look at Box Alignment and how it works in Grid Layout. For now, here is a comparison between simple examples of flexbox and grid.
In the first example, which uses flexbox, I have a container with three items inside. The wrapper [`min-height`](../min-height) is set, so it defines the height of the flex container. I have set [`align-items`](../align-items) on the flex container to `flex-end` so the items will line up at the end of the flex container. I have also set the [`align-self`](../align-self) property on `box1` so it will override the default and stretch to the height of the container and on `box2` so it aligns to the start of the flex container.
```
<div class="wrapper">
<div class="box1">One</div>
<div class="box2">Two</div>
<div class="box3">Three</div>
</div>
```
```
.wrapper {
display: flex;
align-items: flex-end;
min-height: 200px;
}
.box1 {
align-self: stretch;
}
.box2 {
align-self: flex-start;
}
```
### Alignment in CSS Grids
This second example uses a grid to create the same layout. This time we are using the box alignment properties as they apply to a grid layout. So we align to `start` and `end` rather than `flex-start` and `flex-end`. In the case of a grid layout, we are aligning the items inside their grid area. In this case that is a single grid cell, but it could be an area made up of several grid cells.
```
<div class="wrapper">
<div class="box1">One</div>
<div class="box2">Two</div>
<div class="box3">Three</div>
</div>
```
```
.wrapper {
display: grid;
grid-template-columns: repeat(3, 1fr);
align-items: end;
grid-auto-rows: 200px;
}
.box1 {
align-self: stretch;
}
.box2 {
align-self: start;
}
```
### The `fr` unit and `flex-basis`
We have already seen how the `fr` unit works to assign a proportion of available space in the grid container to our grid tracks. The `fr` unit, when combined with the [`minmax()`](../minmax) function can give us very similar behavior to the `flex` properties in flexbox while still enabling the creation of a layout in two dimensions.
If we look back at the example where I demonstrated the difference between one and two-dimensional layouts, you can see there is a difference between the way that the two layouts work responsively. With the flex layout, if we drag our window wider and smaller, the flexbox does a nice job of adjusting the number of items in each row according to the available space. If we have a lot of space all five items can fit on one row. If we have a very narrow container we may only have space for one.
In comparison, the grid version always has three column tracks. The tracks themselves will grow and shrink, but there are always three since we asked for three when defining our grid.
#### Auto-filling grid tracks
We can use grid to create a similar effect to flexbox, while still keeping the content arranged in strict rows and columns, by creating our track listing using repeat notation and the `auto-fill` and `auto-fit` properties.
In this next example, I have used the `auto-fill` keyword in place of an integer in the repeat notation and set the track listing to 200 pixels. This means that grid will create as many 200 pixels column tracks as will fit in the container.
```
<div class="wrapper">
<div>One</div>
<div>Two</div>
<div>Three</div>
</div>
```
```
.wrapper {
display: grid;
grid-template-columns: repeat(auto-fill, 200px);
}
```
### A flexible number of tracks
This isn't quite the same as flexbox. In the flexbox example, the items are larger than the 200 pixel basis before wrapping. We can achieve the same in grid by combining `auto-fit` and the [`minmax()`](../minmax) function. In this next example, I create auto filled tracks with `minmax`. I want my tracks to be a minimum of 200 pixels, so I set the maximum to be `1fr`. Once the browser has worked out how many times 200 pixels will fit into the container–also taking account of grid gaps–it will treat the `1fr` maximum as an instruction to share out the remaining space between the items.
```
<div class="wrapper">
<div>One</div>
<div>Two</div>
<div>Three</div>
</div>
```
```
.wrapper {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}
```
We now have the ability to create a grid with a flexible number of flexible tracks, but see items laid out on the grid aligned by rows and columns at the same time.
Grid and absolutely positioned elements
---------------------------------------
Grid interacts with absolutely positioned elements, which can be useful if you want to position an item inside a grid or grid area. The specification defines the behavior when a grid container is a containing block and a parent of the absolutely positioned item.
### A grid container as containing block
To make the grid container a containing block you need to add the position property to the container with a value of relative, just as you would make a containing block for any other absolutely positioned items. Once you have done this, if you give a grid item `position: absolute` it will take as its containing block the grid container or, if the item also has a grid position, the area of the grid it is placed into.
In the below example I have a wrapper containing four child items. Item three is absolutely positioned and also placed on the grid using line-based placement. The grid container has `position: relative` and so becomes the positioning context of this item.
```
<div class="wrapper">
<div class="box1">One</div>
<div class="box2">Two</div>
<div class="box3">
This block is absolutely positioned. In this example the grid container is
the containing block and so the absolute positioning offset values are
calculated in from the outer edges of the area it has been placed into.
</div>
<div class="box4">Four</div>
</div>
```
```
.wrapper {
display: grid;
grid-template-columns: repeat(4, 1fr);
grid-auto-rows: 200px;
gap: 20px;
position: relative;
}
.box3 {
grid-column-start: 2;
grid-column-end: 4;
grid-row-start: 1;
grid-row-end: 3;
position: absolute;
top: 40px;
left: 40px;
}
```
You can see that the item is taking the area from grid column line 2 to 4, and starting after line 1. Then it is offset in that area using the top and left properties. However, it has been taken out of flow as is usual for absolutely positioned items and so the auto-placement rules now place items into the same space. The item also doesn't cause the additional row to be created to span to row line 3.
If we remove `position: absolute` from the rules for `.box3` you can see how it would display without the positioning.
### A grid container as parent
If the absolutely positioned child has a grid container as a parent but that container does not create a new positioning context, then it is taken out of flow as in the previous example. The positioning context will be whatever element creates a positioning context as is common to other layout methods. In our case, if we remove `position: relative` from the wrapper above, positioning context is from the viewport, as shown in this image.
Once again the item no longer participates in the grid layout in terms of sizing or when other items are auto-placed.
### With a grid area as the parent
If the absolutely positioned item is nested inside a grid area then you can create a positioning context on that area. In the below example we have our grid as before but this time I have nested an item inside `.box3` of the grid.
I have given `.box3` position relative and then positioned the sub-item with the offset properties. In this case, the positioning context is the grid area.
```
<div class="wrapper">
<div class="box1">One</div>
<div class="box2">Two</div>
<div class="box3">
Three
<div class="abspos">
This block is absolutely positioned. In this example the grid area is the
containing block and so the absolute positioning offset values are
calculated in from the outer edges of the grid area.
</div>
</div>
<div class="box4">Four</div>
</div>
```
```
.wrapper {
display: grid;
grid-template-columns: repeat(4, 1fr);
grid-auto-rows: 200px;
gap: 20px;
}
.box3 {
grid-column-start: 2;
grid-column-end: 4;
grid-row-start: 1;
grid-row-end: 3;
position: relative;
}
.abspos {
position: absolute;
top: 40px;
left: 40px;
background-color: rgba(255, 255, 255, 0.5);
border: 1px solid rgba(0, 0, 0, 0.5);
color: #000;
padding: 10px;
}
```
Grid and display: contents
--------------------------
A final interaction with another layout specification that is worth noting is the interaction between CSS Grid Layout and `display: contents`. The `contents` value of the display property is a new value that is described in the [Display specification](https://drafts.csswg.org/css-display/#box-generation) as follows:
> "The element itself does not generate any boxes, but its children and pseudo-elements still generate boxes as normal. For the purposes of box generation and layout, the element must be treated as if it had been replaced with its children and pseudo-elements in the document tree."
>
>
If you set an item to `display: contents`, the box it would normally create disappears and the boxes of the child elements appear as if they have risen up a level. This means that children of a grid item can become grid items. Sound odd? Here is a simple example.
### Grid layout with nested child elements
In the following markup, I have a grid and the first item on the grid is set to span all three column tracks. It contains three nested items. As these items are not direct children, they don't become part of the grid layout and so display using regular block layout.
```
<div class="wrapper">
<div class="box box1">
<div class="nested">a</div>
<div class="nested">b</div>
<div class="nested">c</div>
</div>
<div class="box box2">Two</div>
<div class="box box3">Three</div>
<div class="box box4">Four</div>
<div class="box box5">Five</div>
</div>
```
```
.wrapper {
display: grid;
grid-template-columns: repeat(3, 1fr);
grid-auto-rows: minmax(100px, auto);
}
.box1 {
grid-column-start: 1;
grid-column-end: 4;
}
```
### Using display: contents
If I now add `display: contents` to the rules for `box1`, the box for that item vanishes and the sub-items now become grid items and lay themselves out using the auto-placement rules.
```
<div class="wrapper">
<div class="box box1">
<div class="nested">a</div>
<div class="nested">b</div>
<div class="nested">c</div>
</div>
<div class="box box2">Two</div>
<div class="box box3">Three</div>
<div class="box box4">Four</div>
<div class="box box5">Five</div>
</div>
```
```
.wrapper {
display: grid;
grid-template-columns: repeat(3, 1fr);
grid-auto-rows: minmax(100px, auto);
}
.box1 {
grid-column-start: 1;
grid-column-end: 4;
display: contents;
}
```
This can be a way to get items nested into the grid to act as if they are part of the grid, and is a way around some of the issues that would be solved by subgrids once they are implemented. You can also use `display: contents` in a similar way with flexbox to enable nested items to become flex items.
As you can see from this guide, CSS Grid Layout is just one part of your toolkit. Don't be afraid to mix it with other methods of doing layout to get the different effects you need.
See also
--------
* [Flexbox guides](https://developer.mozilla.org/en-US/docs/Learn/CSS/CSS_layout/Flexbox)
* [Multiple-column layout guides](../css_columns)
css Grid template areas Grid template areas
===================
In the [previous guide](line-based_placement_with_css_grid) we looked at grid lines, and how to position items against those lines. When you use CSS Grid Layout you always have lines, and this can be a straightforward way to place items on your grid. However, there is an alternate method to use for positioning items on the grid which you can use alone or in combination with line-based placement. This method involves placing our items using named template areas, and we will find out exactly how this method works. You will see very quickly why we sometimes call this the ascii-art method of grid layout!
Naming a grid area
------------------
You have already encountered the [`grid-area`](../grid-area) property. This is the property that can take as a value all four of the lines used to position a grid area.
```
.box1 {
grid-area: 1 / 1 / 4 / 2;
}
```
What we are doing here when defining all four lines, is defining the area by specifying the lines that enclose that area.
We can also define an area by giving it a name and then specify the location of that area in the value of the [`grid-template-areas`](../grid-template-areas) property. You can choose what you would like to name your area. For example, if I wish to create the layout shown below I can identify four main areas.
* a header
* a footer
* a sidebar
* the main content
With the [`grid-area`](../grid-area) property I can assign each of these areas a name. This will not yet create any layout, but we now have named areas to use in a layout.
```
.header {
grid-area: hd;
}
.footer {
grid-area: ft;
}
.content {
grid-area: main;
}
.sidebar {
grid-area: sd;
}
```
Having defined these names I then create my layout. This time, instead of placing my items using line numbers specified on the items themselves, I create the whole layout on the grid container.
```
.wrapper {
display: grid;
grid-template-columns: repeat(9, 1fr);
grid-auto-rows: minmax(100px, auto);
grid-template-areas:
"hd hd hd hd hd hd hd hd hd"
"sd sd sd main main main main main main"
"ft ft ft ft ft ft ft ft ft";
}
```
```
<div class="wrapper">
<div class="header">Header</div>
<div class="sidebar">Sidebar</div>
<div class="content">Content</div>
<div class="footer">Footer</div>
</div>
```
Using this method we do not need to specify anything at all on the individual grid items, everything happens on our grid container. We can see the layout described as the value of the [`grid-template-areas`](../grid-template-areas) property.
Leaving a grid cell empty
-------------------------
We have completely filled our grid with areas in this example, leaving no white space. However you can leave grid cells empty with this method of layout. To leave a cell empty use the full stop character, '`.`'. If I want to only display the footer directly under the main content I would need to leave the three cells underneath the sidebar empty.
```
.header {
grid-area: hd;
}
.footer {
grid-area: ft;
}
.content {
grid-area: main;
}
.sidebar {
grid-area: sd;
}
```
```
.wrapper {
display: grid;
grid-template-columns: repeat(9, 1fr);
grid-auto-rows: minmax(100px, auto);
grid-template-areas:
"hd hd hd hd hd hd hd hd hd"
"sd sd sd main main main main main main"
". . . ft ft ft ft ft ft";
}
```
```
<div class="wrapper">
<div class="header">Header</div>
<div class="sidebar">Sidebar</div>
<div class="content">Content</div>
<div class="footer">Footer</div>
</div>
```
In order to make the layout neater I can use multiple `.` characters. As long as there is at least one white space between the full stops it will be counted as one cell. For a complex layout there is a benefit to having the rows and columns neatly aligned. It means that you can actually see, right there in the CSS, what this layout looks like.
Spanning multiple cells
-----------------------
In our example each of the areas spans multiple grid cells and we achieve this by repeating the name of that grid area multiple times with white space between. You can add extra white space in order to keep your columns neatly lined up in the value of `grid-template-areas`. You can see that I have done this in order that the `hd` and `ft` line up with `main`.
The area that you create by chaining the area names must be rectangular, at this point there is no way to create an L-shaped area. The specification does note that a future level might provide this functionality. You can however span rows just as easily as columns. For example we could make our sidebar span down to the end of the footer by replacing the `.` with `sd`.
```
.header {
grid-area: hd;
}
.footer {
grid-area: ft;
}
.content {
grid-area: main;
}
.sidebar {
grid-area: sd;
}
```
```
.wrapper {
display: grid;
grid-template-columns: repeat(9, 1fr);
grid-auto-rows: minmax(100px, auto);
grid-template-areas:
"hd hd hd hd hd hd hd hd hd"
"sd sd sd main main main main main main"
"sd sd sd ft ft ft ft ft ft";
}
```
The value of [`grid-template-areas`](../grid-template-areas) must show a complete grid, otherwise it is invalid (and the property is ignored). This means that you must have the same number of cells for each row, if empty with a full stop character demonstrating that the cell is to be left empty. You will also create an invalid grid if your areas are not rectangular.
Redefining the grid using media queries
---------------------------------------
As our layout is now contained in one part of the CSS, this makes it very easy to make changes at different breakpoints. You can do this by redefining the grid, the position of items on the grid, or both at once.
When doing this, define the names for your areas outside of any media queries. That way the content area would always be called `main` no matter where on the grid it is placed.
For our layout above, we might like to have a very simple layout at narrow widths, defining a single column grid and stacking up our items.
```
.header {
grid-area: hd;
}
.footer {
grid-area: ft;
}
.content {
grid-area: main;
}
.sidebar {
grid-area: sd;
}
.wrapper {
display: grid;
grid-auto-rows: minmax(100px, auto);
grid-template-columns: 1fr;
grid-template-areas:
"hd"
"main"
"sd"
"ft";
}
```
We can then redefine that layout inside media queries to go to our two columns layout, and perhaps take it to a three column layout if the available space is even wider. Note that for the wide layout I keep my nine column track grid, I redefine where items are placed using `grid-template-areas`.
```
@media (min-width: 500px) {
.wrapper {
grid-template-columns: repeat(9, 1fr);
grid-template-areas:
"hd hd hd hd hd hd hd hd hd"
"sd sd sd main main main main main main"
"sd sd sd ft ft ft ft ft ft";
}
}
@media (min-width: 700px) {
.wrapper {
grid-template-areas:
"hd hd hd hd hd hd hd hd hd"
"sd sd main main main main main ft ft";
}
}
```
Using `grid-template-areas` for UI elements
-------------------------------------------
Many of the grid examples you will find online make the assumption that you will use grid for main page layout, however grid can be just as useful for small elements as those larger ones. Using [`grid-template-areas`](../grid-template-areas) can be especially nice as it is easy to see in the code what your element looks like.
### Media object example
As a very simple example we can create a "media object". This is a component with space for an image or other media on one side and content on the other. The image might be displayed on the right or left of the box.
Our grid is a two-column track grid, with the column for the image sized at `1fr` and the text `3fr`. If you wanted a fixed width image area, then you could set the image column as a pixel width, and assign the text area `1fr`. A single column track of `1fr` would then take up the rest of the space.
We give the image area a grid area name of `img` and the text area `content`, then we can lay those out using the `grid-template-areas` property.
```
\* {
box-sizing: border-box;
}
.media {
border: 2px solid #f76707;
border-radius: 5px;
background-color: #fff4e6;
max-width: 400px;
display: grid;
grid-template-columns: 1fr 3fr;
grid-template-areas: "img content";
margin-bottom: 1em;
}
.media .image {
grid-area: img;
background-color: #ffd8a8;
}
.media .text {
grid-area: content;
padding: 10px;
}
```
```
<div class="media">
<div class="image"></div>
<div class="text">
This is a media object example. We can use grid-template-areas to switch
around the image and text part of the media object.
</div>
</div>
```
### Displaying the image on the other side of the box
We might want to be able to display our box with the image the other way around. To do this, we redefine the grid to put the `1fr` track last, and flip the values in [`grid-template-areas`](../grid-template-areas).
```
\* {
box-sizing: border-box;
}
.media {
border: 2px solid #f76707;
border-radius: 5px;
background-color: #fff4e6;
max-width: 400px;
display: grid;
grid-template-columns: 1fr 3fr;
grid-template-areas: "img content";
margin-bottom: 1em;
}
.media.flipped {
grid-template-columns: 3fr 1fr;
grid-template-areas: "content img";
}
.media .image {
grid-area: img;
background-color: #ffd8a8;
}
.media .text {
grid-area: content;
padding: 10px;
}
```
```
<div class="media flipped">
<div class="image"></div>
<div class="text">
This is a media object example. We can use grid-template-areas to switch
around the image and text part of the media object.
</div>
</div>
```
Grid definition shorthands
--------------------------
Having looked at various ways of placing items on our grids and many of the properties used to define grid, this is a good time to take a look at a couple of shorthands that are available for defining the grid and many things about it all in one line of CSS.
These can quickly become difficult to read for other developers, or even your future self. However they are part of the specification and it is likely you will come across them in examples or in use by other developers, even if you choose not to use them.
Before using any shorthand it is worth remembering that shorthands not only enable the setting of many properties in one go, they also act to **reset things** to their initial values that you do not, or cannot set in the shorthand. Therefore if you use a shorthand, be aware that it may reset things you have applied elsewhere.
The two shorthands for the grid container are the Explicit Grid Shorthand `grid-template` and the Grid Definition Shorthand `grid`.
### `grid-template`
The [`grid-template`](../grid-template) property sets the following properties:
* [`grid-template-rows`](../grid-template-rows)
* [`grid-template-columns`](../grid-template-columns)
* [`grid-template-areas`](../grid-template-areas)
The property is referred to as the Explicit Grid Shorthand because it is setting those things that you control when you define an explicit grid, and not those which impact any implicit row or column tracks that might be created.
The following code creates a layout using [`grid-template`](../grid-template) that is the same as the layout created earlier in this guide.
```
.wrapper {
display: grid;
grid-template:
"hd hd hd hd hd hd hd hd hd" minmax(100px, auto)
"sd sd sd main main main main main main" minmax(100px, auto)
"ft ft ft ft ft ft ft ft ft" minmax(100px, auto)
/ 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr;
}
```
The first value is our `grid-template-areas` value but we also declare the size of the row at the end of each row. This is what the `minmax(100px, auto)` is doing.
Then after `grid-template-areas` we have a forward slash, after that is an explicit track listing of column tracks.
### `grid`
The [`grid`](../grid) shorthand goes a step further and also sets properties used by the implicit grid. So you will be setting:
* [`grid-template-rows`](../grid-template-rows)
* [`grid-template-columns`](../grid-template-columns)
* [`grid-template-areas`](../grid-template-areas)
* [`grid-auto-rows`](../grid-auto-rows)
* [`grid-auto-columns`](../grid-auto-columns)
* [`grid-auto-flow`](../grid-auto-flow)
You can use this syntax in the exact same way as the [`grid-template`](../grid-template) shorthand, just be aware than when doing so you will reset the other values set by the property.
```
.wrapper {
display: grid;
grid:
"hd hd hd hd hd hd hd hd hd" minmax(100px, auto)
"sd sd sd main main main main main main" minmax(100px, auto)
"ft ft ft ft ft ft ft ft ft" minmax(100px, auto)
/ 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr;
}
```
We will revisit the other functionality offered by this shorthand later in these guides when we take a look at auto placement and the grid-auto-flow property.
If you have worked through these initial guides you now should be in a position to create grid layouts using line-based placement or named areas. Take some time to build some common layout patterns using grid, while there are lots of new terms to learn, the syntax is relatively straightforward. As you develop examples, you are likely to come up with some questions and use cases for things we haven't covered yet. In the rest of these guides we will be looking at some more of the detail included in the specification – in order that you can begin to create advanced layouts with it.
| programming_docs |
css Flow layout and writing modes Flow layout and writing modes
=============================
The CSS 2.1 specification, which details how normal flow behaves, assumes a horizontal writing mode. [Layout](block_and_inline_layout_in_normal_flow) properties should work in the same way in vertical writing modes. In this guide, we look at how flow layout behaves when used with different document writing modes.
This is not a comprehensive guide to the use of writing modes in CSS, the aim here is to document the areas where flow layout interacts with writing modes in possibly unanticipated ways. The [external resources](#external_resources) and [see also](#see_also) sections of this document link to more writing modes resources.
Writing modes specification
---------------------------
The CSS Writing Modes Level 3 Specification defines the impact a change the document writing mode has on flow layout. In the writing modes introduction, [the specification says](https://drafts.csswg.org/css-writing-modes-3/#text-flow),
> "A writing mode in CSS is determined by the [`writing-mode`](../writing-mode), [`direction`](../direction), and [`text-orientation`](../text-orientation) properties. It is defined primarily in terms of its inline base direction and block flow direction."
>
>
The specification defines the *inline base direction* as the direction in which content is ordered on a line. This defines the start and end of the inline direction. The start is where sentences start and the end is where a line of text ends before it would begin to wrap onto a new line.
The *block flow direction* is the direction in which boxes, for example paragraphs, stack in that writing mode. The CSS writing-mode property controls the block flow direction. If you want to change your page, or part of your page, to `vertical-lr` then you can set `writing-mode: vertical-lr` on the element and this will change the direction of the blocks and therefore the inline direction as well.
While certain languages will use a particular writing mode or text direction, we can also use these properties for creative effect, such as running a heading vertically.
Block flow direction
--------------------
The [`writing-mode`](../writing-mode) property accepts the values `horizontal-tb`, `vertical-rl` and `vertical-lr`. These values control the direction that blocks flow on the page. The initial value is `horizontal-tb,` which is a top to bottom block flow direction with a horizontal inline direction. Left to right languages, such as English, and Right to left languages, such as Arabic, are all `horizontal-tb`.
The following example shows blocks using `horizontal-tb`.
The value `vertical-rl` gives you a right-to-left block flow direction with a vertical inline direction, as shown in the next example.
The final example demonstrates the third possible value for `writing-mode` — `vertical-lr`. This gives you a left-to-right block flow direction and a vertical inline direction.
Nested writing modes
--------------------
When a nested box is assigned a different writing mode to its parent, then an inline level box will display as if it has `display: inline-block`.
A block-level box will establish a new block formatting context, meaning that if its inner display type would be `flow`, it will get a computed display type of `flow-root`. This is shown in the next example where the box which displays as `horizontal-tb` contains a float which is contained due to its parent establishing a new BFC.
Replaced elements
-----------------
Replaced elements such as images will not change their orientation based on the `writing-mode` property. However, replaced elements such as form controls which include text, should match the writing mode in use.
Logical properties and values
-----------------------------
Once you are working in writing modes other than `horizontal-tb` many of the properties and values that are mapped to the physical dimensions of the screen seem strange. For example, if you give a box a width of 100px, in `horizontal-tb` that would control the size in the inline direction. In `vertical-lr` it controls the size in the block direction because it does not rotate with the text.
Therefore, we have new properties of [`block-size`](../block-size) and [`inline-size`](../inline-size). If we give our block an `inline-size` of 100px, it doesn't matter whether we are in a horizontal or a vertical writing mode, `inline-size` will always mean the size in the inline direction.
The [CSS Logical Properties and Values](../css_logical_properties) specification includes logical versions of the properties that control margins, padding and borders as well as other mappings for things that we have typically used physical directions to specify.
Summary
-------
In most cases, flow layout works as you would expect it to when changing the writing mode of the document or parts of the document. This can be used to properly typeset vertical languages or for creative reasons. CSS is making this easier by way of introducing logical properties and values so that when working in a vertical writing mode sizing can be based on element's inline and block size. This will be useful when creating components which can work in different writing-modes.
See also
--------
* [Writing Modes](../css_writing_modes)
* [Writing Modes And CSS Layout](https://www.smashingmagazine.com/2019/08/writing-modes-layout/)
* [CSS Writing Modes](https://24ways.org/2016/css-writing-modes/)
css Block and inline layout in normal flow Block and inline layout in normal flow
======================================
In this guide, we will explore the basics of how Block and Inline elements behave when they are part of the normal flow.
Normal Flow is defined in the [CSS 2.1 specification](https://www.w3.org/TR/CSS2/visuren.html#normal-flow), which explains that any boxes in normal flow will be part of a *formatting context*. They can be either block or inline, but not both at once. We describe block-level boxes as participating in a *block formatting context*, and inline-level boxes as participating in an *inline formatting context*.
The behavior of elements which have a block or inline formatting context is also defined in this specification. For elements with a block formatting context, the spec says:
> "In a block formatting context, boxes are laid out one after the other, vertically, beginning at the top of a containing block. The vertical distance between two sibling boxes is determined by the 'margin' properties. Vertical margins between adjacent block-level boxes in a block formatting context collapse.
>
> In a block formatting context, each box's left outer edge touches the left edge of the containing block (for right-to-left formatting, right edges touch)." - 9.4.1
>
>
For elements with an inline formatting context:
> "In an inline formatting context, boxes are laid out horizontally, one after the other, beginning at the top of a containing block. Horizontal margins, borders, and padding are respected between these boxes. The boxes may be aligned vertically in different ways: their bottoms or tops may be aligned, or the baselines of text within them may be aligned. The rectangular area that contains the boxes that form a line is called a line box." - 9.4.2
>
>
Note that the CSS 2.1 specification describes documents as being in a horizontal, top to bottom writing mode. For example, by describing vertical distance between block boxes. The behavior on block and inline elements is the same when working in a vertical writing mode, and we will explore this in a future guide on Flow Layout and Writing Modes.
Elements participating in a block formatting context
----------------------------------------------------
Block elements in a horizontal writing mode such as English, layout vertically, one below the other.
In a vertical writing mode then would lay out horizontally.
In this guide, we will be working in English and therefore a horizontal writing mode. However, everything described should work in the same way if your document is in a vertical writing mode.
As defined in the specification, the margins between two block boxes are what creates separation between the elements. We see this with a very simple layout of two paragraphs, to which I have added a border. The default browser stylesheet adds spacing between the paragraphs by way of adding a margin to the top and bottom.
If we set margins on the paragraph element to `0` then the borders will touch.
By default block elements will consume all of the space in the inline direction, so our paragraphs spread out and get as big as they can inside their containing block. If we give them a width, they will continue to lay out one below the other - even if there would be space for them to be side by side. Each will start against the start edge of the containing block, so the place at which sentences would begin in that writing mode.
### Margin collapsing
The spec explains that margins between block elements *collapse*. This means that if you have an element with a top margin immediately after an element with a bottom margin, rather than the total space being the sum of these two margins, the margin collapses, and so will essentially become as large as the larger of the two margins.
In the example below, the paragraphs have a top margin of `20px` and a bottom margin of `40px`. The size of the margin between the paragraphs is `40px` as the smaller top margin on the second paragraph has collapsed with the larger bottom margin of the first.
You can read more about margin collapsing in our article [Mastering Margin Collapsing](../css_box_model/mastering_margin_collapsing).
**Note:** If you are not sure whether margins are collapsing, check the Box Model values in your browser DevTools. This will give you the actual size of the margin which can help you to identify what is happening.
Elements participating in an inline formatting context
------------------------------------------------------
Inline elements display one after the other in the direction that sentences run in that particular writing mode. While we don't tend to think of inline elements as having a box, as with everything in CSS they do. These inline boxes are arranged one after the other. If there is not enough space in the containing block for all of the boxes a box can break onto a new line. The lines created are known as line boxes.
In the following example, we have three inline boxes created by a paragraph with a [`<strong>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/strong) element inside it.
The boxes around the words before the `<strong>` element and after the `<strong>` element are referred to as anonymous boxes, boxes introduced to ensure that everything is wrapped in a box, but ones that we cannot target directly.
The line box size in the block direction (so the height when working in English) is defined by the tallest box inside it. In the next example, I have made the `<strong>` element 300%; that content now defines the height of the line box on that line.
Find out more about how Block and Inline Boxes behave in our Guide to the [Visual Formatting Model](../visual_formatting_model).
The display property and flow layout
------------------------------------
In addition to the rules existing in CSS2.1, new levels of CSS further describe the behavior of block and inline boxes. The [`display`](../display) property defines how a box and any boxes inside it behave. In the CSS Display Model Level 3, we can learn more about how the `display` property changes the behavior of boxes and the boxes they generate.
The display type of an element defines the outer display type; this dictates how the box displays alongside other elements in the same formatting context. It also defines the inner display type, which dictates how boxes inside this element behave. We can see this very clearly when considering a flex layout. In the example below I have a [`<div>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/div), which I have given `display: flex`. The flex container behaves like a block element: it displays on a new line and takes up all of the space it can in the inline direction. This is the outer display type of `block`.
The flex items however are participating in a flex formatting context, because their parent is the element with `display: flex`, which has an inner display type of `flex`, establishing the flex formatting context for the direct children.
Therefore you can think of every box in CSS working in this way. The box itself has an outer display type, so it knows how to behave alongside other boxes. It then has an inner display type which changes the way its children behave. Those children then have an outer and inner display type too. The flex items in the previous example become flex level boxes, so their outer display type is dictated by way of them being part of the flex formatting context. They have an inner display type of *flow* however, meaning that their children participate in normal flow. Items nested inside our flex item lay themselves out as block and inline elements unless something changes their display type.
This concept of the outer and inner display type is important as this tells us that a container using a layout method such as Flexbox (`display: flex`) and Grid Layout (`display: grid`) is still participating in block and inline layout, due to the outer display type of those methods being `block`.
### Changing the Formatting Context an element participates in
Browsers display items as part of a block or inline formatting context in terms of what normally makes sense for that element. For example, a [`<strong>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/strong) element is used to highlight a word and displays bold in browsers. It would not generally make sense for that `<strong>` element to be displayed as a block level element, breaking onto a new line. If you did want all `<strong>` elements to display as block elements, you could do so by setting `display: block` on `<strong>`. This means that you can always use most of the semantic HTML elements to markup your content, and then change the way it displays using CSS.
Summary
-------
In this guide, we have looked at how elements display in normal flow, as block and inline elements. Due to the default behavior of these elements, an HTML document with no CSS styling at all, will display in a readable way. By understanding how normal flow works you will find layout easier, as you understand the starting point for making changes to how elements are displayed.
See also
--------
* [CSS Basic Box Model](../css_box_model)
* *[Normal Flow](https://developer.mozilla.org/en-US/docs/Learn/CSS/CSS_layout/Normal_Flow)* - Learn Layout
* [Inline elements](https://developer.mozilla.org/en-US/docs/Web/HTML/Inline_elements)
* [Block-level elements](https://developer.mozilla.org/en-US/docs/Web/HTML/Block-level_elements)
css In flow and out of flow In flow and out of flow
=======================
The [previous guide](block_and_inline_layout_in_normal_flow) explained block and inline layout in normal flow. All elements that are in flow will be laid out using this method.
The following example contains a heading, paragraph, a list and a final paragraph which contains a `strong` element. The heading and paragraphs are block level, the `strong` element inline. The list is displayed using flexbox to arrange the items into a row, however it too is participating in block and inline layout - the container has an outside `display` type of `block`.
All of the elements can be said to be in flow. Appearing on the page in the order that they are in the source.
Taking an item out of flow
--------------------------
All elements are in-flow apart from:
* floated items
* items with `position: absolute` (including `position: fixed` which acts in the same way)
* the root element (`html`)
Out of flow items create a new Block Formatting Context (BFC) and therefore everything inside them can be seen as a mini layout, separate from the rest of the page. The root element therefore is out of flow, as the container for everything in our document, and establishes the Block Formatting Context for the document.
### Floated items
In this example, there is a `div` and then two paragraphs. A background color has been added to the paragraphs, and the `div` is floated left. The `div` is now out of flow.
As a float it is first laid out according to where it would be in normal flow, then taken out of flow and moved to the left as far as possible.
You can see the background color of the following paragraph running underneath, it is only the line boxes of that paragraph that have been shortened to cause the effect of wrapping content around the float. The box of our paragraph is still displaying according to the rules of normal flow. This is why, to make space around a floated item, you must add a margin to the item, in order to push the line boxes away from it. You cannot apply anything to the following in-flow content to achieve that.
### Absolute positioning
Giving an item `position: absolute` or `position: fixed` removes it from flow, and any space that it would have taken up is removed. In the next example I have three paragraph elements, the second element has `position: absolute`, with offset values of `top: 30px` and `right: 30px`. It has been removed from document flow.
Using `position: fixed` also removes the item from flow, however the offsets are based on the viewport rather than the containing block.
When taking an item out of flow with positioning, you will need to manage the possibility of content overlapping. Out of flow essentially means that the other elements on your page no longer know that element exists so will not respond to it.
### Relative positioning and flow
If you give an item relative positioning with `position: relative`, it remains in flow. However, you are then able to use the offset values to push it around. The space that it would have been placed in normal flow is reserved however, as you can see in the example below.
When you do anything to remove or shift an item from where it would be placed in normal flow, you can expect to need to do some managing of the content and the content around it to prevent overlaps. Whether that involves clearing floats, or ensuring that an element with `position: absolute` does not sit on top of some other content. For this reason methods which remove elements from being in-flow should be used with understanding of the effect that they have.
Summary
-------
In this guide, we have covered the ways to take an element out of flow in order to achieve some very specific types of positioning. In the next guide we will look at a related issue, that of creating a [Block Formatting Context](https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Block_formatting_context), in [Formatting Contexts Explained](intro_to_formatting_contexts).
See also
--------
* [Positioning](https://developer.mozilla.org/en-US/docs/Learn/CSS/CSS_layout/Positioning) in the CSS Layout learn area
css Introduction to formatting contexts Introduction to formatting contexts
===================================
This article introduces the concept of formatting contexts, of which there are several types, including block formatting contexts, inline formatting contexts, and flex formatting contexts. The basics of how they behave and how you can make use of these behaviors are also introduced.
Everything on a page is part of a **formatting context**, or an area which has been defined to lay out content in a particular way. A **block formatting context** (BFC) will lay child elements out according to block layout rules, a **flex formatting context** will lay its children out as [flex items](https://developer.mozilla.org/en-US/docs/Glossary/Flex_Item), etc. Each formatting context has specific rules about how layout behaves when in that context.
Block formatting contexts
-------------------------
The outermost element in a document that uses block layout rules establishes the first, or **initial block formatting context**. This means that every element inside the `<html>` element's block is laid out according to normal flow following the rules for block and inline layout. Elements participating in a BFC use the rules outlined by the CSS Box Model, which defines how an element's margins, borders, and padding interact with other blocks in the same context.
### Creating a new block formatting context
The [`<html>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/html) element is not the only element capable of creating a block formatting context. Any block-level element can be made to create a BFC by the application of certain CSS properties.
A new BFC is created in the following situations:
* elements made to float using [`float`](../float)
* [absolutely positioned](../position#types_of_positioning) elements
* elements with [`display: inline-block`](../display#inline-block)
* table cells or elements with `display: table-cell`, including anonymous table cells created when using the `display: table-*` properties
* table captions or elements with `display: table-caption`
* block elements where `overflow` has a value other than `visible`
* elements with `display: flow-root` or `display: flow-root list-item`
* elements with [`contain: layout`](../contain#layout), `content`, or `strict`
* [flex items](https://developer.mozilla.org/en-US/docs/Glossary/Flex_Item)
* grid items
* [multicol containers](../css_columns/basic_concepts_of_multicol)
* elements with [`column-span`](../column-span) set to `all`
This is useful because a new BFC will behave much like the outermost document in that it becomes a mini-layout inside the main layout. A BFC contains everything inside it, [`float`](../float) and [`clear`](../clear) only apply to items inside the same formatting context, and margins only collapse between elements in the same formatting context.
### BFC creation examples
Let's have a look at a couple of these in order to see the effect creating a new BFC.
In the example below, we have a floated element inside a `<div>` with a border applied. The content of that `<div>` has floated alongside the floated element. As the content of the float is taller than the content alongside it, the border of the `<div>` now runs through the float. As explained in the [guide to in-flow and out of flow elements](in_flow_and_out_of_flow), the float has been taken out of flow so the background and border of the div only contain the content and not the float.
Creating a new BFC would contain the float. A typical way to do this in the past has been to set `overflow: auto` or set other values than the initial value of `overflow: visible`.
Setting `overflow: auto` created a new BFC containing the float. Our `<div>` now becomes a mini-layout inside our layout. Any child element will be contained inside it.
The problem with using `overflow` to create a new BFC is that the `overflow` property is meant for telling the browser how you wish to deal with overflowing content. There are some occasions in which you will find you get unwanted scrollbars or clipped shadows when you use this property purely to create a BFC. In addition, it is potentially not very readable for a future developer, as it may not be obvious why you used `overflow` for this purpose. If you do this, it would be a good idea to comment the code to explain.
### Explicitly creating a BFC using display: flow-root
Using `display: flow-root` (or `display: flow-root list-item`) on the containing block will create a new BFC without any other potentially problematic side-effects.
With `display: flow-root` on the [`<div>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/div), everything inside that container participates in the block formatting context of that container, and floats will not poke out of the bottom of the element.
The name of the `flow-root` keyword refers to the fact that you're creating something that serves, in essence, like a new root element (like [`<html>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/html) does), given how the new context is created and its flow layout functions.
Inline formatting contexts
--------------------------
Inline formatting contexts exist inside other formatting contexts and can be thought of as the context of a paragraph. The paragraph creates an inline formatting context inside which such things as [`<strong>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/strong), [`<a>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a), or [`<span>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/span) elements are used on text.
The box model does not fully apply to items participating in an inline formatting context. In a horizontal writing mode line, horizontal padding, borders and margin will be applied to the element and push the text away left and right. However, margins above and below the element will not be applied. Vertical padding and borders will be applied but may overlap content above and below as, in the inline formatting context, the line boxes will not be pushed apart by padding and borders.
Other formatting contexts
-------------------------
This guide covers flow layout and is therefore not referring to other possible formatting contexts. As such, it is useful to understand that creating any kind of formatting context will change the way elements inside that formatting context behave. This behavior is always described in the specification and also here on MDN.
Summary
-------
In this guide, we have looked in more detail at the block and Inline formatting contexts and the important subject of creating a block formatting context (BFC). In the next guide, we will find out [how normal flow interacts with different writing modes](flow_layout_and_writing_modes).
See also
--------
* [Block formatting context](https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Block_formatting_context)
* [Visual Formatting Model](../visual_formatting_model)
* [CSS Box Model](../css_box_model)
| programming_docs |
css Flow layout and overflow Flow layout and overflow
========================
When there is more content than can fit into a container, an overflow situation occurs. Understanding how overflow behaves is important in dealing with any element with a constrained size in CSS. This guide explains how overflow works when working with normal flow.
What is overflow?
-----------------
Giving an element a fixed height and width, then adding significant content to the box, creates a basic overflow example:
The content goes into the box. Once it fills the box, it continues to overflow in a visible way, displaying content outside the box, potentially displaying under subsequent content. The property that controls how overflow behaves is the [`overflow`](../overflow) property which has an initial value of `visible`. This is why we can see the overflow content.
Controlling overflow
--------------------
There are other values that control how overflow content behaves. To hide overflowing content use a value of `hidden`. This may cause some of your content to not be visible.
Using a value of `scroll` contains the content in its box and add scrollbars to enable viewing it. Scrollbars will be added even if the content fits in the box.
Using a value of `auto` will display the content with no scrollbars if the content fits inside the box. If it doesn't fit then scrollbars will be added. Comparing the next example with the example for `overflow: scroll` you should see `overflow scroll` has horizontal and vertical scrollbars when it only needs vertical scrolling. The `auto` example below only adds the scrollbar in the direct we need to scroll.
As we have already learned, using any of these values, other than the default of `visible,` will create a new Block Formatting Context.
Note: In the [Working Draft of Overflow Level 3](https://www.w3.org/TR/css-overflow-3/), there is an additional value `overflow: clip`. This will act like `overflow: hidden` however it does not allow for programmatic scrolling, the box becomes non-scrollable. In addition it does not create a Block Formatting Context.
The overflow property is in reality a shorthand for the [`overflow-x`](../overflow-x) and [`overflow-y`](../overflow-y) properties. If you specify only one value for overflow, this value is used for both axes. However, you can specify both values in which case the first is used for `overflow-x` and therefore the horizontal direction, and the second for `overflow-y` and the vertical direction. In the below example, I have only specified `overflow-y: scroll` so we do not get the unwanted horizontal scrollbar.
Flow Relative Properties
------------------------
In the guide to [Writing Modes and Flow Layout](flow_layout_and_writing_modes), we looked at the newer properties of `block-size` and `inline-size` which make more sense when working with different writing modes than tying our layout to the physical dimensions of the screen. The Level 3 Overflow Module also includes flow relative properties for overflow - [`overflow-block`](../@media/overflow-block) and [`overflow-inline`](../@media/overflow-inline). These correspond to `overflow-x` and `overflow-y` but the mapping depends on the writing mode of the document.
These properties currently do not have implementations in browsers, so you will need to use the physical properties at the present time and adjust for your writing mode.
Indicating Overflow
-------------------
In the Level 3 Overflow specification we have some properties which can help improve the way content looks in an overflow situation.
### Inline-Axis Overflow
The [`text-overflow`](../text-overflow) property deals with text overflowing in the inline direction. It takes one of two values `clip`, in which case content is clipped when it overflows, this is the initial value and therefore the default behavior. We also have `ellipsis` which renders an ellipsis, which may be replaced with a better character for the language or writing mode in use.
### Block-Axis Overflow
There is also a proposal for a `block-overflow` property, although at the time of writing the name is still up for discussion. This proposal would enable the adding of an ellipsis when text overflows in the block dimension.
This is useful in the situation where you have a listing of articles, for example, and you display the listings in fixed height boxes which only take a limited amount of text. It may not be obvious to the reader that there is more content to click through to when clicking the box or the title. An ellipsis indicates clearly the fact there is more content. The specification would allow a string of content or a regular ellipsis to be inserted.
Summary
-------
Whether you are in continuous media on the web or in a Paged Media format such as print or EPUB, understanding how content overflows is useful when dealing with any layout method. By understanding how overflow works in normal flow, you should find it easier to understand the implications of overflow content in layout methods such as grid and flexbox.
css Basic concepts of CSS Scroll Snap Basic concepts of CSS Scroll Snap
=================================
The [CSS Scroll Snap specification](https://drafts.csswg.org/css-scroll-snap-1/) gives us a way to snap scrolling to certain points as the user scrolls through a document. This can be helpful in creating a more app-like experience on mobile or even on the desktop for some types of applications.
Key properties for CSS Scroll Snap
----------------------------------
The key properties of the Scroll Snap specification are:
* [`scroll-snap-type`](../scroll-snap-type): This property is used on the [scroll container](https://developer.mozilla.org/en-US/docs/Glossary/Scroll_container) to state the type and direction of scrolling.
* [`scroll-snap-align`](../scroll-snap-align): This property must be used on child elements in order to set the position that scrolling will snap to.
The example below demonstrates scroll snapping along the vertical axis, which is defined by `scroll-snap-type`. Additionally, `scroll-snap-align` is used on the section element to dictate the point where the scrolling should stop.
Using scroll-snap-type
----------------------
The [`scroll-snap-type`](../scroll-snap-type) property needs to know the direction in which scroll snapping happens. This could be `x`, `y`, or the logical mappings `block` or `inline`. You can also use the keyword `both` to have scroll snapping work along both axes.
You can also pass in the keywords `mandatory` or `proximity`. The `mandatory` keyword tells the browser whether the content *has* to snap to a certain point, no matter where the scroll is. The `proximity` keyword means that the content may snap to the point, but does not have to.
Using `mandatory` gives a very consistent experience — you know that the browser will always snap to each defined point. This means you can be confident that something you expect to be at the top of the screen will be when scrolling finishes. However, it can cause problems if the content is larger than you expect — users may find themselves in the frustrating position of never being able to scroll and view a certain point in the content. Therefore, use of mandatory should be carefully considered and only used in situations where you know how much content is on the screen at any one time.
The `proximity` value will only snap to a position when it is close by, the exact distance being left to the browser to decide.
In the example below, you can change the value between `mandatory` and `proximity` to see the effect this has on the scroll experience.
Using scroll-snap-align
-----------------------
The [`scroll-snap-align`](../scroll-snap-align) property can take a value of `start`, `end`, or `center` — indicating the point the content should snap to in the scroll container. In the example below, you can change the value of `scroll-snap-align` to see how this changes the scroll behavior.
Using scroll-padding
--------------------
If you do not want the content to snap right to the edge of the scroll container, you can use the [`scroll-padding`](../scroll-padding) property or its equivalent longhand values to set some padding.
In the below example, `scroll-padding` is set to 40 pixels. When the content snaps to the start of the second and third sections, the scrolling stops 40 pixels away from the start of the section. Try changing the `scroll-padding` value to see how this changes the distance.
This is potentially useful if you have a fixed element, for example a navigation bar, which could end up overlapping scrolled content. By using `scroll-padding`, you can reserve a space for it as in the example below where the `<h1>` remains on screen as the content scrolls beneath it. Without padding, the heading would overlap some of the content when snapping happens.
Using scroll-margin
-------------------
The [`scroll-margin`](../scroll-margin) property can be set on child elements, essentially defining an outset from the defined box. This allows for different amounts of space for different child elements, and can be used in conjunction with `scroll-padding` on the parent. Try this in the example below.
Using scroll-snap-stop
----------------------
The [`scroll-snap-stop`](../scroll-snap-stop) property tells the browser whether it should snap to each defined snap point — meaning that in our examples above we would stop at the start of each section — or be able to skip past sections.
It could be helpful in ensuring users see each section of the scroller and don't accidentally zip past them. However, it could be problematic in making the scrolling experience slower if the user is looking for a particular section.
Browser compatibility
---------------------
css oklab() oklab()
=======
**Experimental:** **This is an [experimental technology](https://developer.mozilla.org/en-US/docs/MDN/Writing_guidelines/Experimental_deprecated_obsolete#experimental)**
Check the [Browser compatibility table](#browser_compatibility) carefully before using this in production.
The `oklab()` functional notation expresses a given color in the Oklab color space, which attempts to mimic how color is perceived by the human eye. The `oklab()` works with a Cartesian coordinate system on the OKlab color space, the a- and b-axes. If you want a polar color system, chroma and hue, use [`oklch()`](oklch).
Oklab is a perceptual color space and is useful to:
* Transform an image to grayscale, without changing its lightness.
* Modify the saturation of colors, while keeping user perception of hue and lightness
* Create smooth and uniform gradients of colors (when interpolated manually, for example, in a [`<canvas>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/canvas) element).
The function `oklab()` can represent any color from the Oklab color space that is wider than RGB and include wide gamut and P3 colors.
Syntax
------
```
/\* oklab(lightness a-axis b-axis) \*/
oklab(40.1% 0.1143 0.045);
oklab(59.69% 0.1007 0.1191);
/\* oklab(lightness a-axis b-axis / Alpha) \*/
oklab(59.69% 0.1007 0.1191 / 0.5);
```
**Note:** The oklab() function does **not** support commas to separate its values as some other color functions do, and the optional alpha value needs to be preceded with a forward slash (`/`) when specified.
### Values
lightness A [`<percentage>`](../percentage) between `0%` representing black and `100%` representing white, specifying the perceived lightness.
a-axis The distance along the `a` axis in the Oklab colorspace, that is how green/red the color is.
b-axis the distance along the `b` axis in the Oklab colorspace, that is how blue/yellow the color is.
alpha A [`<number>`](../number) between `0` and `1`, or a [`<percentage>`](../percentage), where the number `1` corresponds to `100%` (full opacity), representing the transparency (or alpha channel) of the color.
### Formal syntax
```
<oklab()> =
oklab( [[](../value_definition_syntax#brackets) [<percentage>](../percentage) [|](../value_definition_syntax#single_bar) [<number>](../number) [|](../value_definition_syntax#single_bar) none []](../value_definition_syntax#brackets) [[](../value_definition_syntax#brackets) [<percentage>](../percentage) [|](../value_definition_syntax#single_bar) [<number>](../number) [|](../value_definition_syntax#single_bar) none []](../value_definition_syntax#brackets) [[](../value_definition_syntax#brackets) [<percentage>](../percentage) [|](../value_definition_syntax#single_bar) [<number>](../number) [|](../value_definition_syntax#single_bar) none []](../value_definition_syntax#brackets) [[](../value_definition_syntax#brackets) / [[](../value_definition_syntax#brackets) <alpha-value> [|](../value_definition_syntax#single_bar) none []](../value_definition_syntax#brackets) []](../value_definition_syntax#brackets)[?](../value_definition_syntax#question_mark) )
<alpha-value> =
[<number>](../number) [|](../value_definition_syntax#single_bar)
[<percentage>](../percentage)
```
Examples
--------
### Green with oklab()
```
div {
padding: 1em;
margin: 1em;
border: solid 1px black;
}
.ref {
background-color: green;
}
.oklab {
background-color: oklab(51.975% -0.1403 0.10768);
}
```
```
<div class="ref">RGB</div>
<div class="oklab">OKLAB</div>
```
Specifications
--------------
| Specification |
| --- |
| [CSS Color Module Level 4 # ok-lab](https://w3c.github.io/csswg-drafts/css-color/#ok-lab) |
Browser compatibility
---------------------
| | Desktop | Mobile |
| --- | --- | --- |
| | Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet |
| `oklab` | No | No | No | No | No | 15.4 | No | No | No | No | 15.4 | No |
See also
--------
* [A perceptual color space for image processing](https://bottosson.github.io/posts/oklab/)
* [`oklch()`](oklch) use the same color space as `oklab()` but a polar coordinate system.
css hwb() hwb()
=====
The `hwb()` functional notation expresses a given color according to its hue, whiteness, and blackness. An optional alpha component represents the color's transparency.
Try it
------
Syntax
------
```
hwb(194 0% 0%) /\* #00c3ff \*/
hwb(194 0% 0% / .5) /\* #00c3ff with 50% opacity \*/
```
### Values
**Note:** The HWB function does **not** use commas to separate its values as with previous color functions and the optional alpha value needs to be preceded with a forward slash (`/`) if specified.
Functional notation: `hwb(H W B[ / A])`
`H` (hue) is an [`<angle>`](../angle) of the color circle given in `deg`s, `rad`s, `grad`s, or `turn`s in the [CSS Color](https://drafts.csswg.org/css-color/#typedef-hue) specification. When written as a unitless [`<number>`](../number), it is interpreted as degrees, as specified in the [CSS Color Level 3](https://drafts.csswg.org/css-color-3/#hsl-color) specification. By definition, red=0deg=360deg, with the other colors spread around the circle, so green=120deg, blue=240deg, etc. As an `<angle>`, it implicitly wraps around such that -120deg=240deg, 480deg=120deg, -1turn=1turn, etc.
`W` (whiteness) specifies the amount of white to mix in, as a percentage from 0% (no whiteness) to 100% (full whiteness).
`B` (blackness) specifies the amount of black to mix in, also from 0% (no blackness) to 100% (full blackness).
`A` (alpha) can be a [`<number>`](../number) between `0` and `1`, or a [`<percentage>`](../percentage), where the number `1` corresponds to `100%` (full opacity).
### Formal syntax
```
<hwb()> =
hwb( [[](../value_definition_syntax#brackets) <hue> [|](../value_definition_syntax#single_bar) none []](../value_definition_syntax#brackets) [[](../value_definition_syntax#brackets) [<percentage>](../percentage) [|](../value_definition_syntax#single_bar) none []](../value_definition_syntax#brackets) [[](../value_definition_syntax#brackets) [<percentage>](../percentage) [|](../value_definition_syntax#single_bar) none []](../value_definition_syntax#brackets) [[](../value_definition_syntax#brackets) / [[](../value_definition_syntax#brackets) <alpha-value> [|](../value_definition_syntax#single_bar) none []](../value_definition_syntax#brackets) []](../value_definition_syntax#brackets)[?](../value_definition_syntax#question_mark) )
<hue> =
[<number>](../number) [|](../value_definition_syntax#single_bar)
[<angle>](../angle)
<alpha-value> =
[<number>](../number) [|](../value_definition_syntax#single_bar)
[<percentage>](../percentage)
```
Specifications
--------------
| Specification |
| --- |
| [CSS Color Module Level 4 # the-hwb-notation](https://w3c.github.io/csswg-drafts/css-color/#the-hwb-notation) |
Browser compatibility
---------------------
| | Desktop | Mobile |
| --- | --- | --- |
| | Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet |
| `hwb` | 101 | 101 | 96 | No | 87 | 15 | 101 | 101 | 96 | 70 | 15 | 19.0 |
css device-cmyk() device-cmyk()
=============
The `device-cmyk()` functional notation is used to express CMYK colors in a device dependent way, specifying the cyan, magenta, yellow, and black components.
This approach to color is useful when creating material to be output to a particular printer, when the output for particular ink combinations is known. CSS processors may attempt to approximate the color, however the end result is likely to be different to the printed result.
Syntax
------
```
device-cmyk(0 81% 81% 30%);
device-cmyk(0 81% 81% 30% / .5);
device-cmyk(0 81% 81% 30% / .5, rgb(178 34 34));
```
### Values
Functional notation: `device-cmyk( <cmyk-component>{4} [ / <alpha-value> ]? , <color>? )`
`<cmyk-component>` is a list of 4 [`<number>`](../number) or [`<percentage>`](../percentage) values providing the cyan, magenta, yellow, and black components of CMYK color.
`/ <alpha-value>` (alpha) can be a [`<number>`](../number) between `0` and `1`, or a [`<percentage>`](../percentage), where the number `1` corresponds to `100%` (full opacity).
`<color>` is an optional fallback [`<color>`](../color_value) to use if the user agent does not know how to translate the CMYK color to RGB.
### Formal syntax
```
<device-cmyk()> =
device-cmyk( <cmyk-component>[{4}](../value_definition_syntax#curly_braces) [[](../value_definition_syntax#brackets) / <alpha-value> []](../value_definition_syntax#brackets)[?](../value_definition_syntax#question_mark) )
<cmyk-component> =
[<number>](../number) [|](../value_definition_syntax#single_bar)
[<percentage>](../percentage)
<alpha-value> =
[<number>](../number) [|](../value_definition_syntax#single_bar)
[<percentage>](../percentage)
```
Specifications
--------------
**No specification found**No specification data found for `css.types.color.device-cmyk`.
[Check for problems with this page](#on-github) or contribute a missing `spec_url` to [mdn/browser-compat-data](https://github.com/mdn/browser-compat-data). Also make sure the specification is included in [w3c/browser-specs](https://github.com/w3c/browser-specs).
Browser compatibility
---------------------
No compatibility data found for `css.types.color.device-cmyk`.
[Check for problems with this page](#on-github) or contribute missing data to [mdn/browser-compat-data](https://github.com/mdn/browser-compat-data).
css oklch() oklch()
=======
**Experimental:** **This is an [experimental technology](https://developer.mozilla.org/en-US/docs/MDN/Writing_guidelines/Experimental_deprecated_obsolete#experimental)**
Check the [Browser compatibility table](#browser_compatibility) carefully before using this in production.
The `oklch()` functional notation expresses a given color in the OKLCH color space. It has the same L axis as [`oklab()`](oklab), but uses polar coordinates C (Chroma) and H (Hue).
Syntax
------
```
oklch(40.1% 0.123 21.57)
oklch(59.69% 0.156 49.77)
oklch(59.69% 0.156 49.77 / .5)
```
### Values
Functional notation: `oklch(L C H [/ A])`
`L` specifies the perceived lightness, and is a [`<percentage>`](../percentage) between `0%` representing black and `100%` representing white.
The second argument `C` is the chroma (roughly representing the "amount of color"). Its minimum useful value is 0, while its maximum is theoretically unbounded (but in practice does not exceed 0.4).
The third argument `H` is the hue angle. `0deg` points along the positive "a" axis (toward purplish red), `90deg` points along the positive "b" axis (toward mustard yellow), `180deg` points along the negative "a" axis (toward greenish cyan), and `270deg` points along the negative "b" axis (toward sky blue).
`A` (alpha) can be a [`<number>`](../number) between `0` and `1`, or a [`<percentage>`](../percentage), where the number `1` corresponds to `100%` (full opacity).
### Formal syntax
```
<oklch()> =
oklch( [[](../value_definition_syntax#brackets) [<percentage>](../percentage) [|](../value_definition_syntax#single_bar) [<number>](../number) [|](../value_definition_syntax#single_bar) none []](../value_definition_syntax#brackets) [[](../value_definition_syntax#brackets) [<percentage>](../percentage) [|](../value_definition_syntax#single_bar) [<number>](../number) [|](../value_definition_syntax#single_bar) none []](../value_definition_syntax#brackets) [[](../value_definition_syntax#brackets) <hue> [|](../value_definition_syntax#single_bar) none []](../value_definition_syntax#brackets) [[](../value_definition_syntax#brackets) / [[](../value_definition_syntax#brackets) <alpha-value> [|](../value_definition_syntax#single_bar) none []](../value_definition_syntax#brackets) []](../value_definition_syntax#brackets)[?](../value_definition_syntax#question_mark) )
<hue> =
[<number>](../number) [|](../value_definition_syntax#single_bar)
[<angle>](../angle)
<alpha-value> =
[<number>](../number) [|](../value_definition_syntax#single_bar)
[<percentage>](../percentage)
```
Specifications
--------------
| Specification |
| --- |
| [CSS Color Module Level 4 # ok-lab](https://w3c.github.io/csswg-drafts/css-color/#ok-lab) |
Browser compatibility
---------------------
| | Desktop | Mobile |
| --- | --- | --- |
| | Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet |
| `oklch` | No | No | No | No | No | 15.4 | No | No | No | No | 15.4 | No |
See also
--------
* [A perceptual color space for image processing](https://bottosson.github.io/posts/oklab/)
* [OKLCH in CSS](https://evilmartians.com/chronicles/oklch-in-css-why-quit-rgb-hsl)
* [Safari Technology Preview 137 release notes](https://webkit.org/blog/12156/release-notes-for-safari-technology-preview-137/): includes `oklch()` and [`oklab()`](oklab) colors.
| programming_docs |
css color-mix() color-mix()
===========
**Experimental:** **This is an [experimental technology](https://developer.mozilla.org/en-US/docs/MDN/Writing_guidelines/Experimental_deprecated_obsolete#experimental)**
Check the [Browser compatibility table](#browser_compatibility) carefully before using this in production.
The `color-mix()` functional notation takes two [`color`](../color_value) values and returns the result of mixing them in a given colorspace by a given amount.
Syntax
------
```
color-mix(in lch, peru 40%, lightgoldenrod);
color-mix(in srgb, #34c9eb 20%, white);
```
### Values
Functional notation: `color-mix( in <colorspace> , [ <color> && <percentage>? ]#{2})`
`<colorspace>` is one of `srgb`, `srgb-linear`, `lab`, `oklab`, `xyz`, `xyz-d50`, `xyz-d65`, `hsl`, `hwb`, `lch`, `oklch`. There is no default.
`<color>` is any valid [`color`](../color_value).
`<percentage>` is the percentage of that color to mix.
### Formal syntax
```
<color-mix()> =
color-mix( <color-interpolation-method> , [[](../value_definition_syntax#brackets) [<color>](../color_value) [&&](../value_definition_syntax#double_ampersand) [<percentage [0,100]>](../percentage)[?](../value_definition_syntax#question_mark) []](../value_definition_syntax#brackets)[#](../value_definition_syntax#hash_mark)[{2}](../value_definition_syntax#curly_braces) )
<color-interpolation-method> =
in [[](../value_definition_syntax#brackets) <rectangular-color-space> [|](../value_definition_syntax#single_bar) <polar-color-space> <hue-interpolation-method>[?](../value_definition_syntax#question_mark) []](../value_definition_syntax#brackets)
<rectangular-color-space> =
srgb [|](../value_definition_syntax#single_bar)
srgb-linear [|](../value_definition_syntax#single_bar)
lab [|](../value_definition_syntax#single_bar)
oklab [|](../value_definition_syntax#single_bar)
xyz [|](../value_definition_syntax#single_bar)
xyz-d50 [|](../value_definition_syntax#single_bar)
xyz-d65
<polar-color-space> =
hsl [|](../value_definition_syntax#single_bar)
hwb [|](../value_definition_syntax#single_bar)
lch [|](../value_definition_syntax#single_bar)
oklch
<hue-interpolation-method> =
[[](../value_definition_syntax#brackets) shorter [|](../value_definition_syntax#single_bar) longer [|](../value_definition_syntax#single_bar) increasing [|](../value_definition_syntax#single_bar) decreasing []](../value_definition_syntax#brackets) hue
```
Examples
--------
### HTML
```
<ul>
<li>10% #34c9eb</li>
<li>40% #34c9eb</li>
<li>70% #34c9eb</li>
</ul>
```
### CSS
```
li:nth-child(1) {
background-color: color-mix(in srgb, #34c9eb 10%, white);
}
li:nth-child(2) {
background-color: color-mix(in srgb, #34c9eb 40%, white);
}
li:nth-child(3) {
background-color: color-mix(in srgb, #34c9eb 70%, white);
}
```
#### Result
In a supporting browser the three items become more blue as a higher percentage of `#34c9eb` is mixed in.
Specifications
--------------
| Specification |
| --- |
| [CSS Color Module Level 5 # color-mix](https://w3c.github.io/csswg-drafts/css-color-5/#color-mix) |
Browser compatibility
---------------------
| | Desktop | Mobile |
| --- | --- | --- |
| | Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet |
| `color-mix` | No | No | 88 | No | No | 15 | No | No | No | No | 15 | No |
css color-contrast() color-contrast()
================
**Experimental:** **This is an [experimental technology](https://developer.mozilla.org/en-US/docs/MDN/Writing_guidelines/Experimental_deprecated_obsolete#experimental)**
Check the [Browser compatibility table](#browser_compatibility) carefully before using this in production.
The `color-contrast()` functional notation takes a [`color`](../color_value) value and compares it to a list of other [`color`](../color_value) values, selecting the one with the highest contrast from the list.
Syntax
------
```
color-contrast(wheat vs tan, sienna, #d2691e)
color-contrast(#008080 vs olive, var(--myColor), #d2691e)
```
### Values
Functional notation: `color-contrast( <color> vs <color>#{2,} )`
`<color>` is any valid [`color`](../color_value).
`<color>#{2,}` is a comma-separated list of color values to compare with the first value.
Specifications
--------------
| Specification |
| --- |
| [Unknown specification # colorcontrast](https://w3c.github.io/csswg-drafts/css-color-6/#colorcontrast) |
Browser compatibility
---------------------
| | Desktop | Mobile |
| --- | --- | --- |
| | Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet |
| `color-contrast` | No | No | No | No | No | 15 | No | No | No | No | 15 | No |
css rgb() rgb()
=====
The `rgb()` functional notation expresses a color according to its red, green, and blue components. An optional alpha component represents the color's transparency.
**Note:** The legacy `rgba()` syntax is an alias for `rgb()`, accepting the same parameters and behaving in the same way.
Try it
------
Syntax
------
```
/\* Syntax with space-separated values \*/
rgb(255 255 255)
rgb(255 255 255 / .5)
/\* Syntax with comma-separated values \*/
rgb(255, 255, 255)
rgb(255, 255, 255, .5)
/\* Legacy rgba() syntax \*/
rgba(255 255 255)
rgba(255 255 255 / .5)
rgba(255, 255, 255)
rgba(255, 255, 255, .5)
```
The `rgb()` function accepts three space-separated values, representing respectively values for `red`, `green`, and `blue`. Optionally it may also be given a slash `/` followed by a fourth value, representing `alpha`.
The function also accepts a legacy syntax in which all values are separated with commas.
### Values
`red`, `green`, `blue`
These values represent color channels and may each be a [`<number>`](../number) clamped between 0 and 255, or a [`<percentage>`](../percentage), or the keyword `none`. You can't mix percentages and numbers, so:
* if any of these values is a number, then they must all be numbers or `none`
* if any of these values is a percentage, then they must all percentages or `none`.
`alpha` A [`<number>`](../number) clamped between `0` and `1`, or a [`<percentage>`](../percentage). This value represents opacity, where the number `1` corresponds to `100%` (full opacity). It defaults to 100%.
### Formal syntax
```
<rgb()> =
rgb( [[](../value_definition_syntax#brackets) [<percentage>](../percentage) [|](../value_definition_syntax#single_bar) none []](../value_definition_syntax#brackets)[{3}](../value_definition_syntax#curly_braces) [[](../value_definition_syntax#brackets) / [[](../value_definition_syntax#brackets) <alpha-value> [|](../value_definition_syntax#single_bar) none []](../value_definition_syntax#brackets) []](../value_definition_syntax#brackets)[?](../value_definition_syntax#question_mark) ) [|](../value_definition_syntax#single_bar)
rgb( [[](../value_definition_syntax#brackets) [<number>](../number) [|](../value_definition_syntax#single_bar) none []](../value_definition_syntax#brackets)[{3}](../value_definition_syntax#curly_braces) [[](../value_definition_syntax#brackets) / [[](../value_definition_syntax#brackets) <alpha-value> [|](../value_definition_syntax#single_bar) none []](../value_definition_syntax#brackets) []](../value_definition_syntax#brackets)[?](../value_definition_syntax#question_mark) )
<alpha-value> =
[<number>](../number) [|](../value_definition_syntax#single_bar)
[<percentage>](../percentage)
```
Examples
--------
### Legacy syntax: comma-separated values
For legacy reasons, the `rgb()` function accepts a form in which all values are separated using commas.
#### HTML
```
<div class="space-separated"></div>
<div class="comma-separated"></div>
```
#### CSS
```
div {
width: 100px;
height: 50px;
margin: 1rem;
}
div.space-separated {
background-color: rgb(255 0 0 / 0.5);
}
div.comma-separated {
background-color: rgb(255, 0, 0, 0.5);
}
```
#### Result
### Legacy syntax: rgba()
The legacy `rgba()` syntax is an alias for `rgb()`.
#### HTML
```
<div class="rgb"></div>
<div class="rgba"></div>
```
#### CSS
```
div {
width: 100px;
height: 50px;
margin: 1rem;
}
div.rgb {
background-color: rgb(255 0 0 / 0.5);
}
div.rgba {
background-color: rgba(255 0 0 / 0.5);
}
```
#### Result
Specifications
--------------
| Specification |
| --- |
| [CSS Color Module Level 4 # rgb-functions](https://w3c.github.io/csswg-drafts/css-color/#rgb-functions) |
Browser compatibility
---------------------
| | Desktop | Mobile |
| --- | --- | --- |
| | Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet |
| `rgb` | 1 | 12 | 1 | 4 | 3.5 | 1 | ≤37 | 18 | 4 | 10.1 | 1 | 1.0 |
| `alpha_parameter` | 65 | 79 | 52 | No | 52 | 12.1 | 65 | 65 | 52 | 47 | 12.2 | 9.0 |
| `float_values` | 66 | 79 | 52 | No | 53 | 12.1 | 66 | 66 | 52 | 47 | 12.2 | 9.0 |
| `space_separated_parameters` | 65 | 79 | 52 | No | 52 | 12.1 | 65 | 65 | 52 | 47 | 12.2 | 9.0 |
css lch() lch()
=====
**Experimental:** **This is an [experimental technology](https://developer.mozilla.org/en-US/docs/MDN/Writing_guidelines/Experimental_deprecated_obsolete#experimental)**
Check the [Browser compatibility table](#browser_compatibility) carefully before using this in production.
The `lch()` functional notation expresses a given color in the LCH color space. It has the same L axis as [`lab()`](lab), but uses polar coordinates C (Chroma) and H (Hue).
Syntax
------
```
lch(29.2345% 44.2 27);
lch(52.2345% 72.2 56.2);
lch(52.2345% 72.2 56.2 / .5);
```
### Values
Functional notation: `lch(L C H [/ A])`
`L` specifies the CIE Lightness, and is a [`<percentage>`](../percentage) between `0%` representing black and `100%` representing white.
The second argument `C` is the chroma (roughly representing the "amount of color"). Its minimum useful value is 0, while its maximum is theoretically unbounded (but in practice does not exceed 230).
The third argument `H` is the hue angle. `0deg` points along the positive "a" axis (toward purplish red), `90deg` points along the positive "b" axis (toward mustard yellow), `180deg` points along the negative "a" axis (toward greenish cyan), and `270deg` points along the negative "b" axis (toward sky blue).
`A` (alpha) can be a [`<number>`](../number) between `0` and `1`, or a [`<percentage>`](../percentage), where the number `1` corresponds to `100%` (full opacity).
### Formal syntax
```
<lch()> =
lch( [[](../value_definition_syntax#brackets) [<percentage>](../percentage) [|](../value_definition_syntax#single_bar) [<number>](../number) [|](../value_definition_syntax#single_bar) none []](../value_definition_syntax#brackets) [[](../value_definition_syntax#brackets) [<percentage>](../percentage) [|](../value_definition_syntax#single_bar) [<number>](../number) [|](../value_definition_syntax#single_bar) none []](../value_definition_syntax#brackets) [[](../value_definition_syntax#brackets) <hue> [|](../value_definition_syntax#single_bar) none []](../value_definition_syntax#brackets) [[](../value_definition_syntax#brackets) / [[](../value_definition_syntax#brackets) <alpha-value> [|](../value_definition_syntax#single_bar) none []](../value_definition_syntax#brackets) []](../value_definition_syntax#brackets)[?](../value_definition_syntax#question_mark) )
<hue> =
[<number>](../number) [|](../value_definition_syntax#single_bar)
[<angle>](../angle)
<alpha-value> =
[<number>](../number) [|](../value_definition_syntax#single_bar)
[<percentage>](../percentage)
```
Specifications
--------------
| Specification |
| --- |
| [CSS Color Module Level 4 # lab-colors](https://w3c.github.io/csswg-drafts/css-color/#lab-colors) |
Browser compatibility
---------------------
| | Desktop | Mobile |
| --- | --- | --- |
| | Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet |
| `lch` | No | No | No | No | No | 15 | No | No | No | No | 15 | No |
See also
--------
* [LCH colors in CSS: what, why, and how?](https://lea.verou.me/2020/04/lch-colors-in-css-what-why-and-how/)
* [Safari Technology Preview 122 release notes](https://webkit.org/blog/11577/release-notes-for-safari-technology-preview-122/): includes `lch()` and [`lab()`](lab) colors.
css hsl() hsl()
=====
The `hsl()` functional notation expresses an [sRGB](https://developer.mozilla.org/en-US/docs/Glossary/RGB) color according to its *hue*, *saturation*, and *lightness* components. An optional *alpha* component represents the color's transparency.
**Note:** The legacy `hsla()` syntax is an alias for `hsl()`, accepting the same parameters and behaving in the same way.
Try it
------
Defining *complementary colors* with `hsl()` can be done with a single formula, as they are positioned on the same diameter of the [color wheel](https://developer.mozilla.org/en-US/docs/Glossary/Color_wheel). If `theta` is the angle of a color, its complementary one will have `180deg-theta` as its *hue* coordinate.
Syntax
------
```
/\* Syntax with space-separated values \*/
hsl(hue saturation lightness)
hsl(hue saturation lightness / alpha)
/\* Syntax with comma-separated values \*/
hsl(hue, saturation, lightness)
hsl(hue, saturation, lightness, alpha)
/\* Legacy hsla() syntax \*/
hsla(hue saturation lightness)
hsla(hue saturation lightness / alpha)
hsla(hue, saturation, lightness)
hsla(hue, saturation, lightness, alpha)
```
The `hsl()` function accepts three space-separated values, representing respectively `hue`, `saturation`, and `lightness`. Optionally it may also be given a slash `/` followed by a fourth value, representing `alpha`.
The function also accepts a legacy syntax in which all values are separated with commas.
### Values
`hue` An [`<angle>`](../angle) of the [color wheel](https://developer.mozilla.org/en-US/docs/Glossary/Color_wheel) given in one of the following units: `deg`, `rad`, `grad`, or `turn`. When written as a unitless [`<number>`](../number), it is interpreted as degrees. By definition, *red* is `0deg`, with the other colors spread around the circle, so *green* is `120deg`, *blue* is `240deg`, etc. As an `<angle>` is periodic, it implicitly wraps around such that `-120deg` = `240deg`, `480deg` = `120deg`, `-1turn` = `1turn`, and so on. This color wheel helps finding the angle associated with a color:
`saturation` A [`<percentage>`](../percentage) where `100%` is completely saturated, while `0%` is completely unsaturated (gray).
`lightness` A [`<percentage>`](../percentage) where `100%` is white, `0%` is black, and `50%` is "normal".
`alpha` Optional
A [`<percentage>`](../percentage) or a [`<number>`](../number) between `0` and `1`, where the number `1` corresponds to `100%` and means full opacity, while `0` corresponds to `0%` and means fully transparent.
### Formal syntax
```
<hsl()> =
hsl( [[](../value_definition_syntax#brackets) <hue> [|](../value_definition_syntax#single_bar) none []](../value_definition_syntax#brackets) [[](../value_definition_syntax#brackets) [<percentage>](../percentage) [|](../value_definition_syntax#single_bar) none []](../value_definition_syntax#brackets) [[](../value_definition_syntax#brackets) [<percentage>](../percentage) [|](../value_definition_syntax#single_bar) none []](../value_definition_syntax#brackets) [[](../value_definition_syntax#brackets) / [[](../value_definition_syntax#brackets) <alpha-value> [|](../value_definition_syntax#single_bar) none []](../value_definition_syntax#brackets) []](../value_definition_syntax#brackets)[?](../value_definition_syntax#question_mark) )
<hue> =
[<number>](../number) [|](../value_definition_syntax#single_bar)
[<angle>](../angle)
<alpha-value> =
[<number>](../number) [|](../value_definition_syntax#single_bar)
[<percentage>](../percentage)
```
Examples
--------
### Using `hsl()` with `conic-gradient()`
The `hsl()` function works well with [`conic-gradient()`](../gradient/conic-gradient) as both deal with angles.
#### CSS
```
div {
width: 100px;
height: 100px;
background: conic-gradient(
hsl(360 100% 50%),
hsl(315 100% 50%),
hsl(270 100% 50%),
hsl(225 100% 50%),
hsl(180 100% 50%),
hsl(135 100% 50%),
hsl(90 100% 50%),
hsl(45 100% 50%),
hsl(0 100% 50%)
);
clip-path: circle(closest-side);
}
```
#### Result
### Legacy syntax: comma-separated values
For legacy reasons, the `hsl()` function accepts a form in which all values are separated using commas.
#### HTML
```
<div class="space-separated"></div>
<div class="comma-separated"></div>
```
#### CSS
```
div {
width: 100px;
height: 50px;
margin: 1rem;
}
div.space-separated {
background-color: hsl(0 100% 50% / 50%);
}
div.comma-separated {
background-color: hsl(0, 100%, 50%, 50%);
}
```
#### Result
### Legacy syntax: hsla()
The legacy `hsla()` syntax is an alias for `hsl()`.
#### HTML
```
<div class="hsl"></div>
<div class="hsla"></div>
```
#### CSS
```
div {
width: 100px;
height: 50px;
margin: 1rem;
}
div.hsl {
background-color: hsl(0 100% 50% / 50%);
}
div.hsla {
background-color: hsl(0 100% 50% / 50%);
}
```
#### Result
Specifications
--------------
| Specification |
| --- |
| [CSS Color Module Level 4 # the-hsl-notation](https://w3c.github.io/csswg-drafts/css-color/#the-hsl-notation) |
Browser compatibility
---------------------
| | Desktop | Mobile |
| --- | --- | --- |
| | Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet |
| `hsl` | 1 | 12 | 1 | 9 | 9.5 | 3.1 | ≤37 | 18 | 4 | 10.1 | 2 | 1.0 |
| `alpha_parameter` | 65 | 79 | 52 | No | 52 | 12.1 | 65 | 65 | 52 | 47 | 12.2 | 9.0 |
| `space_separated_parameters` | 65 | 79 | 52 | No | 52 | 12.1 | 65 | 65 | 52 | 47 | 12.2 | 9.0 |
See also
--------
* The function [`hsla()`](hsl), an historical alias for this function.
* The [`<color>`](../color_value) type that represents any color.
* [HSL Color Picker](https://hslpicker.com/)
css lab() lab()
=====
**Experimental:** **This is an [experimental technology](https://developer.mozilla.org/en-US/docs/MDN/Writing_guidelines/Experimental_deprecated_obsolete#experimental)**
Check the [Browser compatibility table](#browser_compatibility) carefully before using this in production.
The `lab()` functional notation expresses a given color in the CIE L\*a\*b\* color space. Lab represents the entire range of color that humans can see.
Syntax
------
```
lab(29.2345% 39.3825 20.0664);
lab(52.2345% 40.1645 59.9971);
lab(52.2345% 40.1645 59.9971 / .5);
```
### Values
Functional notation: `lab(L a b [/ A])`
`L` specifies the CIE Lightness, and is a [`<percentage>`](../percentage) between `0%` representing black and `100%` representing white.
The second argument `a` is the distance along the `a` axis in the Lab colorspace.
The third argument `b` is the distance along the `b` axis in the Lab colorspace.
`A` (alpha) can be a [`<number>`](../number) between `0` and `1`, or a [`<percentage>`](../percentage), where the number `1` corresponds to `100%` (full opacity).
### Formal syntax
```
<lab()> =
lab( [[](../value_definition_syntax#brackets) [<percentage>](../percentage) [|](../value_definition_syntax#single_bar) [<number>](../number) [|](../value_definition_syntax#single_bar) none []](../value_definition_syntax#brackets) [[](../value_definition_syntax#brackets) [<percentage>](../percentage) [|](../value_definition_syntax#single_bar) [<number>](../number) [|](../value_definition_syntax#single_bar) none []](../value_definition_syntax#brackets) [[](../value_definition_syntax#brackets) [<percentage>](../percentage) [|](../value_definition_syntax#single_bar) [<number>](../number) [|](../value_definition_syntax#single_bar) none []](../value_definition_syntax#brackets) [[](../value_definition_syntax#brackets) / [[](../value_definition_syntax#brackets) <alpha-value> [|](../value_definition_syntax#single_bar) none []](../value_definition_syntax#brackets) []](../value_definition_syntax#brackets)[?](../value_definition_syntax#question_mark) )
<alpha-value> =
[<number>](../number) [|](../value_definition_syntax#single_bar)
[<percentage>](../percentage)
```
Specifications
--------------
| Specification |
| --- |
| [CSS Color Module Level 4 # lab-colors](https://w3c.github.io/csswg-drafts/css-color/#lab-colors) |
Browser compatibility
---------------------
| | Desktop | Mobile |
| --- | --- | --- |
| | Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet |
| `lab` | No | No | No | No | No | 15 | No | No | No | No | 15 | No |
See also
--------
* [LCH colors in CSS: what, why, and how?](https://lea.verou.me/2020/04/lch-colors-in-css-what-why-and-how/)
* [Safari Technology Preview 122 release notes](https://webkit.org/blog/11577/release-notes-for-safari-technology-preview-122/): includes `lab()` and [`lch()`](lch) colors.
| programming_docs |
css color() color()
=======
**Experimental:** **This is an [experimental technology](https://developer.mozilla.org/en-US/docs/MDN/Writing_guidelines/Experimental_deprecated_obsolete#experimental)**
Check the [Browser compatibility table](#browser_compatibility) carefully before using this in production.
The `color()` functional notation allows a color to be specified in a particular, specified colorspace rather than the implicit sRGB colorspace that most of the other color functions operate in.
Support for a particular colorspace can be detected with the [`color-gamut`](../@media/color-gamut) CSS media feature.
The [`@color-profile`](../@color-profile) [CSS](https://developer.mozilla.org/en-US/docs/Web/CSS) [at-rule](../at-rule) can be used to define and names a color profile to be used in the `color()` function to specify a color.
Syntax
------
```
color(display-p3 1 0.5 0);
color(display-p3 1 0.5 0 / .5);
```
### Values
Functional notation: `color( [ [<ident> | <dashed-ident>]? [ <number-percentage>+ | <string> ] [ / <alpha-value> ]? ] )`
`[<ident> | <dashed-ident>]` is an optional [`<ident>`](../ident) or [`<dashed-ident>`](../dashed-ident) denoting the colorspace. If this is an `<ident>` it denotes one of the predefined colorspaces (such as display-p3); if it is a <dashed-ident> it denotes a custom colorspace, defined by a [`@color-profile`](../@color-profile) rule.
`[ <number-percentage>+ | <string> ]` is either one or more [`<number>`](../number) or [`<percentage>`](../percentage) values providing the parameter values that the colorspace takes, or a [`<string>`](../string) giving the name of a color defined by the colorspace.
`/ <alpha-value>` (alpha) can be a [`<number>`](../number) between `0` and `1`, or a [`<percentage>`](../percentage), where the number `1` corresponds to `100%` (full opacity).
### Formal syntax
```
<color()> =
color( <colorspace-params> [[](../value_definition_syntax#brackets) / [[](../value_definition_syntax#brackets) <alpha-value> [|](../value_definition_syntax#single_bar) none []](../value_definition_syntax#brackets) []](../value_definition_syntax#brackets)[?](../value_definition_syntax#question_mark) )
<colorspace-params> =
<predefined-rgb-params> [|](../value_definition_syntax#single_bar)
<xyz-params>
<alpha-value> =
[<number>](../number) [|](../value_definition_syntax#single_bar)
[<percentage>](../percentage)
<predefined-rgb-params> =
<predefined-rgb> [[](../value_definition_syntax#brackets) [<number>](../number) [|](../value_definition_syntax#single_bar) [<percentage>](../percentage) [|](../value_definition_syntax#single_bar) none []](../value_definition_syntax#brackets)[{3}](../value_definition_syntax#curly_braces)
<xyz-params> =
<xyz-space> [[](../value_definition_syntax#brackets) [<number>](../number) [|](../value_definition_syntax#single_bar) [<percentage>](../percentage) [|](../value_definition_syntax#single_bar) none []](../value_definition_syntax#brackets)[{3}](../value_definition_syntax#curly_braces)
<predefined-rgb> =
srgb [|](../value_definition_syntax#single_bar)
srgb-linear [|](../value_definition_syntax#single_bar)
display-p3 [|](../value_definition_syntax#single_bar)
a98-rgb [|](../value_definition_syntax#single_bar)
prophoto-rgb [|](../value_definition_syntax#single_bar)
rec2020
<xyz-space> =
xyz [|](../value_definition_syntax#single_bar)
xyz-d50 [|](../value_definition_syntax#single_bar)
xyz-d65
```
Specifications
--------------
| Specification |
| --- |
| [CSS Color Module Level 4 # color-function](https://w3c.github.io/csswg-drafts/css-color/#color-function) |
Browser compatibility
---------------------
| | Desktop | Mobile |
| --- | --- | --- |
| | Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet |
| `color` | No | No | No | No | No | 15
10.1-15
Only supports `display-p3` and `srgb` predefined color profiles. | No | No | No | No | 15
10.3-15
Only supports `display-p3` and `srgb` predefined color profiles. | No |
See also
--------
* [Wide Gamut Color in CSS with Display-p3](https://webkit.org/blog/10042/wide-gamut-color-in-css-with-display-p3/)
css Using CSS counters Using CSS counters
==================
**CSS counters** let you adjust the appearance of content based on its location in a document. For example, you can use counters to automatically number the headings in a webpage, or to change the numbering on ordered lists.
Counters are, in essence, variables maintained by CSS whose values may be incremented or decremented by CSS rules that track how many times they're used. You can define your own named counters, and you can also manipulate the `list-item` counter that is created by default for all ordered lists.
Using counters
--------------
To use a counter it must first be initialized to a value with the [`counter-reset`](../counter-reset) property. The counter's value can then be increased or decreased using [`counter-increment`](../counter-increment) property. The current value of a counter is displayed using the [`counter()`](../counter) or [`counters()`](../counters) function, typically within a [pseudo-element](../pseudo-elements) [`content`](../content) property.
Counters can only be set, reset, or incremented in elements that generate boxes. For example, if an element is set to `display: none` then any counter operation on that element will be ignored.
The properties of counters can be scoped to specific elements using style containment which is described in more detail in the [`contain`](../contain) property.
### Manipulating a counter's value
To use a CSS counter, it must first be initialized to a value with the [`counter-reset`](../counter-reset) property. The property can also be used to change the counter value to any specific number.
Below we initialize a counter named `section` to the default value (0).
```
counter-reset: section;
```
You can also initialize multiple counters, optionally specifying an initial value for each. Below we initialize the `section` and `topic` counters to the default value, and the `page` counter to 3.
```
counter-reset: section page 3 topic;
```
Once initialized, a counter's value can be increased or decreased using [`counter-increment`](../counter-increment). For example, the following declaration would increment the `section` counter by one on every `h3` tag.
```
h3::before {
counter-increment: section; /\* Increment the value of section counter by 1 \*/
}
```
You can specify the value to increment or decrement the counter after the counter name, using a positive or negative number.
The counter's name must not be `none`, `inherit`, or `initial`; otherwise the declaration is ignored.
### Displaying a counter
The value of a counter can be displayed using either the [`counter()`](../counter) or [`counters()`](../counters) function in a [`content`](../content) property.
For example, the following declaration uses `counter()` to prefix each `h3` heading with the text `Section <number>:`, where `<number>` is the value of the count in decimal (the default display style):
```
h3::before {
counter-increment: section; /\* Increment the value of section counter by 1 \*/
content: "Section " counter(section) ": "; /\* Display counter value in default style (decimal) \*/
}
```
The [`counter()`](../counter) function is used when the numbering of nesting levels does not include the context of parent levels. For example, here each nested level restarts from one:
```
1 One
1 Nested one
2 Nested two
2 Two
1 Nested one
2 Nested two
3 Nested three
3 Three
```
The [`counters()`](../counters) function is used when the count for nested levels must include the count from parent levels. For example, you might use this to lay out sections as shown:
```
1 One
1.1 Nested one
1.2 Nested two
2 Two
2.1 Nested one
2.2 Nested two
2.3 Nested three
3 Three
```
The [`counter()`](../counter) function has two forms: `counter(<counter-name>)` and `counter(<counter-name>, <counter-style>)`. The generated text is the value of the innermost counter of the given name in scope at the pseudo-element.
The [`counters()`](../counters) function also has two forms: `counters(<counter-name>, <separator>)` and `counters(<counter-name>, <separator>, <counter-style>)`. The generated text is the value of all counters with the given name in scope at the given pseudo-element, from outermost to innermost, separated by the specified string (`<separator>`).
The counter is rendered in the specified `<counter-style>` for both methods (`decimal` by default). You can use any of the [`list-style-type`](../list-style-type) values or your own [custom styles](../css_counter_styles).
Examples showing the use of `counter()` and `counters()` are given below in the [basic example](#basic_example) and [Example of a nested counter](#example_of_a_nested_counter), respectively.
### Reversed counters
A reversed counter is one that is intended to count down (decrement) rather than up (increment). Reversed counters are created using the `reversed()` function notation when naming the counter in [`counter-reset`](../counter-reset).
Reversed counters have a default initial value equal to the number of elements (unlike normal counters, which have a default value of 0). This makes it easy to implement a counter that counts from the number of elements down to one.
For example, to create a reversed counter named `section` with a default initial value, you would use the following syntax:
```
counter-reset: reversed(section);
```
You can of course specify any initial value that you like.
The counter value is decreased by specifying a negative value for [`counter-increment`](../counter-increment).
**Note:** You can also use [`counter-increment`](../counter-increment) to decrement a non-reversed counter. The main benefit of using a reversed counter is the default initial value, and that the `list-item` counter automatically decrements reversed counters.
### List item counters
Ordered lists, as created using [`<ol>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/ol) elements, implicitly have a counter named `list-item`.
Like other counters, this has a default initial value of 0 for upward counters and "number of items" for reversed counters. Unlike author-created counters, `list-item` *automatically* increments or decrements by one for each list element, depending on whether or not the counter is reversed.
The `list-item` counter can be used to manipulate the default behavior of ordered lists using CSS. For example, you can change the default initial value, or use [`counter-increment`](../counter-increment) to change the way in which the list items increment or decrement.
Examples
--------
### Basic example
This example adds "Section [the value of the counter]:" to the beginning of each heading.
#### CSS
```
body {
counter-reset: section; /\* Set a counter named 'section', and its initial value is 0. \*/
}
h3::before {
counter-increment: section; /\* Increment the value of section counter by 1 \*/
content: "Section " counter(section) ": "; /\* Display the word 'Section ', the value of
section counter, and a colon before the content
of each h3 \*/
}
```
#### HTML
```
<h3>Introduction</h3>
<h3>Body</h3>
<h3>Conclusion</h3>
```
#### Result
### Basic example: reversed counter
This example is the same as the one above but uses a reversed counter. If your browser supports the `reversed()` function notation, the result will look like this:
#### CSS
```
body {
counter-reset: reversed(
section
); /\* Set a counter named 'section', and its initial value is 0. \*/
}
h3::before {
counter-increment: section -1; /\* Decrement the value of section counter by 1 \*/
content: "Section " counter(section) ": "; /\* Display the word 'Section ', the value of
section counter, and a colon before the content
of each h3 \*/
}
```
#### HTML
```
<h3>Introduction</h3>
<h3>Body</h3>
<h3>Conclusion</h3>
```
#### Result
### A more sophisticated example
A counter need not necessarily be shown every time it is incremented. This example counts all links with the counter showing only when a link has no text, as a convenient replacement.
#### CSS
```
:root {
counter-reset: link;
}
a[href] {
counter-increment: link;
}
a[href]:empty::after {
content: "[" counter(link) "]";
}
```
#### HTML
```
<p>See <a href="https://www.mozilla.org/"></a></p>
<p>Do not forget to <a href="contact-me.html">leave a message</a>!</p>
<p>See also <a href="https://developer.mozilla.org/"></a></p>
```
#### Result
### Example of a nested counter
A CSS counter can be especially useful for making outlined lists, because a new instance of the counter is automatically created in child elements. Using the [`counters()`](../counters) function, separating text can be inserted between different levels of nested counters.
#### CSS
```
ol {
counter-reset: section; /\* Creates a new instance of the
section counter with each ol
element \*/
list-style-type: none;
}
li::before {
counter-increment: section; /\* Increments only this instance
of the section counter \*/
content: counters(section, ".") " "; /\* Combines the values of all instances
of the section counter, separated
by a period \*/
}
```
#### HTML
```
<ol>
<li>item</li> <!-- 1 -->
<li>item <!-- 2 -->
<ol>
<li>item</li> <!-- 2.1 -->
<li>item</li> <!-- 2.2 -->
<li>item <!-- 2.3 -->
<ol>
<li>item</li> <!-- 2.3.1 -->
<li>item</li> <!-- 2.3.2 -->
</ol>
<ol>
<li>item</li> <!-- 2.3.1 -->
<li>item</li> <!-- 2.3.2 -->
<li>item</li> <!-- 2.3.3 -->
</ol>
</li>
<li>item</li> <!-- 2.4 -->
</ol>
</li>
<li>item</li> <!-- 3 -->
<li>item</li> <!-- 4 -->
</ol>
<ol>
<li>item</li> <!-- 1 -->
<li>item</li> <!-- 2 -->
</ol>
```
#### Result
Specifications
--------------
| Specification |
| --- |
| [CSS Lists and Counters Module Level 3 # auto-numbering](https://drafts.csswg.org/css-lists/#auto-numbering) |
See also
--------
* [`contain`](../contain)
* [`counter-reset`](../counter-reset)
* [`counter-set`](../counter-set)
* [`counter-increment`](../counter-increment)
* [`@counter-style`](../@counter-style)
css Adapting to the new two-value syntax of display Adapting to the new two-value syntax of display
===============================================
[CSS Display Module Level 3](https://drafts.csswg.org/css-display/) describes the two-value syntax for the [`display`](../display) property. This guide explains the change to the syntax, including the reasoning behind this change. It also details the in-built backwards compatibility for the `display` property.
What happens when we change the value of the display property?
--------------------------------------------------------------
One of the first things we learn about CSS is that some elements are block-level and some are inline-level. For example, an `<h1>` or a `<p>` are block-level by default, and a `<span>` is inline-level. Using the [`display`](../display) property we can switch between block and inline. For example to make a heading inline we would use the following CSS:
```
h1 {
display: inline;
}
```
More recently we have gained [CSS Grid Layout](../css_grid_layout) and [Flexbox](../css_flexible_box_layout). To access these we also use values of the `display` property — `display: grid` and `display: flex`. Only when the value of `display` is changed do the children become flex or grid items and begin to respond to the other properties in the grid or flexbox specifications. Changing an element's `display` value changes the formatting context of its direct children.
What grid and flexbox demonstrate, however, is that an element has both an **outer** and an **inner** display type. The outer display type describes whether the element is block-level or inline-level. The inner display type describes how the children of that box behave.
As an example, when we use `display: flex` we create a block-level container, with flex children. The children are described as participating in a flex formatting context. You can see this if you take a `<span>` — normally an inline-level element — and apply `display: flex` to it. The `<span>` becomes a block-level element. It behaves as block-level things do in relationship to other boxes in the layout. It's as if you had applied `display: block` to the span, however we also get the changed behavior of the children.
The live example below has a `<span>` with `display: flex` applied. It has become a block-level box taking up all available space in the inline direction. You can now use `justify-content: space-between;` to put this space between the two flex items.
We can create inline flex containers. If you create a flex container using the single value of `inline-flex` you will have an inline-level box with flex children. The children behave in the same way as the flex children of a block-level container. The only thing that has changed is that the parent is now an inline-level box. It therefore behaves like other inline-level things, and doesn't take up the full width (or size in the inline dimension) that a block-level box does. This means that some following text could come up alongside the flex container.
The same is true when working with grid layout. Using `display: grid` will give you a block-level box, which creates a grid formatting context for the direct children. Using `display: inline-grid` will create an inline-level box, which creates a grid formatting context for the children.
The two-value syntax
--------------------
As you can see from the above explanation, the `display` property has gained considerable new powers. In addition to indicating whether something is block-level or inline-level in relationship to other boxes on the page, it now also indicates the formatting context inside the box it is applied to. In order to better describe this behavior, the `display` property has been refactored to allow for two values — an outer and inner value — to be set on it, as well as the single values we are used to.
This means that instead of setting `display: flex` to create a block-level box with flex children, we will use `display: block flex`. Instead of `display: inline-flex` to create an inline-level box with flex children, we will use `display: inline flex`. The example below, which will work in Firefox 70 and upwards, demonstrates these values.
There are mappings for all of the existing values of `display`; the most common ones are listed in the table below. To see a full list take a look at the table found in the [`display` property specification](https://drafts.csswg.org/css-display/#display-value-summary).
| Single value | New value |
| --- | --- |
| `block` | `block flow` |
| `flow-root` | `block flow-root` |
| `inline` | `inline flow` |
| `inline-block` | `inline flow-root` |
| `flex` | `block flex` |
| `inline-flex` | `inline flex` |
| `grid` | `block grid` |
| `inline-grid` | `inline grid` |
display: block flow-root and display: inline flow-root
------------------------------------------------------
In terms of how these new values help to clarify CSS layout, we can take a look at a couple of values in the table that might seem less familiar. The two-value `display: block flow-root` maps to a fairly recent single value; `display: flow-root`. This value's only purpose is to create a new [Block Formatting Context](https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Block_formatting_context) (BFC). A BFC ensures that everything inside your box stays inside it, and things from outside the box cannot intrude into it. The most obvious use-case for creating a new BFC is to contain floats, and avoid the need for clearfix hacks.
In the example below we have a floated item inside a container. The float is contained by the bordered box, which wraps it and the text alongside. If you remove the line `display: flow-root` then the float will poke out of the bottom of the box. If you are using Firefox you can replace it with the newer `display: block flow-root`, which will achieve the same as the single `flow-root` value.
The `flow-root` value makes sense if you think about block and inline layout, which is sometimes called [normal flow](https://developer.mozilla.org/en-US/docs/Learn/CSS/CSS_layout/Normal_Flow). Our HTML page creates a new formatting context (floats and margins cannot extend out from the boundaries) and our content lays out in normal flow, using block and inline layout, unless we change the value of `display` to use some other formatting context. Creating a grid or flex container also creates a new formatting context (a grid or flex formatting context, respectively.) These also contain everything inside them. However, if you want to contain floats and margins but continue using block and inline layout, you can create a new flow root, and start over with block and inline layout. From that point downwards everything is contained inside the new flow root.
The two-value syntax for `display: flow-root` being `display: block flow-root` therefore makes a lot of sense. You are creating a block formatting context, with a block-level box and children participating in normal flow. What about the matched pair `display: inline flow-root`? This is the new way of describing `display: inline-block`.
The value `display: inline-block` has been around since the early days of CSS. The reason we tend to use it is to allow padding to push inline items away from an element, when creating navigation items for example, or when wanting to add a background with padding to an inline element as in the example below.
An element with `display: inline-block` however, will also contain floats. It contains everything inside the inline-level box. Therefore `display: inline-block` does exactly what `display: flow-root` does, but with an inline-level, rather than a block-level box. The new syntax accurately describes what is happening with this value. In the example above, you can change `display: inline-block` to `display: inline flow-root` in Firefox and get the same result.
What about the old values of display?
-------------------------------------
The single values of `display` are described in the specification as legacy values, and currently you gain no benefit from using the two-value versions, as there is a direct mapping for each two-value version to a legacy version, as demonstrated in the table above.
To deal with single values of `display` [the specification](https://www.w3.org/TR/css-display-3/#outer-role) explains what to do if only the outer value of `block` or `inline` is used:
> "If a `<display-outside>` value is specified but `<display-inside>` is omitted, the element's inner display type defaults to flow."
>
>
This means that the behavior is exactly as it is in a single value world. If you specify `display: block` or `display: inline`, that changes the outer display value of the box but any children continue in normal flow.
If only an inner value of `flex`, `grid`, or `flow-root` is specified then [the specification](https://www.w3.org/TR/css-display-3/#inner-model) explains that the outer value should be set to `block`:
> "If a `<display-inside>` value is specified but `<display-outside>` is omitted, the element's outer display type defaults to block—except for ruby, which defaults to inline."
>
>
Finally, we have some legacy [pre-composed inline-level values](https://www.w3.org/TR/css-display-3/#legacy-display) of:
* `inline-block`
* `inline-table`
* `inline-flex`
* `inline-grid`
If a supporting browser comes across these as single values then it treats them the same as the two-value versions:
* `inline flow-root`
* `inline table`
* `inline flex`
* `inline grid`
So all of the current situations are neatly covered, meaning that we maintain compatibility of existing and new sites that use the single values, while allowing the spec to evolve.
Can I start to use the two-value syntax?
----------------------------------------
As demonstrated above, there is not a lot of advantage in using the two-value version right now; if you did, your page would only work in Firefox! Other browsers do not yet implement the two-value versions. Therefore `display: block flex` will only get you flex layout in Firefox and will be ignored as invalid in Chrome. You can see current support in the **Multi-keyword values** row of the [browser compatibility table for the CSS `display` property](../display#browser_compatibility). See also the following [Chrome issue](https://bugs.chromium.org/p/chromium/issues/detail?id=804600).
There is value in thinking about the values of `display` in this two-value way however. If you consider the outer and inner values when you change the value of `display`, you will understand immediately what impact the value will have on the box itself, and how it displays and behaves in the layout, and the direct children.
| programming_docs |
css Using feature queries Using feature queries
=====================
**Feature queries** are created using the CSS at-rule [@supports](../@supports), and are useful as they give web developers a way to test to see if a browser has support for a certain feature, and then provide CSS that will only run based on the result of that test. In this guide you will learn how to implement progressive enhancement using feature queries.
Syntax
------
CSS feature queries are part of the [CSS Conditional Rules module](https://drafts.csswg.org/css-conditional-3/), which also contains the media query [@media](../@media) rule; when you use feature queries, you will find they behave in a similar way to media queries. The difference is that with a media query you are testing something about the environment in which the web page is running, whereas with feature queries you are testing browser support for CSS features.
A feature query consists of the `@supports` rule, followed by the property name and value you would like to test for. You may not test for a bare property name such as `display`; the rule requires a property name and a value:
```
@supports (property: value) {
CSS rules to apply
}
```
If you want to check if a browser supports the `row-gap` property, for example, you would write the following feature query. It doesn't matter which value you use in a lot of cases: if all you want is to check that the browser supports this property, then any valid value will do.
The value part of the property value pair matters more if you are testing for new values of a particular property. A good example would be the `display` property. All browsers support `display`, as `display: block` dates back to CSS1. However the values `display: flex` and `display: grid` are newer. There are often additional values added to properties in CSS, and so the fact that you have to test for property and value means that you can detect support for these values.
Testing for lack of support
---------------------------
In addition to asking the browser if it supports a feature, you can test for the opposite by adding in the `not` keyword:
```
@supports not (property: value) {
CSS rules to apply
}
```
The CSS inside the following example feature query will run if the browser does not support `row-gap`.
Testing for more than one feature
---------------------------------
You may need to test support for more than one property in your feature query. To do so, you can include a list of features to test for, separated by `and` keywords:
```
@supports (property1: value) and (property2: value) {
CSS rules to apply
}
```
For example, if the CSS you want to run requires that the browser supports CSS Shapes and CSS Grid, you could create a rule which checks for both of these things. The following rule will only return true if both `shape-outside: circle()` and `display: grid` are supported by the browser.
You can also use `or`, if one property out of a selection could match to enable the CSS you want to use:
```
@supports (property1: value) or (property2: value) {
CSS rules to apply
}
```
This can be particularly useful if a feature is vendor prefixed, as you can test for the standard property plus any vendor prefixes.
Limitations of feature queries
------------------------------
The `@supports` rule tests to see if the browser can parse one or more property/value pairs, and therefore if it claims to support the feature(s). If the property and value pair is understood by the browser it returns a positive response. Therefore feature queries cannot be used to check if a browser supports a thing properly, and without bugs!
In addition, feature queries cannot test for *partial implementations*. A good example of this is the `gap` property. All browsers that support CSS Grid support `gap` in CSS Grid, however only Firefox supports `gap` in Flexbox. If you test for the `gap` property, because you want to use it in Flexbox, you will get a positive response even though it is not implemented.
How to use feature queries for progressive enhancement
------------------------------------------------------
Feature queries are an incredibly useful tool when progressively enhancing a site. They enable you to provide a good solution for all browsers, and an enhanced solution for those browsers that support newer features.
However, there are browsers that don't support feature queries but also have no support for a feature we want to use. For example, we might want to use CSS Grid, which is not supported in IE11. We can't create a fallback by checking for browsers which do not have support, as IE11 doesn't support feature queries either! In practice however, when using feature queries for progressive enhancement, this doesn't matter. You do however need to structure your CSS in a certain way, writing CSS for non-supporting browsers and overwriting it with the CSS inside the feature query.
Let's walk through a very simple example where feature queries come in handy, which uses them in the way described above.
Let's say we want to create a layout of three boxes in a row, and ideally we would like to use [CSS Grid Layout](../css_grid_layout). However, we would like to have a layout for older browsers using floats. We can start by creating that floated layout with the following code, which gives us three columns.
When browsers don't understand a CSS property or value, they ignore it. So we could start enhancing our layout by using CSS Grid. Browsers that do not support grid will ignore the `grid` value of the `display` property. Once a floated item becomes a grid item, the float is removed — something you can read more about in [Supporting Older Browsers](https://developer.mozilla.org/en-US/docs/Learn/CSS/CSS_layout/Supporting_Older_Browsers). Therefore the grid version should just overwrite the floated one.
We have a problem however, caused by the `width` property we used on our floated items to make them display as three columns. This is now interpreted by grid as being the width of the column track, not the width of the container as it is for the float.
What we need is a way to remove the width if `display: grid` is supported. This is exactly the situation feature queries solve. We can set the `width` back to `auto` if grid is supported.
In the above scenario, it doesn't matter that IE11 doesn't support feature queries or CSS Grid — it would get the floated version anyway, which is then overwritten by browsers that do support grid.
An alternate way to write the above code is to wrap all of the grid code in a feature query as follows.
This may mean you have a little more code but comes with the benefit of being able to test the fallback by misspelling the property or value name. You can try this in the live example above by changing `display: grid` in the `@supports` rule to `display: grip` or similar.
Summary
-------
Feature Queries can help you start to use newer features by enhancing a simpler display of the site used for older browsers. As you can wrap up the CSS for supporting browsers, you do not run the risk of styles used for the fallback display leaking through, as shown in our grid example above.
### See also
* The [@supports](../@supports) rule
* Learn Layout: [Supporting Older Browsers](https://developer.mozilla.org/en-US/docs/Learn/CSS/CSS_layout/Supporting_Older_Browsers)
* [CSS Grid Layout and Progressive Enhancement](../css_grid_layout/css_grid_and_progressive_enhancement)
* [Using Feature Queries in CSS](https://hacks.mozilla.org/2016/08/using-feature-queries-in-css/)
css Using the :target pseudo-class in selectors Using the :target pseudo-class in selectors
===========================================
When a URL points at a specific piece of a document, it can be difficult for the user to notice. Find out how you can use some simple CSS to draw attention to the target of a URL and improve the user's experience.
Picking a Target
----------------
The [pseudo-class](../pseudo-classes) [`:target`](../:target) is used to style the target element of a URL containing a fragment identifier. For example, the URL `https://developer.mozilla.org/en-US/docs/Web/CSS#reference` contains the fragment identifier `#reference`. In HTML, identifiers are found as the values of either `id` or `name` attributes, since the two share the same namespace. Thus, the example URL would point to the heading "reference" in that document.
Suppose you wish to style any `h2` element that is the target of a URL, but do not want any other kind of element to get a target style. This is simple enough:
```
h2:target {
outline: 2px solid;
}
```
It's also possible to create styles that are specific to a particular fragment of the document. This is done using the same identifying value that is found in the URI. Thus, to add a background color to the `#reference` fragment, we would write:
```
#reference:target {
background-color: yellow;
}
```
Targeting all elements
----------------------
If the intent is to create a "blanket" style that will apply to all targeted elements, then the universal selector comes in handy:
```
:target {
color: red;
}
```
Example
-------
In the following example, there are five links that point to elements in the same document. Selecting the "First" link, for example, will cause `<h1 id="one">` to become the target element. Note that the document may jump to a new scroll position, since target elements are placed on the top of the browser window if possible.
```
<h4 id="one">…</h4>
<p id="two">…</p>
<div id="three">…</div>
<a id="four">…</a> <em id="five">…</em>
<a href="#one">First</a>
<a href="#two">Second</a>
<a href="#three">Third</a>
<a href="#four">Fourth</a>
<a href="#five">Fifth</a>
```
Conclusion
----------
In cases where a fragment identifier points to a portion of the document, readers may become confused about which part of the document they're supposed to be reading. By styling the target of a URI, reader confusion can be reduced or eliminated.
See also
--------
* [`:target`](../:target)
css Using media queries Using media queries
===================
**Media queries** allow you to apply CSS styles depending on a device's general type (such as print vs. screen) or other characteristics such as screen resolution or browser [viewport](https://developer.mozilla.org/en-US/docs/Glossary/Viewport) width. Media queries are used for the following:
* To conditionally apply styles with the [CSS](https://developer.mozilla.org/en-US/docs/Web/CSS) [`@media`](../@media) and [`@import`](../@import) [at-rules.](../at-rule)
* To target specific media for the [`<style>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/style), [`<link>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link), [`<source>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/source), and other [HTML](https://developer.mozilla.org/en-US/docs/Web/HTML) elements with the `media=` attribute.
* To [test and monitor media states](testing_media_queries) using the [`Window.matchMedia()`](https://developer.mozilla.org/en-US/docs/Web/API/Window/matchMedia) and [`MediaQueryList.addListener()`](https://developer.mozilla.org/en-US/docs/Web/API/MediaQueryList/addListener) [JavaScript](https://developer.mozilla.org/en-US/docs/Web/JavaScript) methods.
**Note:** The examples on this page use CSS's `@media` for illustrative purposes, but the basic syntax remains the same for all types of media queries.
Syntax
------
A media query is composed of an optional *media type* and any number of *media feature* expressions, which may optionally be combined in various ways using *logical operators*. Media queries are case-insensitive.
* [Media types](../@media#media_types) define the broad category of device for which the media query applies: `all`, `print`, `screen`. The type is optional (assumed to be `all`) except when using the `not` or `only` logical operators.
* [Media features](../@media#media_features) describe a specific characteristic of the [user agent](https://developer.mozilla.org/en-US/docs/Glossary/User_agent), output device, or environment:
+ [`any-hover`](../@media/any-hover)
+ [`any-pointer`](../@media/any-pointer)
+ [`aspect-ratio`](../@media/aspect-ratio)
+ [`color`](../@media/color)
+ [`color-gamut`](../@media/color-gamut)
+ [`color-index`](../@media/color-index)
+ [`device-aspect-ratio`](../@media/device-aspect-ratio) Deprecated
+ [`device-height`](../@media/device-height) Deprecated
+ [`device-width`](../@media/device-width) Deprecated
+ [`display-mode`](../@media/display-mode)
+ [`dynamic-range`](../@media/dynamic-range)
+ [`forced-colors`](../@media/forced-colors)
+ [`grid`](../@media/grid)
+ [`height`](../@media/height)
+ [`hover`](../@media/hover)
+ [`inverted-colors`](../@media/inverted-colors)
+ [`monochrome`](../@media/monochrome)
+ [`orientation`](../@media/orientation)
+ [`overflow-block`](../@media/overflow-block)
+ [`overflow-inline`](../@media/overflow-inline)
+ [`pointer`](../@media/pointer)
+ [`prefers-color-scheme`](../@media/prefers-color-scheme)
+ [`prefers-contrast`](../@media/prefers-contrast)
+ [`prefers-reduced-motion`](../@media/prefers-reduced-motion)
+ [`resolution`](../@media/resolution)
+ [`scripting`](../@media/scripting)
+ [`update`](../@media/update-frequency)
+ [`video-dynamic-range`](../@media/video-dynamic-range)
+ [`width`](../@media/width).For example, the [`hover`](../@media/hover) feature allows a query to test against whether the device supports hovering over elements. Media feature expressions test for their presence or value, and are entirely optional. Each media feature expression must be surrounded by parentheses.
* [Logical operators](../@media#logical_operators) can be used to compose a complex media query: `not`, `and`, and `only`. You can also combine multiple media queries into a single rule by separating them with commas.
A media query computes to `true` when the media type (if specified) matches the device on which a document is being displayed *and* all media feature expressions compute as true. Queries involving unknown media types are always false.
**Note:** A style sheet with a media query attached to its [`<link>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link) tag [will still download](https://scottjehl.github.io/CSS-Download-Tests/) even if the query returns `false`, the download will happen but the priority of downloading will be much lower. Nevertheless, its contents will not apply unless and until the result of the query changes to `true`. You can read why this happens in Tomayac's blog [Why Browser Download Stylesheet with Non-Matching Media Queries](https://medium.com/@tomayac/why-browsers-download-stylesheets-with-non-matching-media-queries-eb61b91b85a2).
Targeting media types
---------------------
Media types describe the general category of a given device. Although websites are commonly designed with screens in mind, you may want to create styles that target special devices such as printers or audio-based screen readers. For example, this CSS targets printers:
```
@media print {
/\* … \*/
}
```
You can also target multiple devices. For instance, this `@media` rule uses two media queries to target both screen and print devices:
```
@media screen, print {
/\* … \*/
}
```
See [media type](../@media#media_types) for a list of all media types. Because they describe devices in only very broad terms, just a few are available; to target more specific attributes, use *media features* instead.
Targeting media features
------------------------
Media features describe the specific characteristics of a given [user agent](https://developer.mozilla.org/en-US/docs/Glossary/User_agent), output device, or environment. For instance, you can apply specific styles to widescreen monitors, computers that use mice, or to devices that are being used in low-light conditions. This example applies styles when the user's *primary* input mechanism (such as a mouse) can hover over elements:
```
@media (hover: hover) {
/\* … \*/
}
```
Many media features are *range features*, which means they can be prefixed with "min-" or "max-" to express "minimum condition" or "maximum condition" constraints. For example, this CSS will apply styles only if your browser's [viewport](https://developer.mozilla.org/en-US/docs/Glossary/Viewport) width is equal to or narrower than 1250px:
```
@media (max-width: 1250px) {
/\* … \*/
}
```
If you create a media feature query without specifying a value, the nested styles will be used as long as the feature's value is not zero (or `none`, in [Level 4](https://drafts.csswg.org/mediaqueries-4/)). For example, this CSS will apply to any device with a color screen:
```
@media (color) {
/\* … \*/
}
```
If a feature doesn't apply to the device on which the browser is running, expressions involving that media feature are always false.
For more [Media feature](../@media#media_features) examples, please see the reference page for each specific feature.
Creating complex media queries
------------------------------
Sometimes you may want to create a media query that depends on multiple conditions. This is where the *logical operators* come in: `not`, `and`, and `only`. Furthermore, you can combine multiple media queries into a *comma-separated list*; this allows you to apply the same styles in different situations.
In the previous example, we've already seen the `and` operator used to group a media *type* with a media *feature*. The `and` operator can also combine multiple media features into a single media query. The `not` operator, meanwhile, negates a media query, basically reversing its normal meaning. The `only` operator prevents older browsers from applying the styles.
**Note:** In most cases, the `all` media type is used by default when no other type is specified. However, if you use the `not` or `only` operators, you must explicitly specify a media type.
### Combining multiple types or features
The `and` keyword combines a media feature with a media type *or* other media features. This example combines two media features to restrict styles to landscape-oriented devices with a width of at least 30 ems:
```
@media (min-width: 30em) and (orientation: landscape) {
/\* … \*/
}
```
To limit the styles to devices with a screen, you can chain the media features to the `screen` media type:
```
@media screen and (min-width: 30em) and (orientation: landscape) {
/\* … \*/
}
```
### Testing for multiple queries
You can use a comma-separated list to apply styles when the user's device matches any one of various media types, features, or states. For instance, the following rule will apply its styles if the user's device has either a minimum height of 680px *or* is a screen device in portrait mode:
```
@media (min-height: 680px), screen and (orientation: portrait) {
/\* … \*/
}
```
Taking the above example, if the user had a printer with a page height of 800px, the media statement would return true because the first query would apply. Likewise, if the user were on a smartphone in portrait mode with a viewport height of 480px, the second query would apply and the media statement would still return true.
### Inverting a query's meaning
The `not` keyword inverts the meaning of an entire media query. It will only negate the specific media query it is applied to. (Thus, it will not apply to every media query in a comma-separated list of media queries.) The `not` keyword can't be used to negate an individual feature query, only an entire media query. The `not` is evaluated last in the following query:
```
@media not all and (monochrome) {
/\* … \*/
}
```
This means that the above query is evaluated like this:
```
@media not (all and (monochrome)) {
/\* … \*/
}
```
It wouldn't be evaluated like this:
```
@media (not all) and (monochrome) {
/\* … \*/
}
```
As another example, the following media query:
```
@media not screen and (color), print and (color) {
/\* … \*/
}
```
This means that the above query is evaluated like this:
```
@media (not (screen and (color))), print and (color) {
/\* … \*/
}
```
### Improving compatibility with older browsers
The `only` keyword prevents older browsers that do not support media queries with media features from applying the given styles. *It has no effect on modern browsers.*
```
@media only screen and (color) {
/\* … \*/
}
```
Syntax improvements in Level 4
------------------------------
The Media Queries Level 4 specification includes some syntax improvements to make media queries using features that have a "range" type, for example width or height, less verbose. Level 4 adds a *range context* for writing such queries. For example, using the `max-` functionality for width we might write the following:
**Note:** The Media Queries Level 4 specification has reasonable support in modern browsers, but some media features are not well supported. See the [`@media` browser compatibility table](../@media#browser_compatibility) for more details.
```
@media (max-width: 30em) {
/\* … \*/
}
```
In Media Queries Level 4 this can be written as:
```
@media (width <= 30em) {
/\* … \*/
}
```
Using `min-` and `max-` we might test for a width between two values like so:
```
@media (min-width: 30em) and (max-width: 50em) {
/\* … \*/
}
```
This would convert to the Level 4 syntax as:
```
@media (30em <= width <= 50em) {
/\* … \*/
}
```
Media Queries Level 4 also adds ways to combine media queries using full boolean algebra with **and**, **not**, and **or**.
### Negating a feature with `not`
Using `not()` around a media feature negates that feature in the query. For example, `not(hover)` would match if the device had no hover capability:
```
@media (not(hover)) {
/\* … \*/
}
```
### Testing for multiple features with `or`
You can use `or` to test for a match among more than one feature, resolving to `true` if any of the features are true. For example, the following query tests for devices that have a monochrome display or hover capability:
```
@media (not (color)) or (hover) {
/\* … \*/
}
```
See also
--------
* [@media](../@media)
* [Container queries](../css_container_queries)
* [Testing media queries programmatically](testing_media_queries)
* [CSS Animations Between Media Queries](https://davidwalsh.name/animate-media-queries)
* [Extended Mozilla media features](https://developer.mozilla.org/en-US/docs/Web/CSS/Mozilla_Extensions#media_features)
* [Extended WebKit media features](https://developer.mozilla.org/en-US/docs/Web/CSS/WebKit_Extensions#media_features)
| programming_docs |
css Testing media queries programmatically Testing media queries programmatically
======================================
The [DOM](https://developer.mozilla.org/en-US/docs/Glossary/DOM) provides features that can test the results of a [media query](../media_queries) programmatically, via the [`MediaQueryList`](https://developer.mozilla.org/en-US/docs/Web/API/MediaQueryList) interface and its methods and properties. Once you've created a `MediaQueryList` object, you can check the result of the query or receive notifications when the result changes.
Creating a media query list
---------------------------
Before you can evaluate the results of a media query, you need to create the `MediaQueryList` object representing the query. To do this, use the [`window.matchMedia`](https://developer.mozilla.org/en-US/docs/Web/API/Window/matchMedia) method.
For example, to set up a query list that determines if the device is in landscape or portrait orientation:
```
const mediaQueryList = window.matchMedia("(orientation: portrait)");
```
Checking the result of a query
------------------------------
Once you've created your media query list, you can check the result of the query by looking at the value of its `matches` property:
```
if (mediaQueryList.matches) {
/\* The viewport is currently in portrait orientation \*/
} else {
/\* The viewport is not currently in portrait orientation, therefore landscape \*/
}
```
Receiving query notifications
-----------------------------
If you need to be aware of changes to the evaluated result of the query on an ongoing basis, it's more efficient to register a [listener](https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener) than to poll the query's result. To do this, call the `addEventListener()` method on the [`MediaQueryList`](https://developer.mozilla.org/en-US/docs/Web/API/MediaQueryList) object, with a callback function to invoke when the media query status changes (e.g., the media query test goes from `true` to `false`):
```
// Create the query list.
const mediaQueryList = window.matchMedia("(orientation: portrait)");
// Define a callback function for the event listener.
function handleOrientationChange(mql) {
// …
}
// Run the orientation change handler once.
handleOrientationChange(mediaQueryList);
// Add the callback function as a listener to the query list.
mediaQueryList.addEventListener('change', handleOrientationChange);
```
This code creates the orientation-testing media query list, then adds an event listener to it. After defining the listener, we also call the listener directly. This makes our listener perform adjustments based on the current device orientation; otherwise, our code might assume the device is in portrait mode at startup, even if it's actually in landscape mode.
The `handleOrientationChange()` function would look at the result of the query and handle whatever we need to do on an orientation change:
```
function handleOrientationChange(evt) {
if (evt.matches) {
/\* The viewport is currently in portrait orientation \*/
} else {
/\* The viewport is currently in landscape orientation \*/
}
}
```
Above, we define the parameter as `evt` — an event object. This makes sense because [newer implementations of `MediaQueryList`](https://developer.mozilla.org/en-US/docs/Web/API/MediaQueryList#browser_compatibility) handle event listeners in a standard way. They no longer use the unusual [`MediaQueryListListener`](https://developer.mozilla.org/en-US/docs/Web/API/MediaQueryList) mechanism, but a standard event listener setup, passing an [event object](https://developer.mozilla.org/en-US/docs/Web/API/Event) of type [`MediaQueryListEvent`](https://developer.mozilla.org/en-US/docs/Web/API/MediaQueryListEvent) as the argument to the callback function.
This event object also includes the [`media`](https://developer.mozilla.org/en-US/docs/Web/API/MediaQueryListEvent/media) and [`matches`](https://developer.mozilla.org/en-US/docs/Web/API/MediaQueryListEvent/matches) properties, so you can query these features of the `MediaQueryList` by directly accessing it, or accessing the event object.
Ending query notifications
--------------------------
To stop receiving notifications about changes to the value of your media query, call [`removeEventListener()`](https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/removeEventListener) on the `MediaQueryList`, passing it the name of the previously-defined callback function:
```
mediaQueryList.removeEventListener('change', handleOrientationChange);
```
Browser compatibility
---------------------
| | Desktop | Mobile |
| --- | --- | --- |
| | Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet |
| `EventTarget_inheritance` | 39 | 16 | 55 | No | 26 | 14 | 39 | 39 | 55 | 26 | 14 | 4.0 |
| `Testing_media_queries` | 9 | 12 | 6 | 10 | 12.1 | 5.1 | ≤37 | 18 | 6 | 12.1 | 5 | 1.0 |
| `addListener` | 9 | 12 | 6 | 10 | 12.1 | 5.1 | ≤37 | 18 | 6 | 12.1 | 5 | 1.0 |
| `change_event` | 39 | 79 | 55 | No | 26 | 14 | 39 | 39 | 55 | 26 | 14 | 4.0 |
| `matches` | 9 | 12 | 6 | 10 | 12.1 | 5.1 | ≤37 | 18 | 6 | 12.1 | 5 | 1.0 |
| `media` | 9 | 12 | 6 | 10 | 12.1 | 5.1 | ≤37 | 18 | 6 | 12.1 | 5 | 1.0 |
| `removeListener` | 9 | 12 | 6 | 10 | 12.1 | 5.1
Before Safari 14, `MediaQueryList` is based on `EventTarget`, so you must use `addListener()` and `removeListener()` to observe media query lists. | ≤37 | 18 | 6 | 12.1 | 5
Before Safari 14, `MediaQueryList` is based on `EventTarget`, so you must use `addListener()` and `removeListener()` to observe media query lists. | 1.0 |
See also
--------
* [Media queries](using_media_queries)
* [`window.matchMedia()`](https://developer.mozilla.org/en-US/docs/Web/API/Window/matchMedia)
* [`MediaQueryList`](https://developer.mozilla.org/en-US/docs/Web/API/MediaQueryList)
* [`MediaQueryListEvent`](https://developer.mozilla.org/en-US/docs/Web/API/MediaQueryListEvent)
css Using media queries for accessibility Using media queries for accessibility
=====================================
[**Media Queries**](../@media) can be used to help users with disabilities better experience your website.
Reduced Motion
--------------
Blinking and flashing animation can be problematic for people with cognitive concerns such as Attention Deficit Hyperactivity Disorder (ADHD). Additionally, certain kinds of motion can be a trigger for Vestibular disorders, epilepsy, and migraine and Scotopic sensitivity. The [`prefers-reduced-motion`](../@media/prefers-reduced-motion) media query enables providing an experience with fewer animations and transitions to users who have set their operating system's accessibility preferences to reduce motion.
Also, this method of switching animation off according to the user's preference can also benefit users with low battery or low-end phones or computers.
### Syntax
`no-preference` Indicates that the user has made no preference known to the system.
`reduce` Indicates that user has notified the system that they prefer an interface that minimizes the amount of movement or animation, preferably to the point where all non-essential movement is removed.
### Example
This example has an annoying animation unless you turn on Reduce Motion in your accessibility preferences.
#### HTML
```
<div class="animation">animated box</div>
```
#### CSS
```
.animation {
animation: vibrate 0.3s linear infinite both;
}
@media (prefers-reduced-motion: reduce) {
.animation {
animation: none;
}
}
```
The value of `prefers-reduced-motion` is `reduce`, not "none". Users are not expecting no animation, such as could be set with `* {animation: none !important;}`. Rather, they expect motion animation triggered by interaction to be disabled, unless the animation is essential to the functionality or the information being conveyed (see [WCAG: Animation from Interactions](https://www.w3.org/WAI/WCAG21/Understanding/animation-from-interactions.html)).
High Contrast Mode
------------------
**Non-standard:** This feature is non-standard and is not on a standards track. Do not use it on production sites facing the Web: it will not work for every user. There may also be large incompatibilities between implementations and the behavior may change in the future.
The [`-ms-high-contrast`](../@media/-ms-high-contrast) CSS media feature is a [Microsoft extension](https://developer.mozilla.org/en-US/docs/Web/CSS/Microsoft_Extensions) that describes whether the application is being displayed in high contrast mode, and with what color variation.
This will help not only users with low vision and contrast sensitivity issues but also users that are working on a computer or phone with direct sunlight.
### Syntax
The `-ms-high-contrast` media feature is specified as one of the following values.
### Values
`active` Indicates that the subsequent styling rules will be applied when the system is placed in high contrast mode with any color variation.
`black-on-white` Indicates that the subsequent styling rules will be applied when the system is placed in high contrast mode with a black-on-white color variation.
`white-on-black` Indicates that the subsequent styling rules will be applied when the system is placed in high contrast mode with a white-on-black color variation.
### Example
The following declarations will match applications that are being displayed in high contrast mode with any color variation, a black-on-white color variation, and a white-on-black color variation, respectively.
```
@media screen and (-ms-high-contrast: active) {
/\* All high contrast styling rules \*/
}
@media screen and (-ms-high-contrast: black-on-white) {
div {
background-image: url("image-bw.png");
}
}
@media screen and (-ms-high-contrast: white-on-black) {
div {
background-image: url("image-wb.png");
}
}
```
See also
--------
* [Designing With Reduced Motion For Motion Sensitivities](https://www.smashingmagazine.com/2020/09/design-reduced-motion-sensitivities/)
css size size
====
The `size` [CSS](https://developer.mozilla.org/en-US/docs/Web/CSS) [at-rule](../at-rule) descriptor, used with the [`@page`](../@page) at-rule, defines the size and orientation of the box which is used to represent a page. Most of the time, this size corresponds to the target size of the printed page if applicable.
Size may either be defined with a "scalable" keyword (in this case the page will fill the available dimensions) or with absolute dimensions.
Syntax
------
```
/\* Keyword values for scalable size \*/
size: auto;
size: portrait;
size: landscape;
/\* <length> values \*/
/\* 1 value: height = width \*/
size: 6in;
/\* 2 values: width then height \*/
size: 4in 6in;
/\* Keyword values for absolute size \*/
size: A4;
size: B5;
size: JIS-B4;
size: letter;
/\* Mixing size and orientation \*/
size: A4 portrait;
```
### Values
`auto` The user agent decides the size of the page. In most cases, the dimensions and orientation of the target sheet are used.
`landscape` The content of the page is displayed in landscape mode (i.e. the longest side of the box is horizontal).
`portrait` The content of the page is displayed in portrait mode (i.e. the longest side of the box is vertical). This is the default orientation.
`<length>` Any length value (see [`<length>`](../length)). The first value corresponds to the width of the page box and the second one corresponds to its height. If only one value is provided, it is used for both width and height.
`<page-size>` A keyword which may be any of the following values:
A5 This matches the standard, ISO dimensions: 148mm x 210mm.
A4 This matches the standard, ISO dimensions: 210mm x 297mm. (most frequently used dimensions for personal printing.)
A3 This matches the standard, ISO dimensions: 297mm x 420mm.
B5 This matches the standard, ISO dimensions: 176mm x 250mm.
B4 This matches the standard, ISO dimensions: 250mm x 353mm.
JIS-B5 This correspond to the JIS standard dimensions: 182mm x 257mm.
JIS-B4 This correspond to the JIS standard dimensions: 257mm x 364mm.
letter This keyword is an equivalent to the dimensions of letter paper in North America i.e. 8.5in x 11in.
legal This keyword is an equivalent to the dimensions of legal papers in North America i.e. 8.5in x 14in.
ledger This keyword is an equivalent to the dimensions of ledger pages in North America i.e. 11in x 17in.
Formal definition
-----------------
| | |
| --- | --- |
| Related [at-rule](../at-rule) | [`@page`](../@page) |
| [Initial value](../initial_value) | `auto` |
| [Computed value](../computed_value) | as specified, but with relative lengths converted into absolute lengths |
Formal syntax
-------------
```
size =
[<length>](../length)[{1,2}](../value_definition_syntax#curly_braces) [|](../value_definition_syntax#single_bar)
auto [|](../value_definition_syntax#single_bar)
[[](../value_definition_syntax#brackets) [<page-size>](../page-size) [||](../value_definition_syntax#double_bar) [[](../value_definition_syntax#brackets) portrait [|](../value_definition_syntax#single_bar) landscape []](../value_definition_syntax#brackets) []](../value_definition_syntax#brackets)
```
Examples
--------
### Specifying size and orientation
```
@page {
size: A4 landscape;
}
```
### Specifying a custom size
```
@page {
size: 4in 6in;
}
```
### Nesting inside a @media rule
```
@media print {
@page {
size: 50mm 150mm;
}
}
```
Specifications
--------------
| Specification |
| --- |
| [CSS Paged Media Module Level 3 # page-size-prop](https://w3c.github.io/csswg-drafts/css-page/#page-size-prop) |
Browser compatibility
---------------------
| | Desktop | Mobile |
| --- | --- | --- |
| | Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet |
| `size` | 15 | 79 | No | No | 15 | No | 37 | 18 | No | 14 | No | 1.5 |
| `jis-b4` | 83 | 83 | No | No | 69 | No | 83 | 83 | No | 59 | No | 13.0 |
| `jis-b5` | 83 | 83 | No | No | 69 | No | 83 | 83 | No | 59 | No | 13.0 |
css hover hover
=====
The `hover` [CSS](https://developer.mozilla.org/en-US/docs/Web/CSS) [media feature](../media_queries/using_media_queries#media_features) can be used to test whether the user's *primary* input mechanism can hover over elements.
Syntax
------
The `hover` feature is specified as a keyword value chosen from the list below.
`none` The primary input mechanism cannot hover at all or cannot conveniently hover (e.g., many mobile devices emulate hovering when the user performs an inconvenient long tap), or there is no primary pointing input mechanism.
`hover` The primary input mechanism can conveniently hover over elements.
Examples
--------
### HTML
```
<a href="#">Try hovering over me!</a>
```
### CSS
```
/\* default hover effect \*/
a:hover {
color: black;
background: yellow;
}
@media (hover: hover) {
/\* when hover is supported \*/
a:hover {
color: white;
background: black;
}
}
```
### Result
Specifications
--------------
| Specification |
| --- |
| [Media Queries Level 4 # hover](https://w3c.github.io/csswg-drafts/mediaqueries/#hover) |
Browser compatibility
---------------------
| | Desktop | Mobile |
| --- | --- | --- |
| | Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet |
| `hover` | 38
Before Chrome 41, the implementation was buggy and reported `(hover: none)` on non-touch-based computers with a mouse/trackpad. See [bug 441613](https://crbug.com/441613). | 12 | 64 | No | 28 | 9 | 38
Before Chrome 41, the implementation was buggy and reported `(hover: none)` on non-touch-based computers with a mouse/trackpad. See [bug 441613](https://crbug.com/441613). | 50 | 64 | 28 | 9 | 5.0 |
See also
--------
* [Using Media Queries](../media_queries/using_media_queries)
* [@media](../@media)
css orientation orientation
===========
The `orientation` [CSS](https://developer.mozilla.org/en-US/docs/Web/CSS) [media feature](../media_queries/using_media_queries#media_features) can be used to test the orientation of the [viewport](https://developer.mozilla.org/en-US/docs/Glossary/Viewport) (or the page box, for [paged media](https://developer.mozilla.org/en-US/docs/Web/CSS/Paged_Media)).
**Note:** This feature does not correspond to *device* orientation. Opening the soft keyboard on many devices in portrait orientation will cause the viewport to become wider than it is tall, thereby causing the browser to use landscape styles instead of portrait.
Syntax
------
The `orientation` feature is specified as a keyword value chosen from the list below.
### Keyword values
`portrait` The viewport is in a portrait orientation, i.e., the height is greater than or equal to the width.
`landscape` The viewport is in a landscape orientation, i.e., the width is greater than the height.
Examples
--------
### Portrait orientation
In this example we have three boxes in the HTML, and use the `orientation` media feature to switch between a row layout (in landscape) and a column layout (in portrait).
The example output is embedded in an [`<iframe>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe) whose height is greater than its width, so the boxes get a column layout.
#### HTML
```
<div>Box 1</div>
<div>Box 2</div>
<div>Box 3</div>
```
#### CSS
```
body {
display: flex;
}
div {
background: yellow;
width: 200px;
height: 200px;
margin: 0.5rem;
padding: 0.5rem;
}
@media (orientation: landscape) {
body {
flex-direction: row;
}
}
@media (orientation: portrait) {
body {
flex-direction: column;
}
}
```
#### Result
### Landscape orientation
This example has exactly the same code as the previous example: it has three boxes in the HTML, and uses the `orientation` media feature to switch between a row layout (in landscape) and a column layout (in portrait).
However, in this example, the example output is embedded in an [`<iframe>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe) whose height is less than its width, so the boxes get a row layout.
#### HTML
```
<div>Box 1</div>
<div>Box 2</div>
<div>Box 3</div>
```
#### CSS
```
body {
display: flex;
}
div {
background: yellow;
width: 200px;
height: 200px;
margin: 0.5rem;
padding: 0.5rem;
}
@media (orientation: landscape) {
body {
flex-direction: row;
}
}
@media (orientation: portrait) {
body {
flex-direction: column;
}
}
```
Specifications
--------------
| Specification |
| --- |
| [Media Queries Level 4 # orientation](https://w3c.github.io/csswg-drafts/mediaqueries/#orientation) |
Browser compatibility
---------------------
| | Desktop | Mobile |
| --- | --- | --- |
| | Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet |
| `orientation` | 3 | 12 | 2 | 9 | 10.6 | 5 | ≤37 | 18 | 4 | 11 | 4.2 | 1.0 |
css pointer pointer
=======
The `pointer` [CSS](https://developer.mozilla.org/en-US/docs/Web/CSS) [media feature](../media_queries/using_media_queries#media_features) tests whether the user has a pointing device (such as a mouse), and if so, how accurate the *primary* pointing device is.
**Note:** If you want to test the accuracy of *any* pointing device, use [`any-pointer`](any-pointer) instead.
Syntax
------
The `pointer` feature is specified as a keyword value chosen from the list below.
`none` The primary input mechanism does not include a pointing device.
`coarse` The primary input mechanism includes a pointing device of limited accuracy.
`fine` The primary input mechanism includes an accurate pointing device.
Examples
--------
This example creates a small checkbox for users with fine primary pointers and a large checkbox for users with coarse primary pointers.
### HTML
```
<input id="test" type="checkbox" />
<label for="test">Look at me!</label>
```
### CSS
```
input[type="checkbox"] {
appearance: none;
border: solid;
margin: 0;
}
input[type="checkbox"]:checked {
background: gray;
}
@media (pointer: fine) {
input[type="checkbox"] {
width: 15px;
height: 15px;
border-width: 1px;
border-color: blue;
}
}
@media (pointer: coarse) {
input[type="checkbox"] {
width: 30px;
height: 30px;
border-width: 2px;
border-color: red;
}
}
```
### Result
Specifications
--------------
| Specification |
| --- |
| [Media Queries Level 4 # pointer](https://w3c.github.io/csswg-drafts/mediaqueries/#pointer) |
Browser compatibility
---------------------
| | Desktop | Mobile |
| --- | --- | --- |
| | Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet |
| `pointer` | 41 | 12 | 64 | No | 28 | 9 | 41 | 50 | 64 | 28 | 9 | 5.0 |
See also
--------
* [The `any-pointer` media feature](any-pointer)
| programming_docs |
css device-aspect-ratio device-aspect-ratio
===================
**Deprecated:** This feature is no longer recommended. Though some browsers might still support it, it may have already been removed from the relevant web standards, may be in the process of being dropped, or may only be kept for compatibility purposes. Avoid using it, and update existing code if possible; see the [compatibility table](#browser_compatibility) at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time.
**Note:** To query for the aspect ratio of the viewport, developers should use the [`aspect-ratio`](aspect-ratio) media feature instead.
The `device-aspect-ratio` [CSS](https://developer.mozilla.org/en-US/docs/Web/CSS) [media feature](../media_queries/using_media_queries#media_features) can be used to test the width-to-height aspect ratio of an output device.
Syntax
------
The `device-aspect-ratio` feature is specified as a [`<ratio>`](../ratio). It is a range feature, meaning that you can also use the prefixed `min-device-aspect-ratio` and `max-device-aspect-ratio` variants to query minimum and maximum values, respectively.
Examples
--------
### Using min-device-aspect-ratio
```
article {
padding: 1rem;
}
@media screen and (min-device-aspect-ratio: 16/9) {
article {
padding: 1rem 5vw;
}
}
```
Specifications
--------------
| Specification |
| --- |
| [Media Queries Level 4 # device-aspect-ratio](https://w3c.github.io/csswg-drafts/mediaqueries/#device-aspect-ratio) |
Browser compatibility
---------------------
| | Desktop | Mobile |
| --- | --- | --- |
| | Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet |
| `device-aspect-ratio` | 1 | 12 | 2 | 9 | 10 | 3 | ≤37 | 18 | 4 | 10.1 | 1 | 1.0 |
css prefers-contrast prefers-contrast
================
The `prefers-contrast` [CSS](https://developer.mozilla.org/en-US/docs/Web/CSS) [media feature](../media_queries/using_media_queries#media_features) is used to detect whether the user has requested the web content to be presented with a lower or higher contrast.
Syntax
------
`no-preference` Indicates that the user has made no preference known to the system. This keyword value evaluates as false in the Boolean context.
`more` Indicates that user has notified the system that they prefer an interface that has a higher level of contrast.
`less` Indicates that user has notified the system that they prefer an interface that has a lower level of contrast.
`custom` Indicates that user has notified the system for using a specific set of colors, and the contrast implied by these colors matches neither `more` nor `less`. This value will match the color palette specified by users of [`forced-colors: active`](forced-colors).
User preferences
----------------
Various operating systems do support such preferences and user agents are likely to rely on the settings provided by the operating system.
Examples
--------
This example has an annoying low contrast by default.
### HTML
```
<div class="contrast">low contrast box</div>
```
### CSS
```
.contrast {
width: 100px;
height: 100px;
outline: 2px dashed black;
}
@media (prefers-contrast: more) {
.contrast {
outline: 2px solid black;
}
}
```
### Result
Specifications
--------------
| Specification |
| --- |
| [Media Queries Level 5 # prefers-contrast](https://w3c.github.io/csswg-drafts/mediaqueries-5/#prefers-contrast) |
Browser compatibility
---------------------
| | Desktop | Mobile |
| --- | --- | --- |
| | Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet |
| `prefers-contrast` | 96 | 96 | 101 | No | 82 | 14.1 | 96 | 96 | 101 | No | 14.5 | 17.0 |
See also
--------
* Microsoft [-ms-high-contrast](https://docs.microsoft.com/previous-versions/hh771830(v=vs.85)) media feature
* CSS <forced-colors> media query
css any-hover any-hover
=========
The `any-hover` [CSS](https://developer.mozilla.org/en-US/docs/Web/CSS) [media feature](../media_queries/using_media_queries#media_features) can be used to test whether *any* available input mechanism can hover over elements.
Syntax
------
The `any-hover` feature is specified as a keyword value chosen from the list below.
`none` None of the available input mechanism(s) can hover conveniently, or there is no pointing input mechanism.
`hover` One or more available input mechanisms can conveniently hover over elements.
Examples
--------
### Testing whether input methods can hover
#### HTML
```
<a href="#">Try hovering over me!</a>
```
#### CSS
```
@media (any-hover: hover) {
a:hover {
background: yellow;
}
}
```
#### Result
Specifications
--------------
| Specification |
| --- |
| [Media Queries Level 4 # any-input](https://w3c.github.io/csswg-drafts/mediaqueries/#any-input) |
Browser compatibility
---------------------
| | Desktop | Mobile |
| --- | --- | --- |
| | Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet |
| `any-hover` | 41 | 16 | 64 | No | 28 | 9 | 41 | 41 | 64 | 28 | 9 | 5.0 |
See also
--------
* [the `hover` media feature](hover)
css display-mode display-mode
============
The `display-mode` [CSS](https://developer.mozilla.org/en-US/docs/Web/CSS) [media feature](../media_queries/using_media_queries#media_features) can be used to test the display mode of an application. You can use it to provide a consistent user experience between launching a site from a URL and launching it from a desktop icon.
This feature corresponds to the Web app manifest's [`display`](https://developer.mozilla.org/en-US/docs/Web/Manifest#display) member. Both apply to the top-level browsing context and any child browsing contexts. The feature query applies regardless of whether a web app manifest is present.
Syntax
------
The `display-mode` feature is specified as a keyword value chosen from the list below.
| Display mode | Description | Fallback display mode |
| --- | --- | --- |
| `fullscreen` | All of the available display area is used and no user agent [chrome](https://developer.mozilla.org/en-US/docs/Glossary/Chrome) is shown. | `standalone` |
| `standalone` | The application will look and feel like a standalone application. This can include the application having a different window, its own icon in the application launcher, etc. In this mode, the user agent will exclude UI elements for controlling navigation, but can include other UI elements such as a status bar. | `minimal-ui` |
| `minimal-ui` | The application will look and feel like a standalone application, but will have a minimal set of UI elements for controlling navigation. The elements will vary by browser. | `browser` |
| `browser` | The application opens in a conventional browser tab or new window, depending on the browser and platform. | (none) |
| `window-controls-overlay` | In this mode, the application looks and feels like a standalone desktop application, and the [Window Controls Overlay](https://developer.mozilla.org/en-US/docs/Web/API/Window_Controls_Overlay_API) feature is enabled. | (none) |
Examples
--------
### The CSS is used if the device is at fullscreen
```
@media all and (display-mode: fullscreen) {
body {
margin: 0;
border: 5px solid black;
}
}
```
Specifications
--------------
| Specification |
| --- |
| [Media Queries Level 5 # display-mode](https://w3c.github.io/csswg-drafts/mediaqueries-5/#display-mode) |
Browser compatibility
---------------------
| | Desktop | Mobile |
| --- | --- | --- |
| | Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet |
| `display-mode` | 42 | 79 | 47
Firefox 47 and later support `display-mode` values `fullscreen` and `browser`. Firefox 57 added support for `minimal-ui` and `standalone` values. | No | 29 | 13 | 42 | 42 | 47
Firefox 47 and later support `display-mode` values `fullscreen` and `browser`. Firefox 57 added support for `minimal-ui` and `standalone` values. | 29 | 12.2 | 4.0 |
See also
--------
* [Using Media Queries](../media_queries/using_media_queries)
* [@media](../@media)
css grid grid
====
The `grid` [CSS](https://developer.mozilla.org/en-US/docs/Web/CSS) [media feature](../media_queries/using_media_queries#media_features) can be used to test whether the output device uses a grid-based screen.
Most modern computers and smartphones have bitmap-based screens. Examples of grid-based devices include text-only terminals and basic phones with only one fixed font.
Syntax
------
The `grid` feature is specified as a [`<mq-boolean>`](../media_queries/using_media_queries) value (`0` or `1`) representing whether or not the output device is grid-based.
Examples
--------
### HTML
```
<p class="unknown">I don't know if you're using a grid device. :-(</p>
<p class="bitmap">You are using a bitmap device.</p>
<p class="grid">You are using a grid device! Neato!</p>
```
### CSS
```
:not(.unknown) {
color: lightgray;
}
@media (grid: 0) {
.unknown {
color: lightgray;
}
.bitmap {
color: red;
text-transform: uppercase;
}
}
@media (grid: 1) {
.unknown {
color: lightgray;
}
.grid {
color: black;
text-transform: uppercase;
}
}
```
### Result
Specifications
--------------
| Specification |
| --- |
| [Media Queries Level 4 # grid](https://w3c.github.io/csswg-drafts/mediaqueries/#grid) |
Browser compatibility
---------------------
| | Desktop | Mobile |
| --- | --- | --- |
| | Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet |
| `grid` | 1 | 12 | 2 | 10 | 10 | 3 | ≤37 | 18 | 4 | 10.1 | 1 | 1.0 |
See also
--------
* [Using Media Queries](../media_queries/using_media_queries)
* [@media](../@media)
css prefers-color-scheme prefers-color-scheme
====================
The `prefers-color-scheme` [CSS](https://developer.mozilla.org/en-US/docs/Web/CSS) [media feature](../media_queries/using_media_queries#targeting_media_features) is used to detect if a user has requested light or dark color themes. A user indicates their preference through an operating system setting (e.g. light or dark mode) or a user agent setting.
Embedded elements
-----------------
For SVG and iframes, `prefers-color-scheme` lets you set a CSS style for the SVG or iframe based on the [`color-scheme`](../color-scheme) of the parent element in the web page. SVGs must be used embedded (i.e., `<img src="circle.svg" alt="circle" />`) as opposed to [inlined in HTML](https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/SVG_In_HTML_Introduction#basic_example). An example of using `prefers-color-scheme` in SVGs can be found in the [Color scheme inheritance](#color_scheme_inheritance) section.
Using `prefers-color-scheme` is allowed in [cross-origin](https://developer.mozilla.org/en-US/docs/Web/Security/Same-origin_policy#cross-origin_network_access) `<svg>` and `<iframe>` elements. Cross-origin elements are elements retrieved from a different host than the page that is referencing them. To learn more about SVGs, see the [SVG documentation](https://developer.mozilla.org/en-US/docs/Web/SVG) and for more information about iframes, see the [iframe documentation](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe).
Syntax
------
`light` Indicates that user has notified that they prefer an interface that has a light theme, or has not expressed an active preference.
`dark` Indicates that user has notified that they prefer an interface that has a dark theme.
Examples
--------
### Detecting a dark theme
The elements below have an initial color theme. They can be further themed according to the user's color scheme preference.
```
<div class="day">Day (initial)</div>
<div class="day light-scheme">Day (changes in light scheme)</div>
<div class="day dark-scheme">Day (changes in dark scheme)</div>
<br />
<div class="night">Night (initial)</div>
<div class="night light-scheme">Night (changes in light scheme)</div>
<div class="night dark-scheme">Night (changes in dark scheme)</div>
```
The following CSS is used to style the elements above:
```
.day {
background: #eee;
color: black;
}
.night {
background: #333;
color: white;
}
@media (prefers-color-scheme: dark) {
.day.dark-scheme {
background: #333;
color: white;
}
.night.dark-scheme {
background: black;
color: #ddd;
}
}
@media (prefers-color-scheme: light) {
.day.light-scheme {
background: white;
color: #555;
}
.night.light-scheme {
background: #eee;
color: black;
}
}
.day,
.night {
display: inline-block;
padding: 1em;
width: 7em;
height: 2em;
vertical-align: middle;
}
```
### Color scheme inheritance
The following example shows how to use `prefers-color-scheme` with the [`color-scheme` property](../color-scheme) inherited from a parent element. A script is used to set the source of the `<img>` elements and their `alt` attributes. This would normally be done in HTML as `<img src="circle.svg" alt="circle" />`.
You should see three circles, with one drawn in a different color. The first circle inherits the `color-scheme` from the OS and can be toggled using the system OS's theme switcher.
The second and third circles inherit the `color-scheme` from the embedding element; the `@media` query allows setting styles of the SVG content based on the parent element's `color-scheme`. In this case, the parent element with a `color-scheme` CSS property is a `<div>`.
```
<div>
<img />
</div>
<div style="color-scheme: light">
<img />
</div>
<div style="color-scheme: dark">
<img />
</div>
<!-- Embed an SVG for all <img> elements -->
<script>
for (let img of document.querySelectorAll("img")) {
img.alt = "circle";
img.src =
"data:image/svg+xml;base64," +
btoa(`
<svg width="32" height="32" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg">
<style>
:root { color: blue }
@media (prefers-color-scheme: dark) {
:root { color: purple }
}
</style>
<circle fill="currentColor" cx="16" cy="16" r="16"/>
</svg>
`);
}
</script>
```
Specifications
--------------
| Specification |
| --- |
| [Media Queries Level 5 # prefers-color-scheme](https://w3c.github.io/csswg-drafts/mediaqueries-5/#prefers-color-scheme) |
Browser compatibility
---------------------
| | Desktop | Mobile |
| --- | --- | --- |
| | Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet |
| `prefers-color-scheme` | 76 | 79 | 67 | No | 62 | 12.1 | 76 | 76 | 67 | 54 | 13 | 14.2 |
| `no-preference` | 76-80 | 79-80 | 67-79 | No | 62-71 | 12.1 | 76-80 | 76-80 | 67-79 | 54 | 13 | 14.2 |
| `respects-inherited-scheme` | No | No | 105 | No | No | No | No | No | 105 | No | No | No |
See also
--------
* [`color-scheme`](../color-scheme) CSS property
* [Simulate prefers-color-scheme in Firefox](https://firefox-source-docs.mozilla.org/devtools-user/page_inspector/how_to/examine_and_edit_css/index.html#view-media-rules-for-prefers-color-scheme) (Firefox Page Inspector > Examine and edit CSS)
* [Video tutorial: Coding a Dark Mode for your Website](https://www.youtube.com/watch?v=jmepqJ5UbuM)
* [Redesigning your product and website for dark mode](https://stuffandnonsense.co.uk/blog/redesigning-your-product-and-website-for-dark-mode)
* Changing color schemes in [Windows](https://blogs.windows.com/windowsexperience/2019/04/01/windows-10-tip-dark-theme-in-file-explorer/), [macOS](https://developer.apple.com/design/human-interface-guidelines/macos/visual-design/dark-mode/), [Android](https://www.theverge.com/2019/5/7/18530599/google-android-q-features-hands-on-dark-mode-gestures-accessibility-io-2019), or [other platforms](https://support.mozilla.org/en-US/questions/1271928).
css color-index color-index
===========
The `color-index` [CSS](https://developer.mozilla.org/en-US/docs/Web/CSS) [media feature](../media_queries/using_media_queries#media_features) can be used to test the number of entries in the output device's color lookup table.
Syntax
------
The `color-index` feature is specified as an [`<integer>`](../integer) value representing the number of entries in the output device's color lookup table. (This value is zero if the device does not use such a table.) It is a range feature, meaning that you can also use the prefixed `min-color-index` and `max-color-index` variants to query minimum and maximum values, respectively.
Examples
--------
### Basic example
#### HTML
```
<p>This is a test.</p>
```
#### CSS
```
p {
color: black;
}
@media (color-index) {
p {
color: red;
}
}
@media (min-color-index: 15000) {
p {
color: #1475ef;
}
}
```
#### Result
### Custom stylesheet
This HTML will apply a special stylesheet for devices that have at least 256 colors.
```
<link rel="stylesheet" href="http://foo.bar.com/base.css" />
<link
rel="stylesheet"
media="all and (min-color-index: 256)"
href="http://foo.bar.com/color-stylesheet.css" />
```
Specifications
--------------
| Specification |
| --- |
| [Media Queries Level 4 # color-index](https://w3c.github.io/csswg-drafts/mediaqueries/#color-index) |
Browser compatibility
---------------------
| | Desktop | Mobile |
| --- | --- | --- |
| | Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet |
| `color-index` | 29 | 79 | No | No | 16 | 8 | 4.4 | 29 | No | 16 | 8 | 2.0 |
See also
--------
* [Using Media Queries](../media_queries/using_media_queries)
* [@media](../@media)
css color-gamut color-gamut
===========
The `color-gamut` [CSS](https://developer.mozilla.org/en-US/docs/Web/CSS) [media feature](../media_queries/using_media_queries#media_features) can be used to test the approximate range of colors that are supported by the [user agent](https://developer.mozilla.org/en-US/docs/Glossary/User_agent) and the output device.
Syntax
------
The `color-gamut` feature is specified as a keyword value chosen from the list below.
`srgb` The output device can support approximately the [sRGB](https://en.wikipedia.org/wiki/SRGB) [gamut](https://developer.mozilla.org/en-US/docs/Glossary/Gamut) or more. This includes the vast majority of color displays.
`p3` The output device can support approximately the [gamut](https://developer.mozilla.org/en-US/docs/Glossary/Gamut) specified by the [Display P3](https://www.color.org/chardata/rgb/DisplayP3.xalter) Color Space or more. The p3 gamut is larger than and includes the srgb gamut.
`rec2020` The output device can support approximately the [gamut](https://developer.mozilla.org/en-US/docs/Glossary/Gamut) specified by the [ITU-R Recommendation BT.2020 Color Space](https://en.wikipedia.org/wiki/Rec._2020) or more. The rec2020 gamut is larger than and includes the p3 gamut.
Examples
--------
### HTML
```
<p>This is a test.</p>
```
### CSS
```
@media (color-gamut: srgb) {
p {
background: #f4ae8a;
}
}
```
### Result
Specifications
--------------
| Specification |
| --- |
| [Media Queries Level 4 # color-gamut](https://w3c.github.io/csswg-drafts/mediaqueries/#color-gamut) |
Browser compatibility
---------------------
| | Desktop | Mobile |
| --- | --- | --- |
| | Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet |
| `color-gamut` | 58 | 79 | No | No | 45 | 10 | 58 | 58 | No | 43 | 10 | 7.0 |
See also
--------
* [Using Media Queries](../media_queries/using_media_queries)
* [@media](../@media)
| programming_docs |
css prefers-reduced-motion prefers-reduced-motion
======================
**Warning:** An embedded example at the bottom of this page has a scaling movement that may be problematic for some readers. Readers with vestibular motion disorders may wish to enable the reduce motion feature on their device before viewing the animation.
The `prefers-reduced-motion` [CSS](https://developer.mozilla.org/en-US/docs/Web/CSS) [media feature](../media_queries/using_media_queries#media_features) is used to detect if the user has requested that the system minimize the amount of non-essential motion it uses.
```
@media (prefers-reduced-motion) {
/\* styles to apply if the user's settings are set to reduced motion \*/
}
```
Syntax
------
`no-preference` Indicates that the user has made no preference known to the system.
`reduce` Indicates that user has notified the system that they prefer an interface that removes or replaces the types of motion-based animation that trigger discomfort for those with vestibular motion disorders.
User preferences
----------------
For Firefox, the `reduce` request is honoured if:
* In GTK/GNOME: GNOME Tweaks > General tab (or Appearance, depending on version) > Animations is turned off.
+ Alternatively, add `gtk-enable-animations = false` to the `[Settings]` block of [the GTK 3 configuration file](https://wiki.archlinux.org/title/GTK#Configuration).
* In Plasma/KDE: System Settings > Workspace Behavior -> General Behavior > "Animation speed" is set all the way to right to "Instant".
* In Windows 10: Settings > Ease of Access > Display > Show animations in Windows.
* In Windows 11: Settings > Accessibility > Visual Effects > Animation Effects
* In macOS: System Preferences > Accessibility > Display > Reduce motion.
* In iOS: Settings > General > Accessibility > Reduce Motion.
* In Android 9+: Settings > Accessibility > Remove animations.
* In Firefox `about:config`: Add a number preference called `ui.prefersReducedMotion` and set its value to either `0` for full animation or to `1` to indicate a preference for reduced motion. Changes to this preference take effect immediately.
Examples
--------
This example has a scaling animation by default. If Reduce Motion is enabled in your accessibility preferences, the animation is toned down to a simple dissolve without vestibular motion triggers.
### HTML
```
<div class="animation">animated box</div>
```
### CSS
```
.animation {
animation: pulse 1s linear infinite both;
}
/\* Tone down the animation to avoid vestibular motion triggers like scaling or panning large objects. \*/
@media (prefers-reduced-motion) {
.animation {
animation: dissolve 2s linear infinite both;
}
}
```
### Result
Specifications
--------------
| Specification |
| --- |
| [Media Queries Level 5 # prefers-reduced-motion](https://w3c.github.io/csswg-drafts/mediaqueries-5/#prefers-reduced-motion) |
Browser compatibility
---------------------
| | Desktop | Mobile |
| --- | --- | --- |
| | Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet |
| `prefers-reduced-motion` | 74 | 79 | 63 | No | 62 | 10.1 | 74 | 74 | 64 | 53 | 10.3 | 11.0 |
See also
--------
* [An Introduction to the Reduced Motion Media Query (CSS Tricks)](https://css-tricks.com/introduction-reduced-motion-media-query/)
* [Responsive Design for Motion (WebKit Blog)](https://webkit.org/blog/7551/responsive-design-for-motion/) includes vestibular motion trigger examples.
css forced-colors forced-colors
=============
The `forced-colors` [CSS](https://developer.mozilla.org/en-US/docs/Web/CSS) [media feature](../media_queries/using_media_queries#media_features) is used to detect if the [user agent](https://developer.mozilla.org/en-US/docs/Glossary/User_agent) has enabled a forced colors mode where it enforces a user-chosen limited color palette on the page. An example of a forced colors mode is Windows High Contrast mode.
Syntax
------
The `forced-colors` media feature indicates whether or not the browser is currently in forced-colors mode.
### Values
`none` Forced colors mode is not active; the page's colors are not being forced into a limited palette.
`active` Indicates that forced colors mode is active. The browser provides the color palette to authors through the [CSS system color](../color_value#system_colors) keywords and, if appropriate, triggers the appropriate value of [`prefers-color-scheme`](prefers-color-scheme) so that authors can adapt the page. The browser selects the value for `prefers-color-scheme` based on the lightness of the `Canvas` system color (see the [color adjust spec](https://www.w3.org/TR/css-color-adjust-1/#forced) for more details).
Usage notes
-----------
### Properties affected by forced-color mode
In forced colors mode, the values of the following properties are treated as if they have no author-level values specified. That is, browser-specified values are used instead. The browser-specified values do not affect the style cascade; the values are instead forced by the browser at paint time.
These browser-specified values are selected from the set of system colors — this ensures a consistent contrast for common UI elements for users that have forced colors enabled.
* [`color`](../color)
* [`background-color`](../background-color)
* [`text-decoration-color`](../text-decoration-color)
* [`text-emphasis-color`](../text-emphasis-color)
* [`border-color`](../border-color)
* [`outline-color`](../outline-color)
* [`column-rule-color`](../column-rule-color)
* [`-webkit-tap-highlight-color`](../-webkit-tap-highlight-color)
* [SVG fill attribute](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/fill)
* [SVG stroke attribute](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke)
Additionally the following properties have special behavior in forced colors mode:
* [`box-shadow`](../box-shadow) is forced to 'none'
* [`text-shadow`](../text-shadow) is forced to 'none'
* [`background-image`](../background-image) is forced to 'none' for values that are not url-based
* [`color-scheme`](../color-scheme) is forced to 'light dark'
* [`scrollbar-color`](../scrollbar-color) is forced to 'auto'
The system colors that are forced for the above properties depend on the context of the element. For example the [`color`](../color) property on button element will be forced to `ButtonText`. On normal text it will be forced to `CanvasText`. See the [list of system colors](../color_value#system_colors) for additional details of when each might be appropriate in various UI contexts.
**Note:** user agents choose system colors based on native element semantics, *not* on added ARIA roles. As an example, adding `role="button"` to a `div` will **not** cause an element's color to be forced to `ButtonText`
In addition to these adjustments, browsers will help ensure text legibility by drawing "backplates" behind text. This is particularly important for preserving contrast when text is placed on top of images.
There are two cases where the user agent does not force the values for the above properties — when a [`forced-color-adjust`](../forced-color-adjust) value of `none` is applied to an element, or when a system color is specified by the author.
When forced-color-adjust is set to `none` on an element, none of the forced color values will apply, and author styles will be applied as normal. Additionally, the backplate for text will be disabled.
When a system color is specified, it will be used instead of the value that would otherwise have been forced.
You can also use system colors with any property *other* than those listed above, to ensure that the rest of the page integrates with the restricted color palette available in forced colors mode.
### Accessibility concerns
In general, web authors should **not** be using the `forced-colors` media feature to create a separate design for users with this feature enabled. Instead, its intended usage is to make small tweaks to improve usability or legibility when the default application of forced colors does not work well for a given portion of a page.
The high contrast provided by forced colors mode's reduced palette and text backplates is often essential for some users to be able to read or use a given website, so adjustments that affect content should be chosen carefully and targeted to content that is otherwise not legible.
### User preferences
This media feature is active only if the user has enabled color scheme preferences in their operating system. One example of such a feature is High Contrast mode on Windows.
Examples
--------
**Note:** The below example will only work when using a browser that supports this media feature, and with a preference such as High Contrast mode enabled in your OS.
This example is a button that normally gets its contrast via [`box-shadow`](../box-shadow). Under forced colors mode, box-shadow is forced to none, so the example uses the forced-colors media feature to ensure there is a border of the appropriate color (ButtonText in this case)
### HTML
```
<button class="button">Press me!</button>
```
### CSS
```
.button {
border: 0;
padding: 10px;
box-shadow: -2px -2px 5px gray, 2px 2px 5px gray;
}
@media (forced-colors: active) {
.button {
/\* Use a border instead, since box-shadow is forced to 'none' in forced-colors mode \*/
border: 2px ButtonText solid;
}
}
```
### Result
Specifications
--------------
| Specification |
| --- |
| [Media Queries Level 5 # forced-colors](https://w3c.github.io/csswg-drafts/mediaqueries-5/#forced-colors) |
Browser compatibility
---------------------
| | Desktop | Mobile |
| --- | --- | --- |
| | Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet |
| `forced-colors` | 89 | 79 | 89 | No | No | No | No
See [bug 970285](https://crbug.com/970285). | No
See [bug 970285](https://crbug.com/970285). | 89 | No | No | No
See [bug 970285](https://crbug.com/970285). |
See also
--------
* [@media](../@media)
* [Styling for Windows high contrast with standards for forced colors.](https://blogs.windows.com/msedgedev/2020/09/17/styling-for-windows-high-contrast-with-new-standards-for-forced-colors/)
* [`forced-color-adjust`](../forced-color-adjust)
css height height
======
The `height` [CSS](https://developer.mozilla.org/en-US/docs/Web/CSS) [media feature](../media_queries/using_media_queries#media_features) can be used to apply styles based on the height of the [viewport](https://developer.mozilla.org/en-US/docs/Glossary/Viewport) (or the page box, for [paged media](https://developer.mozilla.org/en-US/docs/Web/CSS/Paged_Media)).
Syntax
------
The `height` feature is specified as a [`<length>`](../length) value representing the viewport height. It is a range feature, meaning that you can also use the prefixed `min-height` and `max-height` variants to query minimum and maximum values, respectively.
Examples
--------
### HTML
```
<div>Watch this element as you resize your viewport's height.</div>
```
### CSS
```
/\* Exact height \*/
@media (height: 360px) {
div {
color: red;
}
}
/\* Minimum height \*/
@media (min-height: 25rem) {
div {
background: yellow;
}
}
/\* Maximum height \*/
@media (max-height: 40rem) {
div {
border: 2px solid blue;
}
}
```
### Result
Specifications
--------------
| Specification |
| --- |
| [Media Queries Level 4 # height](https://w3c.github.io/csswg-drafts/mediaqueries/#height) |
Browser compatibility
---------------------
| | Desktop | Mobile |
| --- | --- | --- |
| | Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet |
| `height` | 1 | 12 | 2 | 9 | 10 | 3 | ≤37 | 18 | 4 | 10.1 | 1 | 1.0 |
See also
--------
* [Using Media Queries](../media_queries/using_media_queries)
* [@media](../@media)
css resolution resolution
==========
The `resolution` [CSS](https://developer.mozilla.org/en-US/docs/Web/CSS) [media feature](../media_queries/using_media_queries#media_features) can be used to test the pixel density of the output device.
Syntax
------
The `resolution` feature is specified as a [`<resolution>`](../resolution) value representing the pixel density of the output device. It is a range feature, meaning that you can also use the prefixed `min-resolution` and `max-resolution` variants to query minimum and maximum values, respectively.
Examples
--------
### HTML
```
<p>This is a test of your device's pixel density.</p>
```
### CSS
```
/\* Exact resolution \*/
@media (resolution: 150dpi) {
p {
color: red;
}
}
/\* Minimum resolution \*/
@media (min-resolution: 72dpi) {
p {
text-decoration: underline;
}
}
/\* Maximum resolution \*/
@media (max-resolution: 300dpi) {
p {
background: yellow;
}
}
```
### Result
Specifications
--------------
| Specification |
| --- |
| [Media Queries Level 4 # resolution](https://w3c.github.io/csswg-drafts/mediaqueries/#resolution) |
Browser compatibility
---------------------
| | Desktop | Mobile |
| --- | --- | --- |
| | Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet |
| `resolution` | 29 | 12 | 8
3.5
Supports [`<integer>`](https://developer.mozilla.org/docs/Web/CSS/integer) values only. | 9 | 16
10-15 | No
See [bug 78087](https://webkit.org/b/78087). | 4.4 | 29 | 8
4
Supports [`<integer>`](https://developer.mozilla.org/docs/Web/CSS/integer) values only. | 16
10.1-14 | No
See [bug 78087](https://webkit.org/b/78087). | 2.0 |
See also
--------
* [`window.devicePixelRatio`](https://developer.mozilla.org/en-US/docs/Web/API/Window/devicePixelRatio)
* The [`image-resolution`](../image-resolution) property
css device-width device-width
============
**Deprecated:** This feature is no longer recommended. Though some browsers might still support it, it may have already been removed from the relevant web standards, may be in the process of being dropped, or may only be kept for compatibility purposes. Avoid using it, and update existing code if possible; see the [compatibility table](#browser_compatibility) at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time.
**Note:** To query for the width of the viewport, developers should use the [`width`](width) media feature instead.
The `device-width` [CSS](https://developer.mozilla.org/en-US/docs/Web/CSS) [media feature](../media_queries/using_media_queries#media_features) can be used to test the width of an output device's rendering surface.
Syntax
------
The `device-width` feature is specified as a [`<length>`](../length) value. It is a range feature, meaning that you can also use the prefixed `min-device-width` and `max-device-width` variants to query minimum and maximum values, respectively.
Examples
--------
### Applying a special stylesheet for devices that are narrower than 800 pixels
```
<link
rel="stylesheet"
media="screen and (max-device-width: 799px)"
href="http://foo.bar.com/narrow-styles.css" />
```
Specifications
--------------
| Specification |
| --- |
| [Media Queries Level 4 # device-width](https://w3c.github.io/csswg-drafts/mediaqueries/#device-width) |
Browser compatibility
---------------------
| | Desktop | Mobile |
| --- | --- | --- |
| | Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet |
| `device-width` | 1 | 12 | 2 | 9 | 10 | 3 | ≤37 | 18 | 4 | 10.1 | 1 | 1.0 |
See also
--------
* [Using Media Queries](../media_queries/using_media_queries)
* [@media](../@media)
css overflow-inline overflow-inline
===============
The `overflow-inline` [CSS](https://developer.mozilla.org/en-US/docs/Web/CSS) [media feature](../media_queries/using_media_queries#media_features) can be used to test how the output device handles content that overflows the initial [containing block](../containing_block) along the inline axis.
Syntax
------
The `overflow-inline` feature is specified as a keyword value chosen from the list below.
`none` Content that overflows the inline axis is not displayed.
`scroll` Content that overflows the inline axis can be seen by scrolling to it.
Examples
--------
### HTML
```
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam ac turpis
eleifend, fringilla velit ac, aliquam tellus. Vestibulum ante ipsum primis in
faucibus orci luctus et ultrices posuere cubilia Curae; Nunc velit erat,
tempus id rutrum sed, dapibus ut urna. Integer vehicula nibh a justo imperdiet
rutrum. Nam faucibus pretium orci imperdiet sollicitudin. Nunc id facilisis
dui. Proin elementum et massa et feugiat. Integer rutrum ullamcorper eleifend.
Proin sit amet tincidunt risus. Sed nec augue congue eros accumsan tincidunt
sed eget ex.
</p>
```
### CSS
```
p {
white-space: nowrap;
}
@media (overflow-inline: scroll) {
p {
color: red;
}
}
```
### Result
Specifications
--------------
| Specification |
| --- |
| [Media Queries Level 4 # mf-overflow-inline](https://w3c.github.io/csswg-drafts/mediaqueries/#mf-overflow-inline) |
Browser compatibility
---------------------
| | Desktop | Mobile |
| --- | --- | --- |
| | Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet |
| `overflow-inline` | No | No | 66 | No | No | No | No | No | 66 | No | No | No |
css video-dynamic-range video-dynamic-range
===================
The `video-dynamic-range` [CSS](https://developer.mozilla.org/en-US/docs/Web/CSS) [media feature](../media_queries/using_media_queries#media_features) can be used to test the combination of brightness, contrast ratio, and color depth that are supported by the video plane of the [user agent](https://developer.mozilla.org/en-US/docs/Glossary/User_agent) and the output device.
Some user agents, including many TVs, render video and graphics in two separate planes (bi-plane) with distinct screen characteristics. The `video-dynamic-range` feature is used to test the characteristics in the video plane.
Syntax
------
The `video-dynamic-range` feature is specified as a keyword value chosen from the list below.
`standard` This value matches any visual device and excludes devices lacking visual capabilities. A user agent or an output device that matches `high` will also match the `standard` value.
`high` This value matches user agents and output devices that support high peak brightness, high contrast ratio, and color depth greater than 24 bit or 8 bit per color component of RGB. **Peak brightness** refers to how bright the brightest point a light-emitting device, such as an LCD screen, can produce. In the case of a light-reflective device, such as paper or e-ink, peak brightness refers to the point that at least absorbs light. **Contrast ratio** refers to the ratio of the luminance of the brightest color to that of the darkest color that the system is capable of producing. Currently, there is no precise way to measure peak brightness and contrast ratio, and the determination of what counts as high peak brightness and high contrast ratio depends on the user agent.
Specifications
--------------
| Specification |
| --- |
| [Media Queries Level 5 # video-dynamic-range](https://w3c.github.io/csswg-drafts/mediaqueries-5/#video-dynamic-range) |
Browser compatibility
---------------------
| | Desktop | Mobile |
| --- | --- | --- |
| | Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet |
| `video-dynamic-range` | 98 | 98 | 100 | No | 84 | 13.1 | 98 | 98 | 100 | 68 | 13.4 | 18.0 |
See also
--------
* [Using Media Queries](../media_queries/using_media_queries)
* [@media](../@media)
| programming_docs |
css update update
======
**Experimental:** **This is an [experimental technology](https://developer.mozilla.org/en-US/docs/MDN/Writing_guidelines/Experimental_deprecated_obsolete#experimental)**
Check the [Browser compatibility table](#browser_compatibility) carefully before using this in production.
The `update` [CSS](https://developer.mozilla.org/en-US/docs/Web/CSS) [media feature](../media_queries/using_media_queries#media_features) can be used to test how frequently (if at all) the output device is able to modify the appearance of content once rendered.
```
@media (update: < none | slow | fast >) {
/\* styles to apply if the update frequency of the output device is a match \*/
}
```
Syntax
------
The `update` feature is specified as a single keyword value chosen from the list below.
`none` Once it has been rendered, the layout can no longer be updated. Example: documents printed on paper.
`slow` The layout may change dynamically according to the usual rules of CSS, but the output device is not able to render or display changes quickly enough for them to be perceived as a smooth animation. Examples: e-book readers or severely underpowered devices.
`fast` The layout may change dynamically according to the usual rules of CSS, and the output device is not unusually constrained in speed, so regularly-updating things like [CSS Animations](../css_animations) can be used. Example: computer screens.
Examples
--------
### HTML
```
<p>If this text animates for you, your browser supports `update` and you are using a fast-updating device.</p>
```
### CSS
```
@keyframes jiggle {
from {
transform: translateY(0);
}
to {
transform: translateY(25px);
}
}
@media (update: fast) {
p {
animation: 1s jiggle linear alternate infinite;
}
}
```
### Result
Specifications
--------------
| Specification |
| --- |
| [Media Queries Level 4 # update](https://w3c.github.io/csswg-drafts/mediaqueries/#update) |
Browser compatibility
---------------------
| | Desktop | Mobile |
| --- | --- | --- |
| | Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet |
| `update-frequency` | No | No | 102 | No | No | No | No | No | 102 | No | No | No |
See also
--------
* [Using Media Queries](../media_queries/using_media_queries)
* [@media](../@media)
css monochrome monochrome
==========
The `monochrome` [CSS](https://developer.mozilla.org/en-US/docs/Web/CSS) [media feature](../media_queries/using_media_queries#media_features) can be used to test the number of bits per pixel in the monochrome frame buffer of the output device.
Syntax
------
The `monochrome` feature is specified as an [`<integer>`](../integer) representing the number of bits per pixel in the monochrome frame buffer. If the device is not a monochrome device, the value is zero. It is a range feature, meaning that you can also use the prefixed `min-monochrome` and `max-monochrome` variants to query minimum and maximum values, respectively.
Examples
--------
### HTML
```
<p class="mono">Your device supports monochrome pixels!</p>
<p class="no-mono">Your device doesn't support monochrome pixels.</p>
```
### CSS
```
p {
display: none;
}
/\* Any monochrome device \*/
@media (monochrome) {
p.mono {
display: block;
color: #333;
}
}
/\* Any non-monochrome device \*/
@media (monochrome: 0) {
p.no-mono {
display: block;
color: #ee3636;
}
}
```
### Result
Specifications
--------------
| Specification |
| --- |
| [Media Queries Level 4 # monochrome](https://w3c.github.io/csswg-drafts/mediaqueries/#monochrome) |
Browser compatibility
---------------------
| | Desktop | Mobile |
| --- | --- | --- |
| | Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet |
| `monochrome` | 1 | 79 | 2 | No | 10 | 3 | ≤37 | 18 | 4 | 10.1 | 1 | 1.0 |
css device-height device-height
=============
**Deprecated:** This feature is no longer recommended. Though some browsers might still support it, it may have already been removed from the relevant web standards, may be in the process of being dropped, or may only be kept for compatibility purposes. Avoid using it, and update existing code if possible; see the [compatibility table](#browser_compatibility) at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time.
**Note:** To query for the height of the viewport, developers should use the [`height`](height) media feature instead.
The `device-height` [CSS](https://developer.mozilla.org/en-US/docs/Web/CSS) [media feature](../media_queries/using_media_queries#media_features) can be used to test the height of an output device's rendering surface.
Syntax
------
The `device-height` feature is specified as a [`<length>`](../length) value. It is a range feature, meaning that you can also use the prefixed `min-device-height` and `max-device-height` variants to query minimum and maximum values, respectively.
Examples
--------
### Applying a special stylesheet for devices that are shorter than 800 pixels
```
<link
rel="stylesheet"
media="screen and (max-device-height: 799px)"
href="http://foo.bar.com/short-styles.css" />
```
Specifications
--------------
| Specification |
| --- |
| [Media Queries Level 4 # device-height](https://w3c.github.io/csswg-drafts/mediaqueries/#device-height) |
Browser compatibility
---------------------
| | Desktop | Mobile |
| --- | --- | --- |
| | Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet |
| `device-height` | 1 | 12 | 2 | 9 | 10 | 3 | ≤37 | 18 | 4 | 10.1 | 1 | 1.0 |
See also
--------
* [Using Media Queries](../media_queries/using_media_queries)
* [@media](../@media)
css -ms-high-contrast -ms-high-contrast
=================
**Non-standard:** This feature is non-standard and is not on a standards track. Do not use it on production sites facing the Web: it will not work for every user. There may also be large incompatibilities between implementations and the behavior may change in the future.
The **-ms-high-contrast** [CSS](https://developer.mozilla.org/en-US/docs/Web/CSS) [media feature](../media_queries/using_media_queries#media_features) is a [Microsoft extension](https://developer.mozilla.org/en-US/docs/Web/CSS/Microsoft_Extensions) that describes whether the application is being displayed in high contrast mode, and with what color variation.
High Contrast Mode is a specialized display mode that prioritizes making content as legible as possible by dynamically replacing foreground and background colors with a user-specified theme. For web content, theme colors are mapped to content types.
This media feature applies to bitmap media types. It does not accept *min/max* prefixes.
Syntax
------
The `-ms-high-contrast` media feature is specified as one of the following values.
### Values
`none` Deprecated
*No longer supported as of Microsoft Edge 18.*
`active` Indicates that the subsequent styling rules will be applied when the system is placed in high contrast mode with any color variation.
`black-on-white` Indicates that the subsequent styling rules will be applied when the system is placed in high contrast mode with a black-on-white color variation.
`white-on-black` Indicates that the subsequent styling rules will be applied when the system is placed in high contrast mode with a white-on-black color variation.
Examples
--------
### Matching any high-contrast variations
```
@media screen and (-ms-high-contrast: active) {
/\* All high contrast styling rules \*/
}
```
### Matching a black-on-white variation
```
@media screen and (-ms-high-contrast: black-on-white) {
div {
background-image: url("image-bw.png");
}
}
```
### Matching a white-on-black variation
```
@media screen and (-ms-high-contrast: white-on-black) {
div {
background-image: url("image-wb.png");
}
}
```
Accessibility concerns
----------------------
### Theming
High Contrast Mode's theme colors come from a limited subset of deprecated [CSS2 system colors](https://www.w3.org/TR/2018/REC-css-color-3-20180619/#css2-system). The available color keywords are:
* `windowText`: controls the color of text content.
* `linkText`: controls the color of the hyperlink text.
* `grayText`: controls the color of the disabled text.
* `highlightText`: controls the color of selected text.
* `highlight`: controls the background color of selected text.
* `buttonText`: controls the color of a [`<button>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button) element's text.
* `buttonFace`: controls the background color of a [`<button>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button) element.
* `window`: controls the color of the background.
Because High Contrast Mode themes are dynamic, use these color keywords in place of other [CSS color values](../color). This will ensure that content will always be able to be perceived.
### Content
If at all possible, prefer updating HTML markup over modifying content using CSS2 system color keywords. This helps keep the content more predictable.
Specifications
--------------
Not part of any standard.
Remarks
-------
As of Microsoft Edge 18, `-ms-high-contrast: none` is no longer supported. Microsoft Edge versions 18 and higher will be using the [`forced-colors` media feature](forced-colors) instead, but the `forced-colors` media feature specification is still being actively worked on.
The `-ms-high-contrast` media feature works with the `-ms-high-contrast-adjust` property.
See also
--------
* [Using Media Queries](../media_queries/using_media_queries)
* [@media](../@media)
css inverted-colors inverted-colors
===============
The `inverted-colors` [CSS](https://developer.mozilla.org/en-US/docs/Web/CSS) [media feature](../media_queries/using_media_queries#media_features) can be used to test whether the [user agent](https://developer.mozilla.org/en-US/docs/Glossary/User_agent) or underlying OS is inverting colors.
Syntax
------
The `inverted-colors` feature is specified as a keyword value chosen from the list below.
`none` Colors are displayed normally.
`inverted` All pixels within the displayed area have been inverted.
Examples
--------
### HTML
```
<p>
If you're using inverted colors, this text should be blue on white (the
inverse of yellow on black). If you're not, it should be red on light gray.
</p>
<p>
If the text is gray, your browser doesn't support the `inverted-colors` media
feature.
</p>
```
### CSS
```
p {
color: gray;
}
@media (inverted-colors: inverted) {
p {
background: black;
color: yellow;
}
}
@media (inverted-colors: none) {
p {
background: #eee;
color: red;
}
}
```
### Result
Specifications
--------------
| Specification |
| --- |
| [Media Queries Level 5 # inverted](https://w3c.github.io/csswg-drafts/mediaqueries-5/#inverted) |
Browser compatibility
---------------------
| | Desktop | Mobile |
| --- | --- | --- |
| | Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet |
| `inverted-colors` | No | No | No | No | No | 9.1 | No | No | No | No | 10 | No |
See also
--------
* [Using Media Queries](../media_queries/using_media_queries)
* [@media](../@media)
css dynamic-range dynamic-range
=============
The `dynamic-range` [CSS](https://developer.mozilla.org/en-US/docs/Web/CSS) [media feature](../media_queries/using_media_queries#media_features) can be used to test the combination of brightness, contrast ratio, and color depth that are supported by the [user agent](https://developer.mozilla.org/en-US/docs/Glossary/User_agent) and the output device.
**Note:** Some devices have high dynamic range capabilities that are not always 'on' and need to be activated (sometimes programmatically, sometimes by the user, sometimes based on the content). This media feature does not test whether the dynamic range capability is active; it only tests whether the device is capable of high dynamic range visuals.
Syntax
------
The `dynamic-range` feature is specified as a keyword value chosen from the list below.
`standard` This value matches any visual device and excludes devices lacking visual capabilities. A user agent or an output device that matches `high` will also match the `standard` value.
`high` This value matches user agents and output devices that support high peak brightness, high contrast ratio, and color depth greater than 24 bit or 8 bit per color component of RGB. **Peak brightness** refers to how bright the brightest point a light-emitting device, such as an LCD screen, can produce. In the case of a light-reflective device, such as paper or e-ink, peak brightness refers to the point that at least absorbs light. **Contrast ratio** refers to the ratio of the luminance of the brightest color to that of the darkest color that the system is capable of producing. Currently, there is no precise way to measure peak brightness and contrast ratio, and the determination of what counts as high peak brightness and high contrast ratio depends on the user agent.
Examples
--------
```
@media (dynamic-range: standard) {
p {
color: red;
}
}
@media (dynamic-range: high) {
p {
color: green;
}
}
```
Specifications
--------------
| Specification |
| --- |
| [Media Queries Level 5 # dynamic-range](https://w3c.github.io/csswg-drafts/mediaqueries-5/#dynamic-range) |
Browser compatibility
---------------------
| | Desktop | Mobile |
| --- | --- | --- |
| | Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet |
| `dynamic-range` | 98 | 98 | 100 | No | 84 | 13.1 | 98 | 98 | 100 | 68 | 13.4 | 18.0 |
See also
--------
* [Using Media Queries](../media_queries/using_media_queries)
* [@media](../@media)
css aspect-ratio aspect-ratio
============
The `aspect-ratio` [CSS](https://developer.mozilla.org/en-US/docs/Web/CSS) [media feature](../media_queries/using_media_queries#media_features) can be used to test the aspect ratio of the [viewport](https://developer.mozilla.org/en-US/docs/Glossary/Viewport).
Syntax
------
The `aspect-ratio` feature is specified as a [`<ratio>`](../ratio) value representing the width-to-height aspect ratio of the viewport. It is a range feature, meaning you can also use the prefixed `min-aspect-ratio` and `max-aspect-ratio` variants to query minimum and maximum values, respectively.
Examples
--------
The example below is contained in an [`<iframe>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe), which creates its own viewport. Resize the `<iframe>` to see `aspect-ratio` in action.
Note that, when none of the media query conditions are true, the background will turn white because none of the below rules will be applied to the `<div>` inside the `<iframe>`. See if you can find which width and height values trigger this!
### HTML
```
<div id="inner">
Watch this element as you resize your viewport's width and height.
</div>
```
### CSS
```
/\* Minimum aspect ratio \*/
@media (min-aspect-ratio: 8/5) {
div {
background: #9af; /\* blue \*/
}
}
/\* Maximum aspect ratio \*/
@media (max-aspect-ratio: 3/2) {
div {
background: #9ff; /\* cyan \*/
}
}
/\* Exact aspect ratio, put it at the bottom to avoid override\*/
@media (aspect-ratio: 1/1) {
div {
background: #f9a; /\* red \*/
}
}
```
### Result
Specifications
--------------
| Specification |
| --- |
| [Media Queries Level 4 # aspect-ratio](https://w3c.github.io/csswg-drafts/mediaqueries/#aspect-ratio) |
Browser compatibility
---------------------
| | Desktop | Mobile |
| --- | --- | --- |
| | Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet |
| `aspect-ratio` | 3 | 12 | 3.5 | 9 | 10 | 5 | ≤37 | 18 | 4 | 10.1 | 4.2 | 1.0 |
See also
--------
* [Using Media Queries](../media_queries/using_media_queries)
* [@media](../@media)
css overflow-block overflow-block
==============
The `overflow-block` [CSS](https://developer.mozilla.org/en-US/docs/Web/CSS) [media feature](../media_queries/using_media_queries#media_features) can be used to test how the output device handles content that overflows the initial [containing block](../containing_block) along the block axis.
Syntax
------
The `overflow-block` feature is specified as a keyword value chosen from the list below.
`none` Content that overflows the block axis is not displayed.
`scroll` Content that overflows the block axis can be seen by scrolling to it.
`optional-paged` Content that overflows the block axis can be seen by scrolling to it, but page breaks can be manually triggered (such as via [`break-inside`](../break-inside), etc.) to cause the following content to display on the following page.
`paged` Content is broken up into discrete pages; content that overflows one page in the block axis is displayed on the following page.
Examples
--------
### HTML
```
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam ac turpis
eleifend, fringilla velit ac, aliquam tellus. Vestibulum ante ipsum primis in
faucibus orci luctus et ultrices posuere cubilia Curae; Nunc velit erat,
tempus id rutrum sed, dapibus ut urna. Integer vehicula nibh a justo imperdiet
rutrum. Nam faucibus pretium orci imperdiet sollicitudin. Nunc id facilisis
dui. Proin elementum et massa et feugiat. Integer rutrum ullamcorper eleifend.
Proin sit amet tincidunt risus. Sed nec augue congue eros accumsan tincidunt
sed eget ex.
</p>
```
### CSS
```
@media (overflow-block: scroll) {
p {
color: red;
}
}
```
### Result
Specifications
--------------
| Specification |
| --- |
| [Media Queries Level 4 # mf-overflow-block](https://w3c.github.io/csswg-drafts/mediaqueries/#mf-overflow-block) |
Browser compatibility
---------------------
| | Desktop | Mobile |
| --- | --- | --- |
| | Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet |
| `overflow-block` | No | No | 66 | No | No | No | No | No | 66 | No | No | No |
See also
--------
* [Using Media Queries](../media_queries/using_media_queries)
* [@media](../@media)
css color color
=====
The `color` [CSS](https://developer.mozilla.org/en-US/docs/Web/CSS) [media feature](../media_queries/using_media_queries#media_features) can be used to test the number of bits per color component (red, green, blue) of the output device.
Syntax
------
The `color` feature is specified as an [`<integer>`](../integer) value that represents the number of bits per color component (red, green, blue) of the output device. If the device is not a color device, the value is zero. It is a range feature, meaning that you can also use the prefixed `min-color` and `max-color` variants to query minimum and maximum values, respectively.
**Note:** If the various color components are represented by different numbers of bits, the smallest number is used. For example, if a display uses 5 bits for blue and red and 6 bits for green, then the device is considered to use 5 bits per color component. If the device uses indexed colors, the minimum number of bits per color component in the color table is used.
See [Applying color to HTML elements using CSS](../css_colors/applying_color) to learn more about using CSS to apply color to HTML.
Examples
--------
### HTML
```
<p>
This text should be black on non-color devices, red on devices with a low
number of colors, and greenish on devices with a high number of colors.
</p>
```
### CSS
```
p {
color: black;
}
/\* Any color device \*/
@media (color) {
p {
color: red;
}
}
/\* Any color device with at least 8 bits per color component \*/
@media (min-color: 8) {
p {
color: #24ba13;
}
}
```
### Result
Specifications
--------------
| Specification |
| --- |
| [Media Queries Level 4 # color](https://w3c.github.io/csswg-drafts/mediaqueries/#color) |
Browser compatibility
---------------------
| | Desktop | Mobile |
| --- | --- | --- |
| | Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet |
| `color` | 1 | 12 | 2 | 9 | 10 | 3 | ≤37 | 18 | 4 | 10.1 | 1 | 1.0 |
See also
--------
* [Applying color to HTML elements using CSS](../css_colors/applying_color)
* The CSS [`color`](../color) property
* The CSS [`<color>`](../color_value) data unit
| programming_docs |
css scripting scripting
=========
The `scripting` [CSS](https://developer.mozilla.org/en-US/docs/Web/CSS) [media feature](../media_queries/using_media_queries#media_features) can be used to test whether scripting (such as JavaScript) is available.
Syntax
------
The `scripting` feature is specified as a keyword value chosen from the list below.
`none` Scripting is completely unavailable on the current document.
`initial-only` Scripting is enabled during the initial page load, but not afterwards.
`enabled` Scripting is supported and active on the current document.
Examples
--------
### HTML
```
<p class="script-none">You do not have scripting available. :-(</p>
<p class="script-initial-only">
Your scripting is only enabled during the initial page load. Weird.
</p>
<p class="script-enabled">You have scripting enabled! :-)</p>
```
### CSS
```
p {
color: lightgray;
}
@media (scripting: none) {
.script-none {
color: red;
}
}
@media (scripting: initial-only) {
.script-initial-only {
color: red;
}
}
@media (scripting: enabled) {
.script-enabled {
color: red;
}
}
```
### Result
Specifications
--------------
| Specification |
| --- |
| [Media Queries Level 5 # scripting](https://w3c.github.io/csswg-drafts/mediaqueries-5/#scripting) |
Browser compatibility
---------------------
| | Desktop | Mobile |
| --- | --- | --- |
| | Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet |
| `scripting` | No
See [bug 489957](https://crbug.com/489957). | No
See [bug 489957](https://crbug.com/489957). | No
See [bug 1166581](https://bugzil.la/1166581). | No | No | No | No
See [bug 489957](https://crbug.com/489957). | No
See [bug 489957](https://crbug.com/489957). | No
See [bug 1166581](https://bugzil.la/1166581). | No | No | No
See [bug 489957](https://crbug.com/489957). |
See also
--------
* [Using Media Queries](../media_queries/using_media_queries)
* [@media](../@media)
css width width
=====
The `width` [CSS](https://developer.mozilla.org/en-US/docs/Web/CSS) [media feature](../media_queries/using_media_queries#media_features) can be used to test the width of the [viewport](https://developer.mozilla.org/en-US/docs/Glossary/Viewport) (or the page box, for [paged media](https://developer.mozilla.org/en-US/docs/Web/CSS/Paged_Media)).
Syntax
------
The `width` feature is specified as a [`<length>`](../length) value representing the viewport width. It is a range feature, meaning that you can also use the prefixed `min-width` and `max-width` variants to query minimum and maximum values, respectively.
Examples
--------
### HTML
```
<div>Watch this element as you resize your viewport's width.</div>
```
### CSS
```
/\* Exact width \*/
@media (width: 360px) {
div {
color: red;
}
}
/\* Minimum width \*/
@media (min-width: 35rem) {
div {
background: yellow;
}
}
/\* Maximum width \*/
@media (max-width: 50rem) {
div {
border: 2px solid blue;
}
}
```
### Result
Specifications
--------------
| Specification |
| --- |
| [Media Queries Level 4 # width](https://w3c.github.io/csswg-drafts/mediaqueries/#width) |
Browser compatibility
---------------------
| | Desktop | Mobile |
| --- | --- | --- |
| | Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet |
| `width` | 1 | 12 | 2 | 9 | 10 | 3 | ≤37 | 18 | 4 | 10.1 | 1 | 1.0 |
See also
--------
* [Using Media Queries](../media_queries/using_media_queries)
* [@media](../@media)
css any-pointer any-pointer
===========
The `any-pointer` [CSS](https://developer.mozilla.org/en-US/docs/Web/CSS) [media feature](../media_queries/using_media_queries#media_features) tests whether the user has *any* pointing device (such as a mouse), and if so, how accurate it is.
**Note:** If you want to test the accuracy of the *primary* pointing device, use [`pointer`](pointer) instead.
Syntax
------
The `any-pointer` feature is specified as a keyword value chosen from the list below.
`none` No pointing device is available.
`coarse` At least one input mechanism includes a pointing device of limited accuracy.
`fine` At least one input mechanism includes an accurate pointing device.
**Note:** More than one value can match if the available devices have different characteristics, although `none` only matches when none of them are pointing devices.
Examples
--------
This example creates a small checkbox for users with at least one fine pointer and a large checkbox for users with at least one coarse pointer. The big checkbox takes precedence because it is declared after the small one.
### HTML
```
<input id="test" type="checkbox" /> <label for="test">Look at me!</label>
```
### CSS
```
input[type="checkbox"]:checked {
background: gray;
}
@media (any-pointer: fine) {
input[type="checkbox"] {
appearance: none;
width: 15px;
height: 15px;
border: 1px solid blue;
}
}
@media (any-pointer: coarse) {
input[type="checkbox"] {
appearance: none;
width: 30px;
height: 30px;
border: 2px solid red;
}
}
```
### Result
Specifications
--------------
| Specification |
| --- |
| [Media Queries Level 4 # any-input](https://w3c.github.io/csswg-drafts/mediaqueries/#any-input) |
Browser compatibility
---------------------
| | Desktop | Mobile |
| --- | --- | --- |
| | Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet |
| `any-pointer` | 41 | 12 | 64 | No | 28 | 9 | 41 | 41 | 64 | 28 | 9 | 4.0 |
See also
--------
* [The `pointer` media feature](pointer)
css Handling content breaks in multi-column layout Handling content breaks in multi-column layout
==============================================
Content is broken between column boxes in multi-column layout in the same way that it is broken between pages in paged media. In both contexts, we control where and how things break by using properties of the CSS Fragmentation specification. In this guide, we see how fragmentation works in a *multi-column container* or *multicol container* for short.
Fragmentation basics
--------------------
The [CSS Fragmentation specification](https://www.w3.org/TR/css-break-3/) details how content breaks between the fragmentation containers or *fragmentainers*. In multicol, the fragmentainer is the column box.
A column box can contain other markup and there are many places where a break would not be ideal. For example, we would generally prefer that the figcaption of an image not be separated into a new column away from the image it refers to and ending a column with a heading looks strange. The fragmentation properties give us ways to exercise some control over this.
There are various places we might want to control our breaks:
* Breaks inside boxes, for example inside a figure element.
* Breaks before and after boxes, which would include our heading example above.
* Breaks between lines.
Breaks inside boxes
-------------------
To control breaks inside boxes use the [`break-inside`](../break-inside) property. This property takes values of:
* `auto`
* `avoid`
* `avoid-page`
* `avoid-column`
* `avoid-region`
In the example below, we have applied break-inside to the figure element to prevent the caption from becoming separated from the image.
Breaks before and after boxes
-----------------------------
The [`break-before`](../break-before) and [`break-after`](../break-after) properties are used to control breaks before and after elements. They take the following values when in a multicol context:
* auto
* avoid
* avoid-column
* column
In this next example, we are forcing a column break before an `h2` element.
Breaks between lines
--------------------
The [`orphans`](../orphans) and [`widows`](../widows) properties are also useful. The orphans property controls the number of lines left on their own at the end of a fragment. The widows property controls the number left on their own at the start of a fragment.
The `orphans` and `widows` properties take an integer as a value, which represents the number of lines to keep together at the end and start of a fragment, respectively. Note that these properties only work inside a block container, such as a paragraph. If the block has fewer lines in it than the number that you specify as a value, all lines will be kept together.
In the example below, we are using the `orphans` property to control the number of lines left at the bottom of a column. You can change that value to see the effect on the breaking of the content.
When things don't work as expected
----------------------------------
If you have small amounts of content and are trying to control breaks in a number of ways or on several elements, your content needs to break somewhere, so you may not always get the result you intended. To some extent your use of fragmentation is always a suggestion to the browser, to control breaks in this way if it is possible.
In addition to the above, browser support for these properties is a little patchy. The compatibility data charts on the individual property pages here on MDN can help you see which browsers support which features. In most cases, the fallback to breaks not being controlled is something you can live with, with suboptimal breaking being untidy rather than a disaster to your layout.
css Basic concepts of multi-column layout Basic concepts of multi-column layout
=====================================
Multiple-column layout, usually referred to as multicol, is a specification for laying out content into a set of column boxes much like columns in a newspaper. This guide explains how the specification works with some common use case examples.
Key concepts and terminology
----------------------------
Multicol is unlike any of the other layout methods we have in CSS; it fragments the content, including all descendant elements, into columns. This happens in the same way that content is fragmented into pages when we work with [CSS Paged Media](../css_pages) by creating a print stylesheet.
The properties defined by the specification are:
* [`column-width`](../column-width)
* [`column-count`](../column-count)
* [`columns`](../columns)
* [`column-rule-color`](../column-rule-color)
* [`column-rule-style`](../column-rule-style)
* [`column-rule-width`](../column-rule-width)
* [`column-rule`](../column-rule)
* [`column-span`](../column-span)
* [`column-fill`](../column-fill)
* [`column-gap`](../column-gap)
By adding `column-count` or `column-width` to an element, the element becomes a *multi-column container* or *multicol container* for short. The columns are anonymous boxes and described as column boxes in the specification.
Defining columns
----------------
To create a multicol container, you must use at least one of the `column-*` properties, these being `column-count` and `column-width`.
### Specifying the number of columns
The `column-count` property specifies the number of columns that you would like the content to be displayed as. The browser will then assign the correct amount of space to each column box to create the requested number of columns.
In the below example, we use the `column-count` property to create three columns on the `.container` element. The content, including the children of `.container`, is then split between the three columns.
In the above example, the content is wrapped in paragraph `p` tags with default styling. Therefore, there is a margin above each paragraph. You can see how this margin causes the first line of text to be pushed down. This is because a multicol container creates a new Block Formatting Context (BFC) which means margins on child elements do not collapse with any margin on the container.
### Specifying the width of columns
The `column-width` property is used to set the optimal width for every column box. If you declare a column-width, the browser will work out how many columns of that width will fit into the multicol container and distribute any extra space equally between the columns. Therefore, the column width should be seen as a minimum width, as column boxes are likely to be wider due to the additional space.
The column box will only shrink to be smaller than the declared column width in the case of a single column with less available width than the value of `column-width`.
In the below example, we use the `column-width` property with a value of 200px. We get as many 200 pixel columns as will fit the container, with the extra space shared equally.
### Specifying both number and width of columns
If you specify both the properties on a multicol container, then `column-count` will act as a maximum number of columns. Therefore, the behavior as described for `column-width` will happen, until the number of columns in `column-count` is reached. After this point, no more columns will be drawn, and the extra space is distributed evenly between the existing columns, even if there is enough room for more columns of the specified `column-width` size.
When using both properties together, you may get fewer columns than specified in the value for `column-count`.
In this next example, we use `column-width` of 200px and `column-count` of 2. Even if there is space for more than two columns, we get two. If there is not enough space for two columns of 200px, however, we get one.
### Shorthand for column properties
You can use the `columns` shorthand to set `column-count` and `column-width`. If you set a length unit, this will be used for `column-width`, set an integer and it will be used for `column-count`. You can set both, separating the two values with a space.
This CSS would give the same result as example 1, `column-count` set to 3.
```
.container {
columns: 3;
}
```
This CSS would give the same result as example 2, with `column-width` of 200px.
```
.container {
columns: 200px;
}
```
This CSS would give the same result as example 3, with both `column-count` and `column-width` set.
```
.container {
columns: 2 200px;
}
```
Next steps
----------
In this guide, we've learned the basic use of multi-column layout. In the next guide, we will look at how much we can [style the columns themselves](styling_columns).
css Handling overflow in multi-column layout Handling overflow in multi-column layout
========================================
In this guide, we look at how to deal with overflow in a multi-column (*multicol*) layout, both inside the column boxes and in situations where there is more content than will fit into the container.
Overflow inside column boxes
----------------------------
An overflow situation happens when an item's size is larger than the column box. For example, the situation could happen when an image in a column is wider than the `column-width` value or the width of the column based on the number of columns declared with `column-count`.
In this situation, the content should visibly overflow into the next column, rather than be clipped by the column box. You can see an example of this below, with an image of the expected rendering as, at the time of writing, browsers deal with this differently.
If you want an image to size down to fit the column box, the standard responsive images solution of setting `max-width: 100%` will achieve that for you.
More columns than will fit
--------------------------
How overflowing columns are handled depends on whether the media context is fragmented, such as print, or is continuous, such as a web page.
In fragmented media, after a fragment (for example, a page) is filled with columns, the columns will move to a new page and fill that up with columns. In continuous media, columns will overflow in the inline direction. On the web this means that you will get a horizontal scrollbar.
The example below shows this overflow behavior. The multicol container has a height and there is more text than space to create columns; therefore, we get columns created outside of the container.
In a future version of the specification, it would be useful to be able to have overflow columns in continuous media display in the block direction, therefore allowing the reader to scroll down to view the next set of columns.
Using vertical media queries
----------------------------
One issue with multicol on the web is that, if your columns are taller than the viewport, the reader will need to scroll up and down to read, which is not good user experience. One way to avoid this is to only apply the column properties if you know you have enough height.
In the example below, we have used a `min-height` query to check the height before applying the column properties.
Next steps
----------
In the final guide in this series, we will see [how multicol works with the Fragmentation spec](handling_content_breaks_in_multicol) to give us control over how content breaks between columns.
css Styling columns Styling columns
===============
As column boxes created inside multi-column (*multicol*) containers are anonymous boxes, there is little we can do to style them. However, we do have a few things that we can do. This guide explains how to change the gap and style rules between columns.
Styling column boxes
--------------------
Sadly, column boxes cannot be styled at present. The anonymous boxes that make up your columns can't be targeted in any way, meaning it isn't possible to change a box's background color or have one column larger than the others. Perhaps in future versions of the specification it might be. For now, however, we are able to change the spacing and add lines between columns.
Column gaps
-----------
The gap between columns is controlled using the `column-gap` property. This property was originally defined in the Multi-column Layout specification. However, it is now defined in [Box Alignment](../css_box_alignment) in order to unify gaps between boxes in other specifications such as [CSS Grid Layout](../css_grid_layout/box_alignment_in_css_grid_layout).
The initial value of `column-gap` in multicol is `1em`. This means your columns will not run into each other. In other layout methods, the initial value for `column-gap` is 0. If you use the keyword value "normal", the gap will be set to 1em.
You can change the gap by using any length unit as the value of `column-gap`. In the example below, the `column-gap` is set to 40px.
The allowed value for `column-gap` is a `<length-percentage>`, this means percentages are allowed. Percentage values for `column-gap` are calculated as a percentage of the width of the multicol container.
Column rules
------------
The specification defines `column-rule-width`, `column-rule-style` and `column-rule-color`, providing a shorthand `column-rule`. These properties work in exactly the same way as the `border` properties: any valid `border-style` can be used as a `column-rule-style`.
These properties are applied to the element which is the multicol container and therefore all columns will have the same rule. Rules are only drawn between columns and not on the outer edges. Rules should also only be drawn between columns which have content.
In this next example, a 5px-dotted rule with a color of `rebeccapurple` has been created using the longhand values.
Note that the rule itself does not take up any space: a wide rule will not push the columns apart to make space for the rule. Instead, the rule overlays the gap.
The example below uses a very wide rule of 40px and a 10px gap. The rule displays under the content of the columns. To make space on both sides of the rule, the gap would need to be increased to be larger than 40px.
Next steps
----------
This article details all the current ways in which column boxes can be styled. In the next guide, we will take a look at making elements inside a container [span across all columns](spanning_columns).
| programming_docs |
css Spanning and balancing columns Spanning and balancing columns
==============================
In this guide, we look at how to make elements span across columns inside the multi-column (*multicol*) container and how to control how the columns are filled.
**Note:** The spanning and balancing functionality covered in this guide is not as well supported across browsers as the functionality covered in the previous two sections in this guide.
Spanning the columns
--------------------
To cause an item to span across columns use the property [`column-span`](../column-span) with a value of `all`. This will cause the element to span all of the columns.
Any descendant element of the multicol container may become a *spanner* including both direct and indirect children. For example, a heading nested directly inside the container could become a spanner, as could a heading nested inside a section nested inside the multicol container.
In the example below, the h2 element is set to `column-span: all` and spans all of the columns.
In this second example, the heading is inside an [`<article>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/article) element, yet still spans the content as expected.
When a spanner is introduced, it breaks the flow of columns and columns restart after the spanner, effectively creating a new set of column boxes. The content does not jump over a spanning element.
### Limitations of column-span
In the current level 1 specification, there are only two allowable values for `column-span`. The value `none` is the initial value and means that the item does not span and remains within a column. The value `all` means that the item spans all of the columns. This means that, for example, you cannot cause an item to span two out of three columns.
### Things to watch out for
If the spanning element is inside another element which has margins, padding and a border or a background color, it is possible to end up with the top of the box appearing above the spanner and the rest displaying below, as shown in the next example. For this reason, some care should be taken when deciding to make an element a spanner and ensure this scenario is accounted for.
Additionally, if a spanning element appears later in the content it can cause unexpected or unwanted behavior when there is not enough content to create columns after the spanner. Use spanning carefully and test at various breakpoints to make sure you get the intended effect.
Filling and balancing columns
-----------------------------
A balanced set of columns is where all columns have approximately the same amount of content. Filling and balancing comes into play when the amount of content does not match the amount of space provided, such as when a height is declared on the container.
The initial value of multicol for [`column-fill`](../column-fill) is `balance`. The value of balance means all columns are as balanced as is possible. In fragmented contexts such as [Paged Media](../css_pages), only the last fragment is balanced. This means that on the last page the final set of column boxes will be balanced.
There is a second value for balancing, `balance-all`, which attempts to balance all columns in fragmented contexts and not just the columns on the final fragment.
In this example, we have columns containing an image and some text which are balanced. The image cannot break and so goes into the first column and the other columns fill with equal amounts of text.
The other value for `column-fill` is `auto`. In this case, rather than filling all the columns equally so their heights are balanced, the columns are filled sequentially. In the example below we have changed `column-fill` to `auto` and the columns are now filled, in order, to the height of the multicol container, leaving some columns empty at the end.
Note that column balancing is not supported by all browsers. Check that you are getting the sort of effect that you expect in the browsers you support.
Next steps
----------
In the next guide, you will learn [how multicol handles overflow](handling_overflow_in_multicol), both within columns and where there are more columns than will fit the container.
css polygon() polygon()
=========
The `polygon()` [CSS](https://developer.mozilla.org/en-US/docs/Web/CSS) function is one of the [`<basic-shape>`](../basic-shape) [data types](../css_types).
Try it
------
Syntax
------
```
clip-path: polygon(50% 2.4%, 34.5% 33.8%, 0% 38.8%, 25% 63.1%, 19.1% 97.6%);
```
### Values
`<fill-rule>` An optional value of `nonzero` (the default when omitted) or `evenodd`, which specifies the [filling rule](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/fill-rule).
`[<length-percentage><length-percentage>]#` Three or more pairs of values (a polygon must at least draw a triangle). These values are co-ordinates drawn with reference to the reference box.
Examples
--------
### Basic polygon() example
In this example a shape is created for text to follow using the `polygon()`, you can change any of the values to see how the shape is changed.
Specifications
--------------
| Specification |
| --- |
| [CSS Shapes Module Level 1 # funcdef-basic-shape-polygon](https://w3c.github.io/csswg-drafts/css-shapes/#funcdef-basic-shape-polygon) |
Browser compatibility
---------------------
| | Desktop | Mobile |
| --- | --- | --- |
| | Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet |
| `polygon` | 37 | 79 | 54 | No | 24 | 10.1 | 37 | 37 | 54 | 24 | 10.3 | 3.0 |
See also
--------
* Properties that use this data type: [`clip-path`](../clip-path), [`shape-outside`](../shape-outside)
* [Guide to Basic Shapes](../css_shapes/basic_shapes)
css ellipse() ellipse()
=========
The `ellipse()` [CSS](https://developer.mozilla.org/en-US/docs/Web/CSS) function is one of the [`<basic-shape>`](../basic-shape) [data types](../css_types).
Try it
------
Syntax
------
```
shape-outside: ellipse(40% 50% at left);
shape-outside: ellipse(closest-side farthest-side at 30%);
```
An ellipse is essentially a squashed circle and so `ellipse()` acts in a very similar way to [`circle()`](circle) except that we have to specify two radii x and y.
### Values
`<shape-radius>` Two radii, x and y in that order. These may be a [`<length>`](../length), or a [`<percentage>`](../percentage) or values `closest-side` and `farthest-side`.
`closest-side` Uses the length from the center of the shape to the closest side of the reference box. For ellipses, this is the closest side in the radius dimension.
`farthest-side` Uses the length from the center of the shape to the farthest side of the reference box. For ellipses, this is the farthest side in the radius dimension.
`<position>` Moves the center of the ellipse. May be a [`<length>`](../length), or a [`<percentage>`](../percentage), or a values such as `left`.
Examples
--------
### Basic ellipse() example
This example shows an ellipse with an x radius of 40%, a y radius of 50% and the position being left. This means that the center of the ellipse is on the left edge of the box giving us a half ellipse shape to wrap our text around. You can change these values to see how the ellipse changes.
### Using closest-side / farthest-side values
The keyword values of `closest-side` and `farthest-side` are useful to create a quick ellipse based on the size of the floated element reference box.
Specifications
--------------
| Specification |
| --- |
| [CSS Shapes Module Level 1 # funcdef-basic-shape-ellipse](https://w3c.github.io/csswg-drafts/css-shapes/#funcdef-basic-shape-ellipse) |
Browser compatibility
---------------------
| | Desktop | Mobile |
| --- | --- | --- |
| | Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet |
| `ellipse` | 37 | 79 | 54 | No | 24 | 10.1 | 37 | 37 | 54 | 24 | 10.3 | 3.0 |
See also
--------
* Properties that use this data type: [`clip-path`](../clip-path), [`shape-outside`](../shape-outside)
* [Guide to Basic Shapes](../css_shapes/basic_shapes)
css inset() inset()
=======
The `inset()` [CSS](https://developer.mozilla.org/en-US/docs/Web/CSS) function is one of the [`<basic-shape>`](../basic-shape) [data types](../css_types). It defines an inset rectangle.
Try it
------
Syntax
------
```
shape-outside: inset(20px 50px 10px 0 round 50px);
```
### Values
`<length-percentage>{1,4}` When all of the four arguments are supplied they represent the top, right, bottom and left offsets from the reference box inward that define the positions of the edges of the inset rectangle. These arguments follow the syntax of the margin shorthand, that let you set all four insets with one, two or four values.
`<border-radius>` The optional [`<border-radius>`](../border-radius) argument(s) define rounded corners for the inset rectangle using the border-radius shorthand syntax.
Examples
--------
### Basic inset example
In the example below we have an `inset()` shape used to pull content over the floated element. Change the offset values to see how the shape changes.
Specifications
--------------
| Specification |
| --- |
| [CSS Shapes Module Level 1 # funcdef-basic-shape-inset](https://w3c.github.io/csswg-drafts/css-shapes/#funcdef-basic-shape-inset) |
Browser compatibility
---------------------
| | Desktop | Mobile |
| --- | --- | --- |
| | Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet |
| `inset` | 37 | 79 | 54 | No | 24 | 10.1 | 37 | 37 | 54 | 24 | 10.3 | 3.0 |
See also
--------
* Properties that use this data type: [`clip-path`](../clip-path), [`shape-outside`](../shape-outside)
* [Guide to Basic Shapes](../css_shapes/basic_shapes)
css circle() circle()
========
The `circle()` [CSS](https://developer.mozilla.org/en-US/docs/Web/CSS) function is one of the [`<basic-shape>`](../basic-shape) [data types](../css_types).
Try it
------
Syntax
------
```
shape-outside: circle(50%);
clip-path: circle(6rem at 12rem 8rem);
```
### Values
`<shape-radius>` This may be a [`<length>`](../length), or a [`<percentage>`](../percentage) or values `closest-side` and `farthest-side`.
`closest-side` Uses the length from the center of the shape to the closest side of the reference box. For circles, this is the closest side in any dimension.
`farthest-side` Uses the length from the center of the shape to the farthest side of the reference box. For circles, this is the closest side in any dimension.
`<position>` Moves the center of the circle. May be a [`<length>`](../length), or a [`<percentage>`](../percentage), or a values such as `left`.
Examples
--------
### Basic circle
In the example below, the [`shape-outside`](../shape-outside) property has a value of `circle(50%)`, which defines a circle on a floated element for the text to flow round.
Specifications
--------------
| Specification |
| --- |
| [CSS Shapes Module Level 1 # funcdef-basic-shape-circle](https://w3c.github.io/csswg-drafts/css-shapes/#funcdef-basic-shape-circle) |
Browser compatibility
---------------------
| | Desktop | Mobile |
| --- | --- | --- |
| | Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet |
| `circle` | 37 | 79 | 54 | No | 24 | 10.1 | 37 | 37 | 54 | 24 | 10.3 | 3.0 |
See also
--------
* Properties that use this data type: [`clip-path`](../clip-path), [`shape-outside`](../shape-outside)
* [Guide to Basic Shapes](../css_shapes/basic_shapes)
css unicode-range unicode-range
=============
The `unicode-range` CSS descriptor sets the specific range of characters to be used from a font defined by [`@font-face`](../@font-face) and made available for use on the current page. If the page doesn't use any character in this range, the font is not downloaded; if it uses at least one, the whole font is downloaded.
Syntax
------
```
/\* <unicode-range> values \*/
unicode-range: U+26; /\* single codepoint \*/
unicode-range: U+0-7F;
unicode-range: U+0025-00FF; /\* codepoint range \*/
unicode-range: U+4??; /\* wildcard range \*/
unicode-range: U+0025-00FF, U+4??; /\* multiple values \*/
```
### Values
***single codepoint*** A single Unicode character code point, for example `U+26`.
***codepoint range*** A range of Unicode code points. So for example, `U+0025-00FF` means *include all characters in the range `U+0025` to `U+00FF`*.
***wildcard range*** A range of Unicode code points containing wildcard characters, that is using the `'?'` character, so for example `U+4??` means *include all characters in the range `U+400` to `U+4FF`*.
Description
-----------
The purpose of this descriptor is to allow the font resources to be segmented so that a browser only needs to download the font resource needed for the text content of a particular page. For example, a site with many localizations could provide separate font resources for English, Greek and Japanese. For users viewing the English version of a page, the font resources for Greek and Japanese fonts wouldn't need to be downloaded, saving bandwidth.
Formal definition
-----------------
| | |
| --- | --- |
| Related [at-rule](../at-rule) | [`@font-face`](../@font-face) |
| [Initial value](../initial_value) | `U+0-10FFFF` |
| [Computed value](../computed_value) | as specified |
Formal syntax
-------------
```
unicode-range =
<urange>[#](../value_definition_syntax#hash_mark)
<urange> =
u '+' [<ident-token>](../ident-token) '?'[\*](../value_definition_syntax#asterisk) [|](../value_definition_syntax#single_bar)
u [<dimension-token>](../dimension-token) '?'[\*](../value_definition_syntax#asterisk) [|](../value_definition_syntax#single_bar)
u [<number-token>](../number-token) '?'[\*](../value_definition_syntax#asterisk) [|](../value_definition_syntax#single_bar)
u [<number-token>](../number-token) [<dimension-token>](../dimension-token) [|](../value_definition_syntax#single_bar)
u [<number-token>](../number-token) [<number-token>](../number-token) [|](../value_definition_syntax#single_bar)
u '+' '?'[+](../value_definition_syntax#plus)
```
Examples
--------
### Using a different font for a single character
In this example we create a simple HTML containing a single [`<div>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/div) element, including an ampersand, that we want to style with a different font. To make it obvious, we will use a sans-serif font, *Helvetica*, for the text, and a serif font, *Times New Roman*, for the ampersand.
In the CSS we are in effect defining a completely separate [`@font-face`](../@font-face) that only includes a single character in it, meaning that only this character will be styled with this font. We could also have done this by wrapping the ampersand in a [`<span>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/span) and applying a different font just to that, but that is an extra element and rule set.
#### HTML
```
<div>Me & You = Us</div>
```
#### CSS
```
@font-face {
font-family: "Ampersand";
src: local("Times New Roman");
unicode-range: U+26;
}
div {
font-size: 4em;
font-family: Ampersand, Helvetica, sans-serif;
}
```
#### Result
Specifications
--------------
| Specification |
| --- |
| [CSS Fonts Module Level 4 # unicode-range-desc](https://w3c.github.io/csswg-drafts/css-fonts/#unicode-range-desc) |
Browser compatibility
---------------------
| | Desktop | Mobile |
| --- | --- | --- |
| | Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet |
| `unicode-range` | 1 | 12 | 36 | 9 | 15 | 3.1 | ≤37 | 18 | 36 | 14 | 3 | 1.0 |
See also
--------
* [`font-display`](font-display)
* [`font-family`](font-family)
* [`font-stretch`](font-stretch)
* [`font-style`](font-style)
* [`font-weight`](font-weight)
* [`font-feature-settings`](../font-feature-settings)
* [`font-variation-settings`](font-variation-settings)
* [`src`](src)
css font-display font-display
============
The `font-display` descriptor determines how a font face is displayed based on whether and when it is downloaded and ready to use.
Syntax
------
```
/\* Keyword values \*/
font-display: auto;
font-display: block;
font-display: swap;
font-display: fallback;
font-display: optional;
```
### Values
`auto` The font display strategy is defined by the user agent.
`block` Gives the font face a short block period and an infinite swap period.
`swap` Gives the font face an extremely small block period and an infinite swap period.
`fallback` Gives the font face an extremely small block period and a short swap period.
`optional` Gives the font face an extremely small block period and no swap period.
**Note:** In Firefox, the preferences `gfx.downloadable_fonts.fallback_delay` and `gfx.downloadable_fonts.fallback_delay_short` provide the duration of the "short" and "extremely small" periods, respectively.
Description
-----------
### The font display timeline
The font display timeline is based on a timer that begins the moment the user agent attempts to use a given downloaded font face. The timeline is divided into the three periods below which dictate the rendering behavior of any elements using the font face.
Font block period If the font face is not loaded, any element attempting to use it must render an *invisible* fallback font face. If the font face successfully loads during this period, it is used normally.
Font swap period If the font face is not loaded, any element attempting to use it must render a fallback font face. If the font face successfully loads during this period, it is used normally.
Font failure period If the font face is not loaded, the user agent treats it as a failed load causing normal font fallback.
Formal definition
-----------------
| | |
| --- | --- |
| Related [at-rule](../at-rule) | [`@font-face`](../@font-face) |
| [Initial value](../initial_value) | `auto` |
| [Computed value](../computed_value) | as specified |
Formal syntax
-------------
```
font-display =
auto [|](../value_definition_syntax#single_bar)
block [|](../value_definition_syntax#single_bar)
swap [|](../value_definition_syntax#single_bar)
fallback [|](../value_definition_syntax#single_bar)
optional
```
Examples
--------
### Specifying fallback font-display
```
@font-face {
font-family: ExampleFont;
src: url(/path/to/fonts/examplefont.woff) format("woff"), url(/path/to/fonts/examplefont.eot)
format("eot");
font-weight: 400;
font-style: normal;
font-display: fallback;
}
```
Specifications
--------------
| Specification |
| --- |
| [CSS Fonts Module Level 4 # font-display-desc](https://w3c.github.io/csswg-drafts/css-fonts/#font-display-desc) |
Browser compatibility
---------------------
| | Desktop | Mobile |
| --- | --- | --- |
| | Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet |
| `font-display` | 60 | 79 | 58 | No | 47 | 11.1 | 60 | 60 | 58 | 44 | 11.3 | 11.0 |
See also
--------
* [`font-family`](font-family)
* [`font-stretch`](font-stretch)
* [`font-style`](font-style)
* [`font-weight`](font-weight)
* [`font-feature-settings`](../font-feature-settings)
* [`font-variation-settings`](font-variation-settings)
* [`src`](src)
* [`unicode-range`](unicode-range)
| programming_docs |
css line-gap-override line-gap-override
=================
The `line-gap-override` CSS descriptor defines the line-gap metric for the font. The line-gap metric is the font recommended line-gap or external leading.
Syntax
------
```
line-gap-override: normal;
line-gap-override: 90%;
```
### Values
`normal` The default value. When used the metric value is obtained from the font file.
`<percentage>` A [`<percentage>`](../percentage) value.
Formal definition
-----------------
| | |
| --- | --- |
| Related [at-rule](../at-rule) | [`@font-face`](../@font-face) |
| [Initial value](../initial_value) | `normal` |
| Percentages | as specified |
| [Computed value](../computed_value) | as specified |
Formal syntax
-------------
```
line-gap-override =
[[](../value_definition_syntax#brackets) normal [|](../value_definition_syntax#single_bar) [<percentage [0,∞]>](../percentage) []](../value_definition_syntax#brackets)[{1,2}](../value_definition_syntax#curly_braces)
```
Examples
--------
### Overriding metrics of a fallback font
The `line-gap-override` property can help when overriding the metrics of a fallback font to better match those of a primary web font.
```
@font-face {
font-family: web-font;
src: url("https://example.com/font.woff");
}
@font-face {
font-family: local-font;
src: local(Local Font);
line-gap-override: 125%;
}
```
Specifications
--------------
| Specification |
| --- |
| [CSS Fonts Module Level 4 # font-metrics-override-desc](https://w3c.github.io/csswg-drafts/css-fonts/#font-metrics-override-desc) |
Browser compatibility
---------------------
| | Desktop | Mobile |
| --- | --- | --- |
| | Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet |
| `line-gap-override` | 87 | 87 | 89 | No | 73 | No | 87 | 87 | 89 | 62 | No | 14.0 |
See also
--------
* [`descent-override`](descent-override)
* [`font-display`](font-display)
* [`font-family`](font-family)
* [`font-weight`](font-weight)
* [`font-style`](font-style)
* [`font-stretch`](font-stretch)
* [`font-feature-settings`](../font-feature-settings)
* [`font-variation-settings`](font-variation-settings)
* [`line-gap-override`](line-gap-override)
* [`src`](src)
* [`size-adjust`](size-adjust)
* [`unicode-range descriptor`](unicode-range)
css font-weight font-weight
===========
The `font-weight` CSS descriptor allows authors to specify font weights for the fonts specified in the [`@font-face`](../@font-face) rule. The [`font-weight`](../font-weight) property can separately be used to set how thick or thin characters in text should be displayed.
For a particular font family, authors can download various font faces which correspond to the different styles of the same font family, and then use the `font-weight` descriptor to explicitly specify the font face's weights. The values for the CSS descriptor is same as that of its corresponding font property.
There are generally limited weights available for a particular font family. When a specified weight doesn't exist, a nearby weight is used. Fonts lacking bold are often synthesized by the user agent. To prevent this, use [`font-synthesis`](../font-synthesis) property.
Syntax
------
```
/\* Single values \*/
font-weight: normal;
font-weight: bold;
font-weight: 400;
/\* Multiple Values \*/
font-weight: normal bold;
font-weight: 300 500;
```
The `font-weight` property is described using any one of the values listed below.
### Values
`normal` Normal font weight. Same as `400`.
`bold` Bold font weight. Same as `700`.
`<number>` A [`<number>`](../number) value between 1 and 1000, inclusive. Higher numbers represent weights that are bolder than (or as bold as) lower numbers. Certain commonly used values correspond to common weight names, as described in the [Common weight name mapping](#common_weight_name_mapping) section below.
In earlier versions of the `font-weight` specification, the property accepts only keyword values and the numeric values 100, 200, 300, 400, 500, 600, 700, 800, and 900; non-variable fonts can only really make use of these set values, although fine-grained values (e.g. 451) will be translated to one of these values for non-variable fonts.
CSS Fonts Level 4 extends the syntax to accept any number between 1 and 1000, inclusive, and introduces [Variable fonts](#variable_fonts), which can make use of this much finer-grained range of font weights.
### Common weight name mapping
The numerical values `100` to `900` roughly correspond to the following common weight names:
| Value | Common weight name |
| --- | --- |
| 100 | Thin (Hairline) |
| 200 | Extra Light (Ultra Light) |
| 300 | Light |
| 400 | Normal |
| 500 | Medium |
| 600 | Semi Bold (Demi Bold) |
| 700 | Bold |
| 800 | Extra Bold (Ultra Bold) |
| 900 | Black (Heavy) |
### Variable fonts
Most fonts have a particular weight which corresponds to one of the numbers in [Common weight name mapping](#common_weight_name_mapping). However some fonts, called variable fonts, can support a range of weights with more or less fine granularity, and this can give the designer a much closer degree of control over the chosen weight.
For TrueType or OpenType variable fonts, the "wght" variation is used to implement varying weights.
Accessibility concerns
----------------------
People experiencing low vision conditions may have difficulty reading text set with a `font-weight` value of `100` (Thin/Hairline) or `200` (Extra Light), especially if the font has a [low contrast color ratio](../color#accessibility_concerns).
* [MDN Understanding WCAG, Guideline 1.4 explanations](https://developer.mozilla.org/en-US/docs/Web/Accessibility/Understanding_WCAG/Perceivable#guideline_1.4_make_it_easier_for_users_to_see_and_hear_content_including_separating_foreground_from_background)
* [Understanding Success Criterion 1.4.8 | W3C Understanding WCAG 2.0](https://www.w3.org/TR/UNDERSTANDING-WCAG20/visual-audio-contrast-visual-presentation.html)
Formal definition
-----------------
| | |
| --- | --- |
| Related [at-rule](../at-rule) | [`@font-face`](../@font-face) |
| [Initial value](../initial_value) | `normal` |
| [Computed value](../computed_value) | as specified |
Formal syntax
-------------
```
font-weight =
auto [|](../value_definition_syntax#single_bar)
<font-weight-absolute>[{1,2}](../value_definition_syntax#curly_braces)
<font-weight-absolute> =
normal [|](../value_definition_syntax#single_bar)
bold [|](../value_definition_syntax#single_bar)
[<number [1,1000]>](../number)
```
Examples
--------
### Setting normal font weight in a @font-face rule
The following finds a local Open Sans font or imports it, and allows using the font for normal font weights.
```
@font-face {
font-family: "Open Sans";
src: local("Open Sans") format("woff2"), url("/fonts/OpenSans-Regular-webfont.woff")
format("woff");
font-weight: 400;
}
```
Specifications
--------------
| Specification |
| --- |
| [CSS Fonts Module Level 4 # font-prop-desc](https://w3c.github.io/csswg-drafts/css-fonts/#font-prop-desc) |
Browser compatibility
---------------------
| | Desktop | Mobile |
| --- | --- | --- |
| | Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet |
| `font-weight` | 4 | 12 | 3.5 | 4 | 10 | 3.1 | ≤37 | 18 | 4 | 10.1 | 2 | 1.0 |
See also
--------
* [`font-display`](font-display)
* [`font-family`](font-family)
* [`font-stretch`](font-stretch)
* [`font-style`](font-style)
* [`font-feature-settings`](../font-feature-settings)
* [`font-variation-settings`](font-variation-settings)
* [`src`](src)
* [`unicode-range descriptor`](unicode-range)
css ascent-override ascent-override
===============
The `ascent-override` CSS descriptor defines the ascent metric for the font. The ascent metric is the height above the baseline that CSS uses to lay out line boxes in an inline formatting context.
Syntax
------
```
ascent-override: normal;
ascent-override: 90%;
```
### Values
`normal` The default value. When used the metric value is obtained from the font file.
`<percentage>` A [`<percentage>`](../percentage) value.
Formal definition
-----------------
| | |
| --- | --- |
| Related [at-rule](../at-rule) | [`@font-face`](../@font-face) |
| [Initial value](../initial_value) | `normal` |
| Percentages | as specified |
| [Computed value](../computed_value) | as specified |
Formal syntax
-------------
```
ascent-override =
[[](../value_definition_syntax#brackets) normal [|](../value_definition_syntax#single_bar) [<percentage [0,∞]>](../percentage) []](../value_definition_syntax#brackets)[{1,2}](../value_definition_syntax#curly_braces)
```
Examples
--------
### Overriding metrics of a fallback font
The `ascent-override` property can help when overriding the metrics of a fallback font to better match those of a primary web font.
```
@font-face {
font-family: web-font;
src: url("https://example.com/font.woff");
}
@font-face {
font-family: local-font;
src: local(Local Font);
ascent-override: 125%;
}
```
Specifications
--------------
| Specification |
| --- |
| [CSS Fonts Module Level 4 # font-metrics-override-desc](https://w3c.github.io/csswg-drafts/css-fonts/#font-metrics-override-desc) |
Browser compatibility
---------------------
| | Desktop | Mobile |
| --- | --- | --- |
| | Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet |
| `ascent-override` | 87 | 87 | 89 | No | 73 | No | 87 | 87 | 89 | 62 | No | 14.0 |
See also
--------
* [`descent-override`](descent-override)
* [`font-display`](font-display)
* [`font-family`](font-family)
* [`font-weight`](font-weight)
* [`font-style`](font-style)
* [`font-stretch`](font-stretch)
* [`font-feature-settings`](../font-feature-settings)
* [`font-variation-settings`](font-variation-settings)
* [`line-gap-override`](line-gap-override)
* [`src`](src)
* [`size-adjust`](size-adjust)
* [`unicode-range descriptor`](unicode-range)
css font-style font-style
==========
The `font-style` CSS descriptor allows authors to specify font styles for the fonts specified in the [`@font-face`](../@font-face) rule.
For a particular font family, authors can download various font faces which correspond to the different styles of the same font family, and then use the `font-style` descriptor to explicitly specify the font face's style. The values for the CSS descriptor is same as that of its corresponding font property.
Syntax
------
```
font-style: normal;
font-style: italic;
font-style: oblique;
font-style: oblique 30deg;
font-style: oblique 30deg 50deg;
```
### Values
`normal` Selects the normal version of the font-family.
`italic` Specifies that font-face is an italicized version of the normal font.
`oblique` Specifies that the font-face is an artificially sloped version of the normal font.
`oblique` with angle Selects a font classified as `oblique`, and additionally specifies an angle for the slant of the text.
`oblique` with angle range Selects a font classified as `oblique`, and additionally specifies a range of allowable angle for the slant of the text. Note that a range is only supported when the `font-style` is `oblique`; for `font-style: normal` or `italic`, no second value is allowed.
Formal definition
-----------------
| | |
| --- | --- |
| Related [at-rule](../at-rule) | [`@font-face`](../@font-face) |
| [Initial value](../initial_value) | `normal` |
| [Computed value](../computed_value) | as specified |
Formal syntax
-------------
```
font-style =
auto [|](../value_definition_syntax#single_bar)
normal [|](../value_definition_syntax#single_bar)
italic [|](../value_definition_syntax#single_bar)
oblique [[](../value_definition_syntax#brackets) [<angle>](../angle)[{1,2}](../value_definition_syntax#curly_braces) []](../value_definition_syntax#brackets)[?](../value_definition_syntax#question_mark)
```
Examples
--------
### Specifying an italic font style
As an example, consider the garamond font family, in its normal form, we get the following result:
```
@font-face {
font-family: garamond;
src: url("garamond.ttf");
}
```
The italicized version of this text uses the same glyphs present in the unstyled version, but they are artificially sloped by a few degrees.
On the other hand, if a true italicized version of the font family exists, we can include it in the `src` descriptor and specify the font style as italic, so that it is clear that the font is italicized. True italics use different glyphs and are a bit different from their upright counterparts, having some unique features and generally have a rounded and calligraphic quality. These fonts are specially created by font designers and are **not** artificially sloped.
```
@font-face {
font-family: garamond;
src: url("garamond-italic.ttf");
font-style: italic;
}
```
Specifications
--------------
| Specification |
| --- |
| [CSS Fonts Module Level 4 # font-prop-desc](https://w3c.github.io/csswg-drafts/css-fonts/#font-prop-desc) |
Browser compatibility
---------------------
| | Desktop | Mobile |
| --- | --- | --- |
| | Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet |
| `font-style` | 4 | 12 | 3.5 | 4 | 10 | 3.1 | ≤37 | 18 | 4 | 10.1 | 2 | 1.0 |
See also
--------
* [`font-display`](font-display)
* [`font-family`](font-family)
* [`font-stretch`](font-stretch)
* [`font-weight`](font-weight)
* [`font-feature-settings`](../font-feature-settings)
* [`font-variation-settings`](font-variation-settings)
* [`src`](src)
* [`unicode-range`](unicode-range)
css font-variation-settings font-variation-settings
=======================
The `font-variation-settings` CSS descriptor allows authors to specify low-level OpenType or TrueType font variations in the [`@font-face`](../@font-face) rule.
Syntax
------
```
/\* Use the default settings \*/
font-variation-settings: normal;
/\* Set values for OpenType axis names \*/
font-variation-settings: "xhgt" 0.7;
```
### Values
`normal` Text is laid out using default settings.
`<string> <number>` When rendering text, the list of OpenType axis names is passed to the text layout engine to enable or disable font features. Each setting is always a [`<string>`](../string) of 4 ASCII characters, followed by a [`<number>`](../number) indicating the axis value. If the `<string>` has more or fewer characters or contains characters outside the U+20 - U+7E codepoint range, the whole property is invalid. The `<number>` can be fractional or negative.
Formal definition
-----------------
| | |
| --- | --- |
| Related [at-rule](../at-rule) | [`@font-face`](../@font-face) |
| [Initial value](../initial_value) | `normal` |
| [Computed value](../computed_value) | as specified |
Formal syntax
-------------
```
font-variation-settings =
normal [|](../value_definition_syntax#single_bar)
[[](../value_definition_syntax#brackets) [<string>](../string) [<number>](../number) []](../value_definition_syntax#brackets)[#](../value_definition_syntax#hash_mark)
```
Examples
--------
### Setting font weight and stretch in a @font-face rule
```
@font-face {
font-family: "OpenTypeFont";
src: url("open\_type\_font.woff2") format("woff2");
font-weight: normal;
font-style: normal;
font-variation-settings: "wght" 400, "wdth" 300;
}
```
Specifications
--------------
| Specification |
| --- |
| [CSS Fonts Module Level 4 # font-rend-desc](https://w3c.github.io/csswg-drafts/css-fonts/#font-rend-desc) |
Browser compatibility
---------------------
| | Desktop | Mobile |
| --- | --- | --- |
| | Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet |
| `font-variation-settings` | No | No | 62 | No | No | No | No | No | 62 | No | No | No |
See also
--------
* [`font-display`](font-display)
* [`font-family`](font-family)
* [`font-stretch`](font-stretch)
* [`font-style`](font-style)
* [`font-weight`](font-weight)
* [`font-feature-settings`](../font-feature-settings)
* [`src`](src)
* [`unicode-range`](unicode-range)
css descent-override descent-override
================
The `descent-override` CSS descriptor defines the descent metric for the font. The descent metric is the height below the baseline that CSS uses to lay out line boxes in an inline formatting context.
Syntax
------
```
descent-override: normal;
descent-override: 90%;
```
### Values
`normal` The default value. When used the metric value is obtained from the font file.
`<percentage>` A [`<percentage>`](../percentage) value.
Formal definition
-----------------
| | |
| --- | --- |
| Related [at-rule](../at-rule) | [`@font-face`](../@font-face) |
| [Initial value](../initial_value) | `normal` |
| Percentages | as specified |
| [Computed value](../computed_value) | as specified |
Formal syntax
-------------
```
descent-override =
[[](../value_definition_syntax#brackets) normal [|](../value_definition_syntax#single_bar) [<percentage [0,∞]>](../percentage) []](../value_definition_syntax#brackets)[{1,2}](../value_definition_syntax#curly_braces)
```
Examples
--------
### Overriding metrics of a fallback font
The `descent-override` property can help when overriding the metrics of a fallback font to better match those of a primary web font.
```
@font-face {
font-family: web-font;
src: url("https://example.com/font.woff");
}
@font-face {
font-family: local-font;
src: local(Local Font);
descent-override: 125%;
}
```
Specifications
--------------
| Specification |
| --- |
| [CSS Fonts Module Level 4 # font-metrics-override-desc](https://w3c.github.io/csswg-drafts/css-fonts/#font-metrics-override-desc) |
Browser compatibility
---------------------
| | Desktop | Mobile |
| --- | --- | --- |
| | Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet |
| `descent-override` | 87 | 87 | 89 | No | 73 | No | 87 | 87 | 89 | 62 | No | 14.0 |
See also
--------
* [`ascent-override`](ascent-override)
* [`font-display`](font-display)
* [`font-family`](font-family)
* [`font-weight`](font-weight)
* [`font-style`](font-style)
* [`font-stretch`](font-stretch)
* [`font-feature-settings`](../font-feature-settings)
* [`font-variation-settings`](font-variation-settings)
* [`line-gap-override`](line-gap-override)
* [`src`](src)
* [`size-adjust`](size-adjust)
* [`unicode-range descriptor`](unicode-range)
css size-adjust size-adjust
===========
The `size-adjust` CSS descriptor defines a multiplier for glyph outlines and metrics associated with this font. This makes it easier to harmonize the designs of various fonts when rendered at the same font size.
The `size-adjust` descriptor behaves in a similar fashion to the [`font-size-adjust`](../font-size-adjust) property. It calculates an adjustment per font by matching ex heights.
Syntax
------
```
size-adjust: 90%;
```
### Values
`<percentage>` A [`<percentage>`](../percentage) value with an initial value of 100%.
All metrics associated with this font are scaled by the given percentage. This includes glyph advances, baseline tables, and overrides provided by [`@font-face`](../@font-face) descriptors.
Formal definition
-----------------
| | |
| --- | --- |
| Related [at-rule](../at-rule) | [`@font-face`](../@font-face) |
| [Initial value](../initial_value) | `100%` |
| Percentages | as specified |
| [Computed value](../computed_value) | as specified |
Formal syntax
-------------
```
size-adjust =
[<percentage [0,∞]>](../percentage)
```
Examples
--------
### Overriding metrics of a fallback font
The `size-adjust` property can help when overriding the metrics of a fallback font to better match those of a primary web font.
```
@font-face {
font-family: web-font;
src: url("https://example.com/font.woff");
}
@font-face {
font-family: local-font;
src: local(Local Font);
size-adjust: 90%;
}
```
Specifications
--------------
| Specification |
| --- |
| [CSS Fonts Module Level 5 # size-adjust-desc](https://w3c.github.io/csswg-drafts/css-fonts-5/#size-adjust-desc) |
Browser compatibility
---------------------
| | Desktop | Mobile |
| --- | --- | --- |
| | Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet |
| `size-adjust` | 92 | 92 | 92 | No | 78 | No | 92 | 92 | 92 | No | No | 16.0 |
See also
--------
* [`font-display`](font-display) descriptor
* [`font-family`](font-family) descriptor
* [`font-weight`](font-weight) descriptor
* [`font-style`](font-style) descriptor
* [`font-stretch`](font-stretch) descriptor
* [`font-feature-settings`](../font-feature-settings)
* [`font-variation-settings`](font-variation-settings) descriptor
* [`src`](src) descriptor
* [`unicode-range`](unicode-range) descriptor
* [`font-size-adjust`](../font-size-adjust) property
| programming_docs |
css font-family font-family
===========
The `font-family` CSS descriptor sets the font family for a font specified in an [`@font-face`](../@font-face) rule.
The value is used for name matching against a particular `@font-face` when styling elements using the [`font-family`](../font-family) property. Any name may be used, and this overrides any name specified in the underlying font data.
Syntax
------
```
/\* <string> values \*/
font-family: "font family";
font-family: "another font family";
/\* <custom-ident> value \*/
font-family: examplefont;
```
### Values
`<family-name>` Specifies the name of the font family.
Formal definition
-----------------
| | |
| --- | --- |
| Related [at-rule](../at-rule) | [`@font-face`](../@font-face) |
| [Initial value](../initial_value) | `n/a (required)` |
| [Computed value](../computed_value) | as specified |
Formal syntax
-------------
```
font-family =
[<family-name>](../family-name)
```
Examples
--------
### Setting the font family name
```
@font-face {
font-family: "Some font family";
src: url("some\_font\_name.ttf");
}
```
Specifications
--------------
| Specification |
| --- |
| [CSS Fonts Module Level 4 # font-family-desc](https://w3c.github.io/csswg-drafts/css-fonts/#font-family-desc) |
Browser compatibility
---------------------
| | Desktop | Mobile |
| --- | --- | --- |
| | Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet |
| `font-family` | 4 | 12 | 3.5 | 6 | 10 | 3.1 | 2.2 | 18 | 4 | 10.1 | 2 | 1.0 |
See also
--------
* [`font-display`](font-display)
* [`font-stretch`](font-stretch)
* [`font-style`](font-style)
* [`font-weight`](font-weight)
* [`font-feature-settings`](../font-feature-settings)
* [`font-variation-settings`](font-variation-settings)
* [`src`](src)
* [`unicode-range`](unicode-range)
css src src
===
The `src` CSS descriptor of the [`@font-face`](../@font-face) rule specifies the resource containing font data. It is required for the `@font-face` rule to be valid.
Syntax
------
```
/\* <url> values \*/
src: url(https://somewebsite.com/path/to/font.woff); /\* Absolute URL \*/
src: url(path/to/font.woff); /\* Relative URL \*/
src: url(path/to/font.woff) format("woff"); /\* Explicit format \*/
src: url("path/to/font.woff"); /\* Quoted URL \*/
src: url(path/to/svgfont.svg#example); /\* Fragment identifying font \*/
/\* <font-face-name> values \*/
src: local(font); /\* Unquoted name \*/
src: local(some font); /\* Name containing space \*/
src: local("font"); /\* Quoted name \*/
/\* Multiple items \*/
src: local(font), url(path/to/font.svg) format("svg"), url(path/to/font.woff)
format("woff"), url(path/to/font.otf) format("opentype");
```
### Values
`<url> [ format( <string># ) ]?` Specifies an external reference consisting of a [`<url>()`](../url), followed by an optional hint using the `format()` function to describe the format of the font resource referenced by that URL. The format hint contains a comma-separated list of format strings that denote well-known font formats. If a user agent doesn't support the specified formats, it skips downloading the font resource. If no format hints are supplied, the font resource is always downloaded.
`<font-face-name>` Specifies the full name or postscript name of a locally-installed font face using the `local()` function, which uniquely identifies a single font face within a larger family. The name can optionally be enclosed in quotes.
**Note:** The [Local Font Access API](https://developer.mozilla.org/en-US/docs/Web/API/Local_Font_Access_API) can be used to access the user's locally installed font data — this includes higher-level details such as names, styles, and families, as well as the raw bytes of the underlying font files.
Description
-----------
The value of this descriptor is a prioritized, comma-separated list of external references or locally-installed font face names. When a font is needed the [user agent](https://developer.mozilla.org/en-US/docs/Glossary/User_agent) iterates over the set of references listed using the first one it can successfully activate. Fonts containing invalid data or local font faces that are not found are ignored and the user agent loads the next font in the list.
As with other URLs in CSS, the URL may be relative, in which case it is resolved relative to the location of the style sheet containing the `@font-face` rule. In the case of SVG fonts, the URL points to an element within a document containing SVG font definitions. If the element reference is omitted, a reference to the first defined font is implied. Similarly, font container formats that can contain more than one font load only one of the fonts for a given `@font-face` rule. Fragment identifiers are used to indicate which font to load. If a container format lacks a defined fragment identifier scheme, a simple 1-based indexing scheme (e.g., "font-collection#1" for the first font, "font-collection#2" for the second font, etc.) is used.
Formal definition
-----------------
| | |
| --- | --- |
| Related [at-rule](../at-rule) | [`@font-face`](../@font-face) |
| [Initial value](../initial_value) | `n/a (required)` |
| [Computed value](../computed_value) | as specified |
Formal syntax
-------------
```
[ <url> [ format( <string># ) ]? | local( <family-name> ) ]#
<family-name> =
<string> |
<custom-ident>+
```
Examples
--------
### Specifying font resources using url() and local()
```
/\* a regular font face: \*/
@font-face {
font-family: examplefont;
src: local(Example Font),
url('examplefont.woff') format("woff"),
url('examplefont.otf') format("opentype");
format("opentype");
}
/\* a bold font face of the same family: \*/
@font-face {
font-family: examplefont;
src: local(Example Font Bold), /\* full font name \*/
local(Example Font-Bold), /\* postscript name \*/
url('examplefont.woff') format("woff"),
url('examplefont.otf') format("opentype");
url("examplefont.woff") format("woff"),
url("examplefont.otf") format("opentype");
font-weight: bold;
}
```
Specifications
--------------
| Specification |
| --- |
| [CSS Fonts Module Level 4 # src-desc](https://w3c.github.io/csswg-drafts/css-fonts/#src-desc) |
Browser compatibility
---------------------
| | Desktop | Mobile |
| --- | --- | --- |
| | Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet |
| `src` | 4 | 12 | 3.5 | 6 | 10 | 3.1 | 2.2 | 18 | 4 | 10.1 | 2 | 1.0 |
| `drop_invalid_item` | 108
Chrome drops invalid item for `tech()` but not other invalid values | 108
Edge drops invalid item for `tech()` but not other invalid values | 109 | No | 94
Opera drops invalid item for `tech()` but not other invalid values | No | 108
Chrome drops invalid item for `tech()` but not other invalid values | 108
Chrome drops invalid item for `tech()` but not other invalid values | 109 | No
Opera drops invalid item for `tech()` but not other invalid values | No | No
Samsung Internet drops invalid item for `tech()` but not other invalid values |
| `format_keyword` | No | No | No | No | No | 4 | No | No | No | No | 5 | No |
| `format_variations` | 66 | 17 | 62 | No | 53 | 11 | 66 | 66 | 62 | 47 | 11 | 9.0 |
| `tech_keyword` | No | No | 105
preview | No | No | No | No | No | No | No | No | No |
See also
--------
* [`font-display`](font-display)
* [`font-family`](font-family)
* [`font-stretch`](font-stretch)
* [`font-style`](font-style)
* [`font-weight`](font-weight)
* [`font-feature-settings`](../font-feature-settings)
* [`font-variation-settings`](font-variation-settings)
* [`unicode-range`](unicode-range)
css font-stretch font-stretch
============
The `font-stretch` CSS descriptor allows authors to specify a normal, condensed, or expanded face for the fonts specified in the [`@font-face`](../@font-face) rule.
For a particular font family, authors can download various font faces which correspond to the different styles of the same font family, and then use the `font-stretch` descriptor to explicitly specify the font face's stretch. The values for the CSS descriptor is same as that of its corresponding font property.
Syntax
------
```
/\* Single values \*/
font-stretch: ultra-condensed;
font-stretch: extra-condensed;
font-stretch: condensed;
font-stretch: semi-condensed;
font-stretch: normal;
font-stretch: semi-expanded;
font-stretch: expanded;
font-stretch: extra-expanded;
font-stretch: ultra-expanded;
font-stretch: 50%;
font-stretch: 100%;
font-stretch: 200%;
/\* multiple values \*/
font-stretch: 75% 125%;
font-stretch: condensed ultra-condensed;
```
The `font-stretch` property is described using any one of the values listed below.
### Values
`normal` Specifies a normal font face.
`semi-condensed`, `condensed`, `extra-condensed`, `ultra-condensed`
Specifies a more condensed font face than normal, with ultra-condensed as the most condensed.
`semi-expanded`, `expanded`, `extra-expanded`, `ultra-expanded`
Specifies a more expanded font face than normal, with ultra-expanded as the most expanded.
`<percentage>` A [`<percentage>`](../percentage) value between 50% and 200% (inclusive). Negative values are not allowed for this property.
In earlier versions of the `font-stretch` specification, the property accepts only the nine keyword values. CSS Fonts Level 4 extends the syntax to accept a `<percentage>` value as well. This enables variable fonts to offer something more like a continuum of character widths. For TrueType or OpenType variable fonts, the "wdth" variation is used to implement varying widths.
If the font does not provide a face that exactly matches the given value, then values less than 100% map to a narrower face, and values greater than or equal to 100% map to a wider face.
### Keyword to numeric mapping
The table below shows the mapping between keyword values and numeric percentages:
| Keyword | Percentage |
| --- | --- |
| `ultra-condensed` | 50% |
| `extra-condensed` | 62.5% |
| `condensed` | 75% |
| `semi-condensed` | 87.5% |
| `normal` | 100% |
| `semi-expanded` | 112.5% |
| `expanded` | 125% |
| `extra-expanded` | 150% |
| `ultra-expanded` | 200% |
### Variable fonts
Most fonts have a particular width which corresponds to one of the keyterm values. However some fonts, called variable fonts, can support a range of stretching with more or less fine granularity, and this can give the designer a much closer degree of control over the chosen weight. For this, percentage ranges are useful.
For TrueType or OpenType variable fonts, the "wdth" variation is used to implement varying glyph widths.
Accessibility concerns
----------------------
People with dyslexia and other cognitive conditions may have difficulty reading fonts that are too condensed, especially if the font has a [low contrast color ratio](../color#accessibility_concerns).
* [MDN Understanding WCAG, Guideline 1.4 explanations](https://developer.mozilla.org/en-US/docs/Web/Accessibility/Understanding_WCAG/Perceivable#guideline_1.4_make_it_easier_for_users_to_see_and_hear_content_including_separating_foreground_from_background)
* [Understanding Success Criterion 1.4.8 | W3C Understanding WCAG 2.0](https://www.w3.org/TR/UNDERSTANDING-WCAG20/visual-audio-contrast-visual-presentation.html)
Formal definition
-----------------
| | |
| --- | --- |
| Related [at-rule](../at-rule) | [`@font-face`](../@font-face) |
| [Initial value](../initial_value) | `normal` |
| [Computed value](../computed_value) | as specified |
Formal syntax
-------------
```
font-stretch =
auto [|](../value_definition_syntax#single_bar)
<'font-stretch'>[{1,2}](../value_definition_syntax#curly_braces)
```
Examples
--------
### Setting a percentage range for font-stretch
The following find a local Open Sans font or import it, and allow using the font for normal, semi-condensed and semi-expanded states.
```
@font-face {
font-family: "Open Sans";
src: local("Open Sans") format("woff2"), url("/fonts/OpenSans-Regular-webfont.woff")
format("woff");
font-stretch: 87.5% 112.5%;
}
```
Specifications
--------------
| Specification |
| --- |
| [CSS Fonts Module Level 4 # font-prop-desc](https://w3c.github.io/csswg-drafts/css-fonts/#font-prop-desc) |
Browser compatibility
---------------------
| | Desktop | Mobile |
| --- | --- | --- |
| | Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet |
| `font-stretch` | 62 | 17 | 62 | No | 49 | 10.1 | 62 | 62 | 62 | 41 | 10.3 | 6.0 |
See also
--------
* [`font-display`](font-display)
* [`font-family`](font-family)
* [`font-weight`](font-weight)
* [`font-style`](font-style)
* [`font-feature-settings`](../font-feature-settings)
* [`font-variation-settings`](font-variation-settings)
* [`src`](src)
* [`unicode-range descriptor`](unicode-range)
css symbols symbols
=======
The `symbols` [CSS](https://developer.mozilla.org/en-US/docs/Web/CSS) descriptor is used to specify the symbols that the specified counter system will use to construct counter representations.
Syntax
------
The `symbols` descriptor is specified as one or more `<symbol>`s.
### Values
`<symbol>` Represents a symbol used within the counter system. This must be one of the following data types:
* [`<string>`](../string)
* [`<image>`](../image) (Note: This value is "at risk" and may be removed from the specification. It is not yet implemented.)
* [`<custom-ident>`](../custom-ident)
Description
-----------
A symbol can be a string, image, or identifier. It is used within the [`@counter-style`](../@counter-style) [at-rule](../at-rule).
```
symbols: A B C D E;
symbols: "\24B6""\24B7""\24B8"D E;
symbols: "0" "1" "2" "4" "5" "6" "7" "8" "9";
symbols: url("first.svg") url("second.svg") url("third.svg");
symbols: indic-numbers;
```
The `symbols` descriptor must be specified when the value of the [`system`](system) descriptor is `cyclic`, `numeric`, `alphabetic`, `symbolic`, or `fixed`. When the `additive` system is used, use the [`additive-symbols`](additive-symbols) descriptor instead to specify the symbols.
Formal definition
-----------------
| | |
| --- | --- |
| Related [at-rule](../at-rule) | [`@counter-style`](../@counter-style) |
| [Initial value](../initial_value) | `n/a (required)` |
| [Computed value](../computed_value) | as specified |
Formal syntax
-------------
```
symbols =
<symbol>[+](../value_definition_syntax#plus)
<symbol> =
[<string>](../string) [|](../value_definition_syntax#single_bar)
<image> [|](../value_definition_syntax#single_bar)
[<custom-ident>](../custom-ident)
<image> =
<url> [|](../value_definition_syntax#single_bar)
[<gradient>](../gradient)
<url> =
url( [<string>](../string) [<url-modifier>](../url-modifier)[\*](../value_definition_syntax#asterisk) ) [|](../value_definition_syntax#single_bar)
src( [<string>](../string) [<url-modifier>](../url-modifier)[\*](../value_definition_syntax#asterisk) )
```
Examples
--------
### Setting counter symbols
#### HTML
```
<ul class="list">
<li>One</li>
<li>Two</li>
<li>Three</li>
<li>Four</li>
<li>Five</li>
</ul>
```
#### CSS
```
@counter-style symbols-example {
system: fixed;
symbols: A "1" "\24B7"D E;
}
.list {
list-style: symbols-example;
}
```
#### Result
Specifications
--------------
| Specification |
| --- |
| [CSS Counter Styles Level 3 # counter-style-symbols](https://w3c.github.io/csswg-drafts/css-counter-styles/#counter-style-symbols) |
Browser compatibility
---------------------
| | Desktop | Mobile |
| --- | --- | --- |
| | Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet |
| `symbols` | 91
Does not support `<image>` as a value for the `symbols` descriptor. | 91
Does not support `<image>` as a value for the `symbols` descriptor. | 33
Does not support `<image>` as a value for the `symbols` descriptor. | No | 77
Does not support `<image>` as a value for the `symbols` descriptor. | No | 91
Does not support `<image>` as a value for the `symbols` descriptor. | 91
Does not support `<image>` as a value for the `symbols` descriptor. | 33
Does not support `<image>` as a value for the `symbols` descriptor. | 64
Does not support `<image>` as a value for the `symbols` descriptor. | No | 16.0
Does not support `<image>` as a value for the `symbols` descriptor. |
See also
--------
* The `symbols` descriptor is used within the [`@counter-style`](../@counter-style) at-rule.
* [`list-style`](../list-style), [`list-style-image`](../list-style-image), [`list-style-position`](../list-style-position)
* [`symbols()`](symbols), the functional notation creating anonymous counter styles
* [`url()`](../url) function
css system system
======
The `system` descriptor specifies the algorithm to be used for converting the integer value of a counter to a string representation. It is used in a [`@counter-style`](../@counter-style) to define the behavior of the defined style.
If the algorithm specified in the `system` descriptor is unable to construct the representation for a particular counter value, then that value's representation will be constructed using the fallback system provided.
Syntax
------
```
/\* Keyword values \*/
system: cyclic;
system: numeric;
system: alphabetic;
system: symbolic;
system: additive;
system: fixed;
/\* Combined values \*/
system: fixed 3;
system: extends decimal;
```
This may take one of three forms:
* One of the keyword values `cyclic`, `numeric`, `alphabetic`, `symbolic`, `additive`, or `fixed`.
* The keyword value `fixed` along with an integer.
* The keyword value or `extends` along with a [`@counter-style`](../@counter-style) name.
`cyclic` Cycles through the list of symbols provided. Once the end of the list of symbols is reached, it will loop back to the beginning and start over. This system is useful for simple bullet styles with just one symbol, or for styles having multiple symbols. At least one symbol must be specified in the `symbols` descriptor, or the counter style is not valid.
`fixed` Defines a finite set of symbols are specified. Once the system has looped through all the specified symbols, it will fall back. This system is useful in cases where the counter values are finite. At least one symbol must be specified in the `symbols` descriptor or the counter style is not valid. Also an optional [`<integer>`](../integer) can be specified after the system, as the value of the first symbol. If this integer is omitted, value of the first integer is taken as `1`.
`symbolic` Cycles through the provided list of symbols. On each successive pass through the cycle, the symbols used for the counter representation are doubled, tripled, and so on. For example, if the original symbols provided were "◽" and "◾", on each successive pass, they will become "◽◽" and "◾◾", "◽◽◽" and "◾◾◾" and so on. At least one symbol must be specified in the `symbols` descriptor or the counter style is not valid. This counter system works for positive counter values only.
`alphabetic` Interprets the specified symbols as digits, to an alphabetic numbering system. If the characters `"a"` to `"z"` are specified as symbols in a counter style, with the `alphabetic` system, then the first 26 counter representations will be `"a"`, `"b"` up to `"z"`. Until this point, the behavior is the same as that of the `symbolic` system, described above. However, after `"z"`, it will continue as `"aa"`, `"ab"`, `"ac"`…
The `symbols` descriptor must contain at least two symbols or the counter style is not valid. The first counter symbol provided in the `symbols` descriptor is interpreted as `1`, the next as `2`, and so on. This system is also defined strictly over positive counter values.
`numeric` Interprets the counter symbols as digits in a [place-value numbering system](https://en.wikipedia.org/wiki/Positional_notation). The numeric system is similar to the `alphabetic` system, described above. The main difference is that in the `alphabetic` system, the first counter symbol given in the `symbols` descriptor is interpreted as `1`, the next as `2`, and so on. However, in the numeric system, the first counter symbol is interpreted as 0, the next as `1`, then `2`, and so on.
At least two counter symbols must be specified in the `symbols` descriptor or the counter style is not valid.
`additive` Used to represent "sign-value" numbering systems, such as Roman numerals, which rather than reuse digits in different positions to obtain different values, define additional digits for larger values. The value of a number in such a system can be found out by adding the digits in the number.
An additional descriptor called `additive-symbols` must be specified with at least one *additive tuple*, or else the counter style rule will not be valid. An additive tuple is similar to a composite counter symbol, which is made up of two parts: a normal counter symbol and a non-negative integer weight. The additive tuples must be specified in the descending order of their weights or the system is invalid.
`extends` Allows authors to use the algorithm of another counter style, but alter its other aspects. If a counter style rule is using the `extends` system, any unspecified descriptors, and their values will be taken from the extended counter style specified. If the specified counter style name in extends, is not a currently defined counter style name, it will instead extend from the decimal counter style.
It must not contain a `symbols` or `additive-symbols` descriptor, or else the counter style rule is invalid. If one or more counter styles definitions form a cycle with their extends values, the browser will treat all the participating counter styles as extending from the decimal style.
Formal definition
-----------------
| | |
| --- | --- |
| Related [at-rule](../at-rule) | [`@counter-style`](../@counter-style) |
| [Initial value](../initial_value) | `symbolic` |
| [Computed value](../computed_value) | as specified |
Formal syntax
-------------
```
system =
cyclic [|](../value_definition_syntax#single_bar)
numeric [|](../value_definition_syntax#single_bar)
alphabetic [|](../value_definition_syntax#single_bar)
symbolic [|](../value_definition_syntax#single_bar)
additive [|](../value_definition_syntax#single_bar)
[[](../value_definition_syntax#brackets) fixed [<integer>](../integer)[?](../value_definition_syntax#question_mark) []](../value_definition_syntax#brackets) [|](../value_definition_syntax#single_bar)
[[](../value_definition_syntax#brackets) extends [<counter-style-name>](../counter-style-name) []](../value_definition_syntax#brackets)
```
Examples
--------
### Cyclic counter
If your browser supports it, this example will render a list like this:
```
◉ One
◉ Two
◉ Three
```
#### CSS
```
@counter-style fisheye {
system: cyclic;
symbols: ◉;
suffix: " ";
}
ul {
list-style: fisheye;
}
```
#### Result
### Fixed counter
If your browser supports it, this example will render a list like this:
```
➀ One
➁ Two
➂ Three
4 Four
5 Five
```
#### CSS
```
@counter-style circled-digits {
system: fixed;
symbols: ➀ ➁ ➂;
suffix: " ";
}
ul {
list-style: circled-digits;
}
```
#### Result
### Symbolic counter
If your browser supports it, this example will render a list like this:
```
a. One
b. Two
c. Three
aa. Four
bb. Five
cc. Six
aaa. Seven
bbb. Eight
```
#### CSS
```
@counter-style abc {
system: symbolic;
symbols: a b c;
suffix: ". ";
}
ul {
list-style: abc;
}
```
#### Result
### Alphabetic counter
If your browser supports it, this example will render a list like this:
```
a. One
b. Two
c. Three
aa. Four
ab. Five
ac. Six
ba. Seven
bb. Seven
```
#### CSS
```
@counter-style abc {
system: alphabetic;
symbols: a b c;
suffix: ". ";
}
ul {
list-style: abc;
}
```
#### Result
### Numeric counter
If your browser supports it, this example will render a list like this:
```
b. One
c. Two
ba. Three
bb. Four
bc. Five
ca. Six
cb. Seven
cc. Eight
```
The first symbol provided in the `symbols` descriptor is interpreted as `0` here.
#### CSS
```
@counter-style abc {
system: numeric;
symbols: a b c;
suffix: ". ";
}
ul {
list-style: abc;
}
```
#### Result
### Numeric counter with numeric symbols
As shown in the following example, if digits from `0` to `9` are specified as symbols, this counter style will render symbols same as the decimal counter style.
#### CSS
```
@counter-style numbers {
system: numeric;
symbols: "0" "1" "2" "3" "4" "5" "6" "7" "8" "9";
suffix: ".";
}
ul {
list-style: numbers;
}
```
#### Result
### Additive counter
This example renders a list using Roman numerals. Notice that a `range` is specified. This is because the representation will produce correct Roman numerals only until the counter value of `3999`. Once outside of the range, the rest of the counter representations will be based on the `decimal` style, which is the fall back. If you need to represent counter values as Roman numerals, you could use either one of the predefined counter styles, `upper-roman` or `lower-roman`, rather than recreating the rule yourself.
#### HTML
```
<ul class="list">
<li>One</li>
<li>Two</li>
<li>Three</li>
<li>Four</li>
<li>Five</li>
</ul>
```
#### CSS
```
@counter-style upper-roman {
system: additive;
range: 1 3999;
additive-symbols: 1000 M, 900 CM, 500 D, 400 CD, 100 C, 90 XC, 50 L, 40 XL,
10 X, 9 IX, 5 V, 4 IV, 1 I;
}
ul {
list-style: upper-roman;
}
```
#### Result
### Extends example
This example will use the algorithm, symbols, and other properties of the `lower-alpha` counter style, but will remove the period (`'.'`) after the counter representation, and enclose the characters in parenthesis; like `(a)`, `(b)`, etc.
#### HTML
```
<ul class="list">
<li>One</li>
<li>Two</li>
<li>Three</li>
<li>Four</li>
<li>Five</li>
</ul>
```
#### CSS
```
@counter-style alpha-modified {
system: extends lower-alpha;
prefix: "(";
suffix: ") ";
}
ul {
list-style: alpha-modified;
}
```
#### Result
Specifications
--------------
| Specification |
| --- |
| [CSS Counter Styles Level 3 # counter-style-system](https://w3c.github.io/csswg-drafts/css-counter-styles/#counter-style-system) |
Browser compatibility
---------------------
| | Desktop | Mobile |
| --- | --- | --- |
| | Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet |
| `system` | 91 | 91 | 33 | No | 77 | No | 91 | 91 | 33 | 64 | No | 16.0 |
See also
--------
* [`list-style`](../list-style), [`list-style-image`](../list-style-image), [`list-style-position`](../list-style-position)
* [`symbols()`](symbols), the functional notation creating anonymous counter styles.
| programming_docs |
css prefix prefix
======
The `prefix` descriptor of the [`@counter-style`](../@counter-style) rule specifies content that will be prepended to the marker representation. If not specified, the default value will be `""` (an empty string).
Syntax
------
```
/\* <symbol> values \*/
prefix: "»";
prefix: "Page ";
prefix: url(bullet.png);
```
### Values
`<symbol>` Specifies a `<symbol>` that is prepended to the marker representation. It may be a [`<string>`](../string), [`<image>`](../image), or [`<custom-ident>`](../custom-ident).
Formal definition
-----------------
| | |
| --- | --- |
| Related [at-rule](../at-rule) | [`@counter-style`](../@counter-style) |
| [Initial value](../initial_value) | "" (the empty string) |
| [Computed value](../computed_value) | as specified |
Formal syntax
-------------
```
prefix =
<symbol>
<symbol> =
[<string>](../string) [|](../value_definition_syntax#single_bar)
<image> [|](../value_definition_syntax#single_bar)
[<custom-ident>](../custom-ident)
<image> =
<url> [|](../value_definition_syntax#single_bar)
[<gradient>](../gradient)
<url> =
url( [<string>](../string) [<url-modifier>](../url-modifier)[\*](../value_definition_syntax#asterisk) ) [|](../value_definition_syntax#single_bar)
src( [<string>](../string) [<url-modifier>](../url-modifier)[\*](../value_definition_syntax#asterisk) )
```
Examples
--------
### Adding a prefix to a counter
#### HTML
```
<ul class="index">
<li>The Boy Who Lived</li>
<li>The Vanishing Glass</li>
<li>The Letters from No One</li>
<li>The Keeper of the Keys</li>
<li>Diagon Alley</li>
</ul>
```
#### CSS
```
@counter-style chapters {
system: numeric;
symbols: "0" "1" "2" "3" "4" "5" "6" "7" "8" "9";
prefix: "Chapter ";
}
.index {
list-style: chapters;
padding-left: 15ch;
}
```
#### Result
Specifications
--------------
| Specification |
| --- |
| [CSS Counter Styles Level 3 # counter-style-prefix](https://w3c.github.io/csswg-drafts/css-counter-styles/#counter-style-prefix) |
Browser compatibility
---------------------
| | Desktop | Mobile |
| --- | --- | --- |
| | Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet |
| `prefix` | 91 | 91 | 33 | No | 77 | No | 91 | 91 | 33 | 64 | No | 16.0 |
See also
--------
* [`list-style`](../list-style), [`list-style-image`](../list-style-image), [`list-style-position`](../list-style-position)
* [`symbols()`](symbols), the functional notation creating anonymous counter styles
css additive-symbols additive-symbols
================
The `additive-symbols` descriptor lets you specify symbols when the value of a counter [`system`](system) descriptor is `additive`. The `additive-symbols` descriptor defines *additive tuples*, each of which is a pair containing a symbol and a non-negative integer weight. The additive system is used to construct [sign-value numbering](https://en.wikipedia.org/wiki/Sign-value_notation) systems such as Roman numerals.
Syntax
------
```
additive-symbols: 3 "0";
additive-symbols: 3 "0", 2 "\2E\20";
additive-symbols: 3 "0", 2 url(symbol.png);
```
When the `system` descriptor is `cyclic`, `numeric`, `alphabetic`, `symbolic`, or `fixed`, use the [`symbols()`](symbols) descriptor instead of `additive-symbols`.
Formal definition
-----------------
| | |
| --- | --- |
| Related [at-rule](../at-rule) | [`@counter-style`](../@counter-style) |
| [Initial value](../initial_value) | `n/a (required)` |
| [Computed value](../computed_value) | as specified |
Formal syntax
-------------
```
additive-symbols =
[[](../value_definition_syntax#brackets) [<integer [0,∞]>](../integer) [&&](../value_definition_syntax#double_ampersand) <symbol> []](../value_definition_syntax#brackets)[#](../value_definition_syntax#hash_mark)
<symbol> =
[<string>](../string) [|](../value_definition_syntax#single_bar)
<image> [|](../value_definition_syntax#single_bar)
[<custom-ident>](../custom-ident)
<image> =
<url> [|](../value_definition_syntax#single_bar)
[<gradient>](../gradient)
<url> =
url( [<string>](../string) [<url-modifier>](../url-modifier)[\*](../value_definition_syntax#asterisk) ) [|](../value_definition_syntax#single_bar)
src( [<string>](../string) [<url-modifier>](../url-modifier)[\*](../value_definition_syntax#asterisk) )
```
Examples
--------
### Specifying additive symbols
#### HTML
```
<ul class="list">
<li>One</li>
<li>Two</li>
<li>Three</li>
<li>Four</li>
<li>Five</li>
</ul>
```
#### CSS
```
@counter-style additive-symbols-example {
system: additive;
additive-symbols: V 5, IV 4, I 1;
}
.list {
list-style: additive-symbols-example;
}
```
#### Result
Specifications
--------------
| Specification |
| --- |
| [CSS Counter Styles Level 3 # counter-style-symbols](https://w3c.github.io/csswg-drafts/css-counter-styles/#counter-style-symbols) |
Browser compatibility
---------------------
| | Desktop | Mobile |
| --- | --- | --- |
| | Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet |
| `additive-symbols` | 91 | 91 | 33 | No | 77 | No | 91 | 91 | 33 | 64 | No | 16.0 |
See also
--------
* [`list-style`](../list-style), [`list-style-image`](../list-style-image), [`list-style-position`](../list-style-position)
* The [`symbols()`](symbols), functional notation is used for creating anonymous counter styles.
css speak-as speak-as
========
The `speak-as` descriptor specifies how a counter symbol constructed with a given [`@counter-style`](../@counter-style) will be represented in the spoken form. For example, an author can specify a counter symbol to be either spoken as its numerical value or just represented with an audio cue.
Syntax
------
```
/\* Keyword values \*/
speak-as: auto;
speak-as: bullets;
speak-as: numbers;
speak-as: words;
speak-as: spell-out;
/\* @counter-style name value \*/
speak-as: <counter-style-name>;
```
### Values
`auto` If the value of `speak-as` is specified as `auto`, then the effective value of `speak-as` will be determined based on the value of the [`system`](system) descriptor:
* If the value of `system` is `alphabetic`, the effective value of `speak-as` will be `spell-out`.
* If `system` is `cyclic`, the effective value of `speak-as` will be `bullets`.
* If `system` is `extends`, the value of `speak-as` will be the same as if `speak-as: auto` is specified on the extended style.
* For all other cases, specifying `auto` has the same effect as specifying `speak-as: numbers`.
`bullets` A phrase or an audio cue defined by the [user agent](https://developer.mozilla.org/en-US/docs/Glossary/User_agent) for representing an unordered list item will be read out.
`numbers` The numerical value of the counter will be read out in the document language.
`words` The user agent will generate a counter value as normal and read it out as a word in the document language.
`spell-out` The user agent will generate a counter representation as normal and would read it out letter by letter. If the user agent doesn't know how to read out a particular counter symbol, the user agent might read it out as if the value of `speak-as` was `numbers`.
`<counter-style-name>` The name of another counter style, specified as a [`<custom-ident>`](../custom-ident). If included, the counter will be spoken out in the form specified in that counter style, kind of like specifying the [`fallback`](fallback) descriptor. If the specified style does not exist, `speak-as` defaults to `auto`.
Accessibility concerns
----------------------
Assistive technology support is very limited for the `speak-as` property. Do not rely on it to convey information critical to understanding the page's purpose.
[Let's Talk About Speech CSS | CSS Tricks](https://css-tricks.com/lets-talk-speech-css/)
Formal definition
-----------------
| | |
| --- | --- |
| Related [at-rule](../at-rule) | [`@counter-style`](../@counter-style) |
| [Initial value](../initial_value) | `auto` |
| [Computed value](../computed_value) | as specified |
Formal syntax
-------------
```
speak-as =
auto [|](../value_definition_syntax#single_bar)
bullets [|](../value_definition_syntax#single_bar)
numbers [|](../value_definition_syntax#single_bar)
words [|](../value_definition_syntax#single_bar)
spell-out [|](../value_definition_syntax#single_bar)
[<counter-style-name>](../counter-style-name)
```
Examples
--------
### Setting the spoken form for a counter
#### HTML
```
<ul class="list">
<li>One</li>
<li>Two</li>
<li>Three</li>
<li>Four</li>
<li>Five</li>
</ul>
```
#### CSS
```
@counter-style speak-as-example {
system: fixed;
symbols: ;
suffix: " ";
speak-as: numbers;
}
.list {
list-style: speak-as-example;
}
```
#### Result
Specifications
--------------
| Specification |
| --- |
| [CSS Counter Styles Level 3 # counter-style-speak-as](https://w3c.github.io/csswg-drafts/css-counter-styles/#counter-style-speak-as) |
Browser compatibility
---------------------
| | Desktop | Mobile |
| --- | --- | --- |
| | Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet |
| `speak-as` | No | No | 33 | No | No | No | No | No | 33 | No | No | No |
See also
--------
* [`list-style`](../list-style), [`list-style-image`](../list-style-image), [`list-style-position`](../list-style-position)
* [`symbols()`](symbols), the functional notation creating anonymous counter styles.
css fallback fallback
========
The `fallback` descriptor can be used to specify a counter style to fall back to if the current counter style cannot create a marker representation for a particular counter value.
Syntax
------
```
/\* Keyword values \*/
fallback: lower-alpha;
fallback: custom-gangnam-style;
```
Description
-----------
If the specified fallback style is also unable to construct a representation, then its fallback style will be used. If a valid fallback style is not specified, it defaults to `decimal`.
A couple of scenarios where a fallback style will be used are:
* When the [`range`](range) descriptor is specified for a counter style, the fallback style will be used to represent values that fall outside the range.
* When the `fixed` [`system`](system) is used and there are not enough symbols to cover all the list items, the fallback style will be used for the rest of the list items.
Formal definition
-----------------
| | |
| --- | --- |
| Related [at-rule](../at-rule) | [`@counter-style`](../@counter-style) |
| [Initial value](../initial_value) | `decimal` |
| [Computed value](../computed_value) | as specified |
Formal syntax
-------------
```
fallback =
[<counter-style-name>](../counter-style-name)
```
Examples
--------
### Specifying a fallback counter style
#### HTML
```
<ul class="list">
<li>One</li>
<li>Two</li>
<li>Three</li>
<li>Four</li>
<li>Five</li>
</ul>
```
#### CSS
```
@counter-style fallback-example {
system: fixed;
symbols: "\24B6""\24B7""\24B8";
fallback: upper-alpha;
}
.list {
list-style: fallback-example;
}
```
#### Result
Specifications
--------------
| Specification |
| --- |
| [CSS Counter Styles Level 3 # counter-style-fallback](https://w3c.github.io/csswg-drafts/css-counter-styles/#counter-style-fallback) |
Browser compatibility
---------------------
| | Desktop | Mobile |
| --- | --- | --- |
| | Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet |
| `fallback` | 91 | 91 | 33 | No | 77 | No | 91 | 91 | 33 | 64 | No | 16.0 |
See also
--------
* [`list-style`](../list-style), [`list-style-image`](../list-style-image), [`list-style-position`](../list-style-position)
* [`symbols()`](symbols): the functional notation creating anonymous counter styles
css range range
=====
When defining custom counter styles, the `range` descriptor lets the author specify a range of counter values over which the style is applied. If a counter value is outside the specified range, then the fallback style will be used to construct the representation of that marker.
Syntax
------
```
/\* Keyword value \*/
range: auto;
/\* Range values \*/
range: 2 5;
range: infinite 10;
range: 6 infinite;
range: infinite infinite;
/\* Multiple range values \*/
range: 2 5, 8 10;
range: infinite 6, 10 infinite;
```
### Values
`auto` The range depends on the counter system:
* For cyclic, numeric, and fixed systems, the range is negative infinity to positive infinity.
* For alphabetic and symbolic systems, the range is 1 to positive infinity.
* For additive systems, the range is 0 to positive infinity.
* For extends systems, the range is whatever auto would produce for the extended system; if extending a complex predefined style (§7 Complex Predefined Counter Styles), the range is the style's defined range.
`[ [ | infinite ]{2} ]#` Defines a comma-separated list of ranges. For each individual range, the first value is the lower bound and the second value is the upper bound. A range is inclusive, that means it always contains both, the lower and upper bound numbers. If infinite is used as the first value in a range, it represents negative infinity; if it is used as the second value, it represents positive infinity. The range of the counter style is the union of all the ranges defined in the list. If the lower bound of any range is higher than the upper bound, the entire descriptor is invalid and will be ignored.
Description
-----------
The value of the range descriptor can be either auto or a comma separated list of lower and upper bounds specified as integers.
If value is auto, then for cyclic, numeric, and fixed system, the range will be from negative infinity to positive infinity. For alphabetic and symbolic systems, range will be from 1 to positive infinity. For additive systems, auto will result in the range 0 to positive infinity. For extends systems, the range is whatever auto will produce for the extended system.
When range is specified as integers, the value `infinite` can be used to denote infinity. If *infinite* is specified as the first value in a range, then it is interpreted as negative infinity. If used as upper bound, it is taken as positive infinity.
Formal definition
-----------------
| | |
| --- | --- |
| Related [at-rule](../at-rule) | [`@counter-style`](../@counter-style) |
| [Initial value](../initial_value) | `auto` |
| [Computed value](../computed_value) | as specified |
Formal syntax
-------------
```
range =
[[](../value_definition_syntax#brackets) [[](../value_definition_syntax#brackets) [<integer>](../integer) [|](../value_definition_syntax#single_bar) infinite []](../value_definition_syntax#brackets)[{2}](../value_definition_syntax#curly_braces) []](../value_definition_syntax#brackets)[#](../value_definition_syntax#hash_mark) [|](../value_definition_syntax#single_bar)
auto
```
Examples
--------
### Setting counter style over a range
```
<ul class="list">
<li>One</li>
<li>Two</li>
<li>Three</li>
<li>Four</li>
<li>Five</li>
<li>Six</li>
<li>Seven</li>
<li>Eight</li>
<li>Nine</li>
<li>Ten</li>
</ul>
```
```
@counter-style range-multi-example {
system: cyclic;
symbols: "\25A0""\25A1";
range: 2 4, 7 9;
}
.list {
list-style: range-multi-example;
}
```
The above list will display as follows:
:
Specifications
--------------
| Specification |
| --- |
| [CSS Counter Styles Level 3 # counter-style-range](https://w3c.github.io/csswg-drafts/css-counter-styles/#counter-style-range) |
Browser compatibility
---------------------
| | Desktop | Mobile |
| --- | --- | --- |
| | Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet |
| `range` | 91 | 91 | 33 | No | 77 | No | 91 | 91 | 33 | 64 | No | 16.0 |
See also
--------
* [`list-style`](../list-style), [`list-style-image`](../list-style-image), [`list-style-position`](../list-style-position)
* [`symbols()`](symbols), the functional notation creating anonymous counter styles.
css negative negative
========
When defining custom counter styles, the `negative` descriptor lets you alter the representations of negative counter values, by providing a way to specify symbols to be appended or prepended to the counter representation when the value is negative.
Syntax
------
```
/\* <symbol> values \*/
negative: "-"; /\* Prepends '-' if value is negative \*/
negative: "(" ")"; /\* Surrounds value by '(' and ')' if it is negative \*/
```
### Values
first `<symbol>`
This symbol will be prepended to the representation when the counter is negative.
second `<symbol>`
If present, this symbol will be appended to the representation when the counter is negative.
Description
-----------
If the counter value is negative, the symbol provided as value for the descriptor is prepended to the counter representation; and a second symbol if specified, will be appended to the representation. The negative descriptor has effect only if the `system` value is `symbolic`, `alphabetic`, `numeric`, `additive`, or `extends`, if the extended counter style itself uses a negative sign. If the negative descriptor is specified for other systems that don't support negative counter values, then the descriptor is ignored.
Formal definition
-----------------
| | |
| --- | --- |
| Related [at-rule](../at-rule) | [`@counter-style`](../@counter-style) |
| [Initial value](../initial_value) | `"-" hyphen-minus` |
| [Computed value](../computed_value) | as specified |
Formal syntax
-------------
```
negative =
<symbol> <symbol>[?](../value_definition_syntax#question_mark)
<symbol> =
[<string>](../string) [|](../value_definition_syntax#single_bar)
<image> [|](../value_definition_syntax#single_bar)
[<custom-ident>](../custom-ident)
<image> =
<url> [|](../value_definition_syntax#single_bar)
[<gradient>](../gradient)
<url> =
url( [<string>](../string) [<url-modifier>](../url-modifier)[\*](../value_definition_syntax#asterisk) ) [|](../value_definition_syntax#single_bar)
src( [<string>](../string) [<url-modifier>](../url-modifier)[\*](../value_definition_syntax#asterisk) )
```
Examples
--------
### Rendering negative counters
#### HTML
```
<ol class="list" start="-3">
<li>One</li>
<li>Two</li>
<li>Three</li>
<li>Four</li>
<li>Five</li>
</ol>
```
#### CSS
```
@counter-style neg {
system: numeric;
symbols: "0" "1" "2" "3" "4" "5" "6" "7" "8" "9";
negative: "(-" ")";
}
.list {
list-style: neg;
}
```
#### Result
Specifications
--------------
| Specification |
| --- |
| [CSS Counter Styles Level 3 # counter-style-system](https://w3c.github.io/csswg-drafts/css-counter-styles/#counter-style-system) |
Browser compatibility
---------------------
| | Desktop | Mobile |
| --- | --- | --- |
| | Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet |
| `negative` | 91 | 91 | 33 | No | 77 | No | 91 | 91 | 33 | 64 | No | 16.0 |
See also
--------
* [`list-style`](../list-style), [`list-style-image`](../list-style-image), [`list-style-position`](../list-style-position)
* [`symbols()`](symbols), the functional notation creating anonymous counter styles.
| programming_docs |
css pad pad
===
The `pad` descriptor can be used with custom counter style definitions when you need the marker representations to have a minimum length.
Syntax
------
```
pad: 3 "0";
```
### Values
`<integer> && <symbol>` The `<integer>` specifies a minimum length that all counter representations must reach. The value must be non-negative. If the minimum length is not reached, the representation will be padded with the specified `<symbol>`.
Description
-----------
If a marker representation is smaller than the specified pad length, then the marker will be padded with the specified pad symbol. Marker representations longer than the pad length are constructed as normal. Pad descriptor takes the minimum marker length as an integer and a symbol to be used for padding as the second parameter. A common usage of the pad descriptor is when you need your list to start numbering from 01 and go through 02, 03 and so on, instead of just 1, 2, 3…
Formal definition
-----------------
| | |
| --- | --- |
| Related [at-rule](../at-rule) | [`@counter-style`](../@counter-style) |
| [Initial value](../initial_value) | `0 ""` |
| [Computed value](../computed_value) | as specified |
Formal syntax
-------------
```
pad =
[<integer [0,∞]>](../integer) [&&](../value_definition_syntax#double_ampersand)
<symbol>
<symbol> =
[<string>](../string) [|](../value_definition_syntax#single_bar)
<image> [|](../value_definition_syntax#single_bar)
[<custom-ident>](../custom-ident)
<image> =
<url> [|](../value_definition_syntax#single_bar)
[<gradient>](../gradient)
<url> =
url( [<string>](../string) [<url-modifier>](../url-modifier)[\*](../value_definition_syntax#asterisk) ) [|](../value_definition_syntax#single_bar)
src( [<string>](../string) [<url-modifier>](../url-modifier)[\*](../value_definition_syntax#asterisk) )
```
Examples
--------
### Padding a counter
#### HTML
```
<ul class="list">
<li>One</li>
<li>Two</li>
<li>Three</li>
<li>Four</li>
<li>Five</li>
</ul>
```
#### CSS
```
@counter-style pad-example {
system: numeric;
symbols: "0" "1" "2" "3" "4" "5";
pad: 2 "0";
}
.list {
list-style: pad-example;
}
```
#### Result
Specifications
--------------
| Specification |
| --- |
| [CSS Counter Styles Level 3 # counter-style-pad](https://w3c.github.io/csswg-drafts/css-counter-styles/#counter-style-pad) |
Browser compatibility
---------------------
| | Desktop | Mobile |
| --- | --- | --- |
| | Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet |
| `pad` | 91 | 91 | 33 | No | 77 | No | 91 | 91 | 33 | 64 | No | 16.0 |
See also
--------
* [`list-style`](../list-style), [`list-style-image`](../list-style-image), [`list-style-position`](../list-style-position)
* [`symbols()`](symbols), the functional notation creating anonymous counter styles.
css suffix suffix
======
The `suffix` descriptor of the [`@counter-style`](../@counter-style) rule specifies content that will be appended to the marker representation.
Syntax
------
```
/\* <symbol> values \*/
suffix: "";
suffix: ") ";
suffix: url(bullet.png);
```
### Values
`<symbol>` Specifies a `<symbol>` that is appended to the marker representation. It may be a [`<string>`](../string), [`<image>`](../image), or [`<custom-ident>`](../custom-ident).
Formal definition
-----------------
| | |
| --- | --- |
| Related [at-rule](../at-rule) | [`@counter-style`](../@counter-style) |
| [Initial value](../initial_value) | ". " (full stop followed by a space) |
| [Computed value](../computed_value) | as specified |
Formal syntax
-------------
```
suffix =
<symbol>
<symbol> =
[<string>](../string) [|](../value_definition_syntax#single_bar)
<image> [|](../value_definition_syntax#single_bar)
[<custom-ident>](../custom-ident)
<image> =
<url> [|](../value_definition_syntax#single_bar)
[<gradient>](../gradient)
<url> =
url( [<string>](../string) [<url-modifier>](../url-modifier)[\*](../value_definition_syntax#asterisk) ) [|](../value_definition_syntax#single_bar)
src( [<string>](../string) [<url-modifier>](../url-modifier)[\*](../value_definition_syntax#asterisk) )
```
Examples
--------
### Setting a suffix for a counter
#### HTML
```
<ul class="choices">
<li>One</li>
<li>Two</li>
<li>Three</li>
<li>None of the above</li>
</ul>
```
#### CSS
```
@counter-style options {
system: fixed;
symbols: A B C D;
suffix: ") ";
}
.choices {
list-style: options;
}
```
#### Result
Specifications
--------------
| Specification |
| --- |
| [CSS Counter Styles Level 3 # counter-style-suffix](https://w3c.github.io/csswg-drafts/css-counter-styles/#counter-style-suffix) |
Browser compatibility
---------------------
| | Desktop | Mobile |
| --- | --- | --- |
| | Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet |
| `suffix` | 91 | 91 | 33 | No | 77 | No | 91 | 91 | 33 | 64 | No | 16.0 |
See also
--------
* [`list-style`](../list-style), [`list-style-image`](../list-style-image), [`list-style-position`](../list-style-position)
* [`symbols()`](symbols), the functional notation creating anonymous counter styles
css Using CSS animations Using CSS animations
====================
**CSS animations** make it possible to animate transitions from one CSS style configuration to another. Animations consist of two components, a style describing the CSS animation and a set of keyframes that indicate the start and end states of the animation's style, as well as possible intermediate waypoints.
There are three key advantages to CSS animations over traditional script-driven animation techniques:
1. They're easy to use for simple animations; you can create them without even having to know JavaScript.
2. The animations run well, even under moderate system load. Simple animations can often perform poorly in JavaScript. The rendering engine can use frame-skipping and other techniques to keep the performance as smooth as possible.
3. Letting the browser control the animation sequence lets the browser optimize performance and efficiency by, for example, reducing the update frequency of animations running in tabs that aren't currently visible.
Configuring an animation
------------------------
To create a CSS animation sequence, you style the element you want to animate with the [`animation`](../animation) property or its sub-properties. This lets you configure the timing, duration, and other details of how the animation sequence should progress. This does **not** configure the actual appearance of the animation, which is done using the [`@keyframes`](../@keyframes) at-rule as described in the [Defining the animation sequence using keyframes](#defining_the_animation_sequence_using_keyframes) section below.
The sub-properties of the [`animation`](../animation) property are:
[`animation-delay`](../animation-delay) Specifies the delay between an element loading and the start of an animation sequence and whether the animation should start immediately from its beginning or partway through the animation.
[`animation-direction`](../animation-direction) Specifies whether an animation's first iteration should be forward or backward and whether subsequent iterations should alternate direction on each run through the sequence or reset to the start point and repeat.
[`animation-duration`](../animation-duration) Specifies the length of time in which an animation completes one cycle.
[`animation-fill-mode`](../animation-fill-mode) Specifies how an animation applies styles to its target before and after it runs.
[`animation-iteration-count`](../animation-iteration-count) Specifies the number of times an animation should repeat.
[`animation-name`](../animation-name) Specifies the name of the [`@keyframes`](../@keyframes) at-rule describing an animation's keyframes.
[`animation-play-state`](../animation-play-state) Specifies whether to pause or play an animation sequence.
[`animation-timing-function`](../animation-timing-function) Specifies how an animation transitions through keyframes by establishing acceleration curves.
Defining animation sequence using keyframes
-------------------------------------------
After you've configured the animation's timing, you need to define the appearance of the animation. This is done by establishing one or more keyframes using the [`@keyframes`](../@keyframes) at-rule. Each keyframe describes how the animated element should render at a given time during the animation sequence.
Since the timing of the animation is defined in the CSS style that configures the animation, keyframes use a [`<percentage>`](../percentage) to indicate the time during the animation sequence at which they take place. 0% indicates the first moment of the animation sequence, while 100% indicates the final state of the animation. Because these two times are so important, they have special aliases: `from` and `to`. Both are optional. If `from`/`0%` or `to`/`100%` is not specified, the browser starts or finishes the animation using the computed values of all attributes.
You can optionally include additional keyframes that describe intermediate steps between the start and end of the animation.
Using the animation shorthand
-----------------------------
The [`animation`](../animation) shorthand is useful for saving space. As an example, some of the rules we've been using through this article:
```
p {
animation-duration: 3s;
animation-name: slidein;
animation-iteration-count: infinite;
animation-direction: alternate;
}
```
...could be replaced by using the `animation` shorthand.
```
p {
animation: 3s infinite alternate slidein;
}
```
To learn more about the sequence in which different animation property values can be specified using the `animation` shorthand, see the [`animation`](../animation) reference page.
Setting multiple animation property values
------------------------------------------
The CSS animation longhand properties can accept multiple values, separated by commas. This feature can be used when you want to apply multiple animations in a single rule and set different durations, iteration counts, etc., for each of the animations. Let's look at some quick examples to explain the different permutations.
In this first example, there are three duration and three iteration count values. So each animation is assigned a value of duration and iteration count with the same position as the animation name. The `fadeInOut` animation is assigned a duration of `2.5s` and an iteration count of `2`, and the `bounce` animation is assigned a duration of `1s` and an iteration count of `5`.
```
animation-name: fadeInOut, moveLeft300px, bounce;
animation-duration: 2.5s, 5s, 1s;
animation-iteration-count: 2, 1, 5;
```
In this second example, three animation names are set, but there's only one duration and iteration count. In this case, all three animations are given the same duration and iteration count.
```
animation-name: fadeInOut, moveLeft300px, bounce;
animation-duration: 3s;
animation-iteration-count: 1;
```
In this third example, three animations are specified, but only two durations and iteration counts. In such cases where there are not enough values in the list to assign a separate one to each animation, the value assignment cycles from the first to the last item in the available list and then cycles back to the first item. So, `fadeInOut` gets a duration of `2.5s`, and `moveLeft300px` gets a duration of `5s`, which is the last value in the list of duration values. The duration value assignment now resets to the first value; `bounce`, therefore, gets a duration of `2.5s`. The iteration count values (and any other property values you specify) will be assigned in the same way.
```
animation-name: fadeInOut, moveLeft300px, bounce;
animation-duration: 2.5s, 5s;
animation-iteration-count: 2, 1;
```
If the mismatch in the number of animations and animation property values is inverted, say there are five `animation-duration` values for three `animation-name` values, then the extra or unused animation property values, in this case, two `animation-duration` values, don't apply to any animation and are ignored.
Examples
--------
**Note:** Some older browsers (pre-2017) may need prefixes; the live examples you can click to see in your browser include the `-webkit` prefixed syntax.
### Making text slide across the browser window
This simple example styles the [`<p>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/p) element so that the text slides in from off the right edge of the browser window.
Note that animations like this can cause the page to become wider than the browser window. To avoid this problem put the element to be animated in a container, and set [`overflow`](../overflow)`:hidden` on the container.
```
p {
animation-duration: 3s;
animation-name: slidein;
}
@keyframes slidein {
from {
margin-left: 100%;
width: 300%;
}
to {
margin-left: 0%;
width: 100%;
}
}
```
In this example the style for the [`<p>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/p) element specifies that the animation should take 3 seconds to execute from start to finish, using the [`animation-duration`](../animation-duration) property, and that the name of the [`@keyframes`](../@keyframes) at-rule defining the keyframes for the animation sequence is named "slidein".
If we wanted any custom styling on the [`<p>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/p) element to appear in browsers that don't support CSS animations, we would include it here as well; however, in this case we don't want any custom styling other than the animation effect.
The keyframes are defined using the [`@keyframes`](../@keyframes) at-rule. In this case, we have just two keyframes. The first occurs at 0% (using the alias `from`). Here, we configure the left margin of the element to be at 100% (that is, at the far right edge of the containing element), and the width of the element to be 300% (or three times the width of the containing element). This causes the first frame of the animation to have the header drawn off the right edge of the browser window.
The second (and final) keyframe occurs at 100% (using the alias `to`). The left margin is set to 0% and the width of the element is set to 100%. This causes the header to finish its animation flush against the left edge of the content area.
```
<p>
The Caterpillar and Alice looked at each other for some time in silence: at
last the Caterpillar took the hookah out of its mouth, and addressed her in a
languid, sleepy voice.
</p>
```
**Note:** Reload page to see the animation.
### Adding another keyframe
Let's add another keyframe to the previous example's animation. Let's say we want the header's font size to increase as it moves from right to left for a while, then to decrease back to its original size. That's as simple as adding this keyframe:
```
75% {
font-size: 300%;
margin-left: 25%;
width: 150%;
}
```
The full code now looks like this:
```
p {
animation-duration: 3s;
animation-name: slidein;
}
@keyframes slidein {
from {
margin-left: 100%;
width: 300%;
}
75% {
font-size: 300%;
margin-left: 25%;
width: 150%;
}
to {
margin-left: 0%;
width: 100%;
}
}
```
```
<p>
The Caterpillar and Alice looked at each other for some time in silence: at
last the Caterpillar took the hookah out of its mouth, and addressed her in a
languid, sleepy voice.
</p>
```
This tells the browser that 75% of the way through the animation sequence, the header should have its left margin at 25% and the width should be 150%.
**Note:** Reload page to see the animation.
### Repeating the animation
To make the animation repeat itself, use the [`animation-iteration-count`](../animation-iteration-count) property to indicate how many times to repeat the animation. In this case, let's use `infinite` to have the animation repeat indefinitely:
```
p {
animation-duration: 3s;
animation-name: slidein;
animation-iteration-count: infinite;
}
```
Adding it to the existing code:
```
@keyframes slidein {
from {
margin-left: 100%;
width: 300%;
}
to {
margin-left: 0%;
width: 100%;
}
}
```
```
<p>
The Caterpillar and Alice looked at each other for some time in silence: at
last the Caterpillar took the hookah out of its mouth, and addressed her in a
languid, sleepy voice.
</p>
```
### Making the animation move back and forth
That made it repeat, but it's very odd having it jump back to the start each time it begins animating. What we really want is for it to move back and forth across the screen. That's easily accomplished by setting [`animation-direction`](../animation-direction) to `alternate`:
```
p {
animation-duration: 3s;
animation-name: slidein;
animation-iteration-count: infinite;
animation-direction: alternate;
}
```
And the rest of the code:
```
@keyframes slidein {
from {
margin-left: 100%;
width: 300%;
}
to {
margin-left: 0%;
width: 100%;
}
}
```
```
<p>
The Caterpillar and Alice looked at each other for some time in silence: at
last the Caterpillar took the hookah out of its mouth, and addressed her in a
languid, sleepy voice.
</p>
```
### Using animation events
You can get additional control over animations — as well as useful information about them — by making use of animation events. These events, represented by the [`AnimationEvent`](https://developer.mozilla.org/en-US/docs/Web/API/AnimationEvent) object, can be used to detect when animations start, finish, and begin a new iteration. Each event includes the time at which it occurred as well as the name of the animation that triggered the event.
We'll modify the sliding text example to output some information about each animation event when it occurs, so we can get a look at how they work.
#### Adding the CSS
We start with creating the CSS for the animation. This animation will last for 3 seconds, be called "slidein", repeat 3 times, and alternate direction each time. In the [`@keyframes`](../@keyframes), the width and margin-left are manipulated to make the element slide across the screen.
```
.slidein {
animation-duration: 3s;
animation-name: slidein;
animation-iteration-count: 3;
animation-direction: alternate;
}
@keyframes slidein {
from {
margin-left: 100%;
width: 300%;
}
to {
margin-left: 0%;
width: 100%;
}
}
```
#### Adding the animation event listeners
We'll use JavaScript code to listen for all three possible animation events. This code configures our event listeners; we call it when the document is first loaded in order to set things up.
```
const element = document.getElementById("watchme");
element.addEventListener("animationstart", listener, false);
element.addEventListener("animationend", listener, false);
element.addEventListener("animationiteration", listener, false);
element.className = "slidein";
```
This is pretty standard code; you can get details on how it works in the documentation for [`eventTarget.addEventListener()`](https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener). The last thing this code does is set the `class` on the element we'll be animating to "slidein"; we do this to start the animation.
Why? Because the `animationstart` event fires as soon as the animation starts, and in our case, that happens before our code runs. So we'll start the animation ourselves by setting the class of the element to the style that gets animated after the fact.
#### Receiving the events
The events get delivered to the `listener()` function, which is shown below.
```
function listener(event) {
const l = document.createElement("li");
switch(event.type) {
case "animationstart":
l.textContent = `Started: elapsed time is ${event.elapsedTime}`;
break;
case "animationend":
l.textContent = `Ended: elapsed time is ${event.elapsedTime}`;
break;
case "animationiteration":
l.textContent = `New loop started at time ${event.elapsedTime}`;
break;
}
document.getElementById("output").appendChild(l);
}
```
This code, too, is very simple. It looks at the [`event.type`](https://developer.mozilla.org/en-US/docs/Web/API/Event/type) to determine which kind of animation event occurred, then adds an appropriate note to the [`<ul>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/ul) (unordered list) we're using to log these events.
The output, when all is said and done, looks something like this:
* Started: elapsed time is 0
* New loop started at time 3.01200008392334
* New loop started at time 6.00600004196167
* Ended: elapsed time is 9.234000205993652
Note that the times are very close to, but not exactly, those expected given the timing established when the animation was configured. Note also that after the final iteration of the animation, the `animationiteration` event isn't sent; instead, the `animationend` event is sent.
Just for the sake of completeness, here's the HTML that displays the page content, including the list into which the script inserts information about the received events:
```
<h1 id="watchme">Watch me move</h1>
<p>
This example shows how to use CSS animations to make <code>H1</code>
elements move across the page.
</p>
<p>
In addition, we output some text each time an animation event fires, so you
can see them in action.
</p>
<ul id="output"></ul>
```
And here's the live output.
**Note:** Reload page to see the animation.
See also
--------
* [`AnimationEvent`](https://developer.mozilla.org/en-US/docs/Web/API/AnimationEvent)
* [Using CSS transitions](../css_transitions/using_css_transitions)
| programming_docs |
css CSS Animations tips and tricks CSS Animations tips and tricks
==============================
CSS Animations make it possible to do incredible things with the elements that make up your documents and apps. However, there are things you might want to do that aren't obvious, or clever ways to do things that you might not come up with right away. This article is a collection of tips and tricks we've found that may make your work easier, including how to run a stopped animation again.
Run an animation again
----------------------
The [CSS Animations](../css_animations) specification doesn't offer a way to run an animation again. There's no magic `resetAnimation()` method on elements, and you can't even just set the element's [`animation-play-state`](../animation-play-state) to `"running"` again. Instead, you have to use clever tricks to get a stopped animation to replay.
Here's one way to do it that we feel is stable and reliable enough to suggest to you.
### HTML content
First, let's define the HTML for a [`<div>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/div) we wish to animate and a button that will play (or replay) the animation.
```
<div class="box"></div>
<div class="runButton">Click me to run the animation</div>
```
### CSS content
Now we'll define the animation itself using CSS. Some CSS that's not important (the style of the "Run" button itself) isn't shown here, for brevity.
```
@keyframes colorchange {
0% {
background: yellow;
}
100% {
background: blue;
}
}
.box {
width: 100px;
height: 100px;
border: 1px solid black;
}
.changing {
animation: colorchange 2s;
}
```
There are two classes here. The `"box"` class is the basic description of the box's appearance, without any animation information included. The animation details are included in the `"changing"` class, which says that the [`@keyframes`](../@keyframes) named `"colorchange"` should be used over the course of two seconds to animate the box.
Note that because of this, the box doesn't start with any animation effects in place, so it won't be animating.
### JavaScript content
Next we'll look at the JavaScript that does the work. The meat of this technique is in the `play()` function, which is called when the user clicks on the "Run" button.
```
function play() {
document.querySelector(".box").className = "box";
requestAnimationFrame((time) => {
requestAnimationFrame((time) => {
document.querySelector(".box").className = "box changing";
});
});
}
```
This looks weird, doesn't it? That's because the only way to play an animation again is to remove the animation effect, let the document recompute styles so that it knows you've done that, then add the animation effect back to the element. To make that happen, we have to be creative.
Here's what happens when the `play()` function gets called:
1. The box's list of CSS classes is reset to `"box"`. This has the effect of removing any other classes currently applied to the box, including the `"changing"` class that handles animation. In other words, we're removing the animation effect from the box. However, changes to the class list don't take effect until the style recomputation is complete and a refresh has occurred to reflect the change.
2. To be sure that the styles are recalculated, we use [`window.requestAnimationFrame()`](https://developer.mozilla.org/en-US/docs/Web/API/window/requestAnimationFrame), specifying a callback. Our callback gets executed just before the next repaint of the document. The problem for us is that because it's before the repaint, the style recomputation hasn't actually happened yet!
3. Our callback cleverly calls `requestAnimationFrame()` a second time! This time, the callback is run before the next repaint, which is after the style recomputation has occurred. This callback adds the `"changing"` class back onto the box, so that the repaint will start the animation once again.
Of course, we also need to add an event handler to our "Run" button so it'll actually do something:
```
document.querySelector(".runButton").addEventListener("click", play, false);
```
### Result
Stopping an animation
---------------------
Removing the [`animation-name`](../animation-name) applied to an element will make it jump or cut to its next state. If instead you'd like the animation to complete and then come to a stop you have to try a different approach. The main tricks are:
1. Make your animation as self-contained as possible. This means you should not rely on `animation-direction: alternate`. Instead you should explicitly write a keyframe animation that goes through the full animation in one forward repetition.
2. Use JavaScript and clear the animation being used when the `animationiteration` event fires.
The following demo shows how you'd achieve the aforementioned JavaScript technique:
```
.slidein {
animation-duration: 5s;
animation-name: slidein;
animation-iteration-count: infinite;
}
.stopped {
animation-name: none;
}
@keyframes slidein {
0% {
margin-left: 0%;
}
50% {
margin-left: 50%;
}
100% {
margin-left: 0%;
}
}
```
```
<h1 id="watchme">Click me to stop</h1>
```
```
const watchme = document.getElementById('watchme');
watchme.className = 'slidein'
const listener = (e) => {
watchme.className = 'slidein stopped'
}
watchme.addEventListener('click', () =>
watchme.addEventListener('animationiteration', listener, false)
)
```
Demo <https://jsfiddle.net/morenoh149/5ty5a4oy/>
See also
--------
* [Using CSS transitions](../css_transitions/using_css_transitions)
* [`Window.requestAnimationFrame()`](https://developer.mozilla.org/en-US/docs/Web/API/window/requestAnimationFrame)
css scroll() scroll()
========
**Experimental:** **This is an [experimental technology](https://developer.mozilla.org/en-US/docs/MDN/Writing_guidelines/Experimental_deprecated_obsolete#experimental)**
Check the [Browser compatibility table](#browser_compatibility) carefully before using this in production.
The `scroll()` [CSS function](../css_functions) can be used with [`animation-timeline`](../animation-timeline) to indicate an ancestor element and scrollbar axis that will provide the anonymous scroll timeline for animating the current element.
The function is used to specify whether the element that provides the scroll timeline is the root element, or the nearest ancestor element that has any scrollbars. It also sets which scroll axis provides the scroll timeline.
Note that if the indicated axis does not contain a scrollbar then the animation timeline will be inactive (have zero progress).
Syntax
------
```
animation-timeline: scroll();
/\* values for both axis and scroller element \*/
animation-timeline: scroll(block nearest); /\* Default \*/
animation-timeline: scroll(inline nearest);
animation-timeline: scroll(vertical nearest);
animation-timeline: scroll(horizontal nearest);
animation-timeline: scroll(block root);
animation-timeline: scroll(inline root);
animation-timeline: scroll(vertical root);
animation-timeline: scroll(horizontal root);
/\* values for either axis or scroller element \*/
animation-timeline: scroll(nearest);
animation-timeline: scroll(root);
animation-timeline: scroll(inline);
animation-timeline: scroll(vertical);
animation-timeline: scroll(vertical);
animation-timeline: scroll(horizontal);
```
### Parameters
Allowed values for indicating the element that will provide the scroll timeline:
`nearest` (Default) The first parent of this element that has scrollbars in either axis.
`root` The root element.
Allowed values for the scrollbar axis are:
`block` (Default) Scrollbar in the block axis of the scroll container. The block axis is the direction perpendicular to the flow of text within a line. For horizontal writing modes, such as standard English, this is the same as `vertical`, while for vertical writing modes it is the same as `horizontal`.
`inline` Scrollbar in the inline axis of the scroll container. The inline axis is the direction parallel to the flow of text in a line. For horizontal writing modes this is the same as the `horizontal` axis, while for vertical writing modes this is the same as `vertical`.
`vertical` Scrollbar in the vertical axis of the scroll container.
`horizontal` Scrollbar in the horizontal axis of the scroll container.
### Formal syntax
```
<scroll()> =
scroll( [[](../value_definition_syntax#brackets) <scroller> [||](../value_definition_syntax#double_bar) <axis> []](../value_definition_syntax#brackets)[?](../value_definition_syntax#question_mark) )
<scroller> =
root [|](../value_definition_syntax#single_bar)
nearest
<axis> =
block [|](../value_definition_syntax#single_bar)
inline [|](../value_definition_syntax#single_bar)
vertical [|](../value_definition_syntax#single_bar)
horizontal
```
Examples
--------
### Setting an anonymous scroll timeline
The `#square` element is animated using an anonymous scrollbar timeline, which is applied to the element to be animated using the `scroll()` functional notation. The timeline in this particular example is provided by the nearest parent element that has (any) scrollbar, from the scrollbar in the block direction.
#### HTML
The HTML for the example is shown below.
```
<div id="container">
<div id="square"></div>
<div id="stretcher"></div>
</div>
```
#### CSS
The CSS below defines a square that rotates in alternate directions according to the timeline provided by the `animation-timeline` property. In this case the timeline is provided by `scroll(block nearest)`, which means that it will select the scrollbar in the block direction of the nearest ancestor element that has scrollbars; in this case the vertical scrollbar of the "container" element.
Note that the `block nearest` options below are actually the default, so we could instead just have had: `scroll()`.
```
#square {
background-color: deeppink;
width: 100px;
height: 100px;
margin-top: 100px;
position: absolute;
bottom: 0;
animation-name: rotateAnimation;
animation-duration: 3s;
animation-direction: alternate;
animation-timeline: scroll(block nearest);
}
@keyframes rotateAnimation {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}
```
The CSS for the container sets its height to 300px and we also set the container to create a vertical scrollbar if it overflows. The "stretcher" CSS sets the block height to 600px, which forces the container element to overflow. These two together ensure that the container has a vertical scrollbar, which allows it to be used as the source of the anonymous scrollbar timeline.
```
#container {
height: 300px;
overflow-y: scroll;
position: relative;
}
#stretcher {
height: 600px;
}
```
#### Result
Scroll to see the square element being animated.
Specifications
--------------
| Specification |
| --- |
| [Scroll-linked Animations # funcdef-scroll](https://w3c.github.io/csswg-drafts/scroll-animations-1/#funcdef-scroll) |
Browser compatibility
---------------------
| | Desktop | Mobile |
| --- | --- | --- |
| | Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet |
| `scroll` | No | No | 101
Zero scroll range is treated as 100% but should be 0% (see [bug 1780865](https://bugzil.la/1780865)). | No | No | No | No | No | No | No | No | No |
See also
--------
* [Using CSS animations](../css_animations/using_css_animations)
* [`scroll-timeline-axis`](../scroll-timeline-axis)
* [`scroll-timeline`](../scroll-timeline)
* [`animation-timeline`](../animation-timeline)
rust Rust Documentation Rust Documentation
==================
*by Steve Klabnik and Carol Nichols, with contributions from the Rust Community*
This version of the text assumes you’re using Rust 1.62 (released 2022-06-30) or later. See the [“Installation” section of Chapter 1](book/ch01-01-installation) to install or update Rust.
The HTML format is available online at [https://doc.rust-lang.org/stable/book/](https://doc.rust-lang.org/stable/book/index.html) and offline with installations of Rust made with `rustup`; run `rustup docs --book` to open.
Several community [translations](book/appendix-06-translation) are also available.
This text is available in [paperback and ebook format from No Starch Press](https://nostarch.com/rust).
> **🚨 Want a more interactive learning experience? Try out a different version of the Rust Book, featuring: quizzes, highlighting, visualizations, and more**: <https://rust-book.cs.brown.edu>
>
>
rust If you are not automatically redirected to the error code index, please here. If you are not automatically redirected to the error code index, please [here](https://doc.rust-lang.org/error_codes/error-index.html).
=======================================================================================================================================
rust Macro std::try Macro std::try
==============
```
macro_rules! try {
($expr:expr $(,)?) => { ... };
}
```
👎Deprecated since 1.39.0: use the `?` operator instead
Unwraps a result or propagates its error.
The [`?` operator](../book/ch09-02-recoverable-errors-with-result#a-shortcut-for-propagating-errors-the--operator) was added to replace `try!` and should be used instead. Furthermore, `try` is a reserved word in Rust 2018, so if you must use it, you will need to use the [raw-identifier syntax](https://doc.rust-lang.org/rust-by-example/compatibility/raw_identifiers.html): `r#try`.
`try!` matches the given [`Result`](result/enum.result "Result"). In case of the `Ok` variant, the expression has the value of the wrapped value.
In case of the `Err` variant, it retrieves the inner error. `try!` then performs conversion using `From`. This provides automatic conversion between specialized errors and more general ones. The resulting error is then immediately returned.
Because of the early return, `try!` can only be used in functions that return [`Result`](result/enum.result "Result").
Examples
--------
```
use std::io;
use std::fs::File;
use std::io::prelude::*;
enum MyError {
FileWriteError
}
impl From<io::Error> for MyError {
fn from(e: io::Error) -> MyError {
MyError::FileWriteError
}
}
// The preferred method of quick returning Errors
fn write_to_file_question() -> Result<(), MyError> {
let mut file = File::create("my_best_friends.txt")?;
file.write_all(b"This is a list of my best friends.")?;
Ok(())
}
// The previous method of quick returning Errors
fn write_to_file_using_try() -> Result<(), MyError> {
let mut file = r#try!(File::create("my_best_friends.txt"));
r#try!(file.write_all(b"This is a list of my best friends."));
Ok(())
}
// This is equivalent to:
fn write_to_file_using_match() -> Result<(), MyError> {
let mut file = r#try!(File::create("my_best_friends.txt"));
match file.write_all(b"This is a list of my best friends.") {
Ok(v) => v,
Err(e) => return Err(From::from(e)),
}
Ok(())
}
```
rust List of all items List of all items
=================
### Structs
- [alloc::AllocError](alloc/struct.allocerror)
- [alloc::Global](alloc/struct.global)
- [alloc::Layout](alloc/struct.layout)
- [alloc::LayoutError](alloc/struct.layouterror)
- [alloc::System](alloc/struct.system)
- [any::Demand](any/struct.demand)
- [any::TypeId](any/struct.typeid)
- [array::IntoIter](array/struct.intoiter)
- [array::TryFromSliceError](array/struct.tryfromsliceerror)
- [ascii::EscapeDefault](ascii/struct.escapedefault)
- [async\_iter::FromIter](async_iter/struct.fromiter)
- [backtrace::Backtrace](backtrace/struct.backtrace)
- [backtrace::BacktraceFrame](backtrace/struct.backtraceframe)
- [boxed::Box](boxed/struct.box)
- [boxed::ThinBox](boxed/struct.thinbox)
- [cell::BorrowError](cell/struct.borrowerror)
- [cell::BorrowMutError](cell/struct.borrowmuterror)
- [cell::Cell](cell/struct.cell)
- [cell::LazyCell](cell/struct.lazycell)
- [cell::OnceCell](cell/struct.oncecell)
- [cell::Ref](cell/struct.ref)
- [cell::RefCell](cell/struct.refcell)
- [cell::RefMut](cell/struct.refmut)
- [cell::SyncUnsafeCell](cell/struct.syncunsafecell)
- [cell::UnsafeCell](cell/struct.unsafecell)
- [char::CharTryFromError](char/struct.chartryfromerror)
- [char::DecodeUtf16](char/struct.decodeutf16)
- [char::DecodeUtf16Error](char/struct.decodeutf16error)
- [char::EscapeDebug](char/struct.escapedebug)
- [char::EscapeDefault](char/struct.escapedefault)
- [char::EscapeUnicode](char/struct.escapeunicode)
- [char::ParseCharError](char/struct.parsecharerror)
- [char::ToLowercase](char/struct.tolowercase)
- [char::ToUppercase](char/struct.touppercase)
- [char::TryFromCharError](char/struct.tryfromcharerror)
- [cmp::Reverse](cmp/struct.reverse)
- [collections::BTreeMap](collections/struct.btreemap)
- [collections::BTreeSet](collections/struct.btreeset)
- [collections::BinaryHeap](collections/struct.binaryheap)
- [collections::HashMap](collections/struct.hashmap)
- [collections::HashSet](collections/struct.hashset)
- [collections::LinkedList](collections/struct.linkedlist)
- [collections::TryReserveError](collections/struct.tryreserveerror)
- [collections::VecDeque](collections/struct.vecdeque)
- [collections::binary\_heap::BinaryHeap](collections/binary_heap/struct.binaryheap)
- [collections::binary\_heap::Drain](collections/binary_heap/struct.drain)
- [collections::binary\_heap::DrainSorted](collections/binary_heap/struct.drainsorted)
- [collections::binary\_heap::IntoIter](collections/binary_heap/struct.intoiter)
- [collections::binary\_heap::IntoIterSorted](collections/binary_heap/struct.intoitersorted)
- [collections::binary\_heap::Iter](collections/binary_heap/struct.iter)
- [collections::binary\_heap::PeekMut](collections/binary_heap/struct.peekmut)
- [collections::btree\_map::BTreeMap](collections/btree_map/struct.btreemap)
- [collections::btree\_map::DrainFilter](collections/btree_map/struct.drainfilter)
- [collections::btree\_map::IntoIter](collections/btree_map/struct.intoiter)
- [collections::btree\_map::IntoKeys](collections/btree_map/struct.intokeys)
- [collections::btree\_map::IntoValues](collections/btree_map/struct.intovalues)
- [collections::btree\_map::Iter](collections/btree_map/struct.iter)
- [collections::btree\_map::IterMut](collections/btree_map/struct.itermut)
- [collections::btree\_map::Keys](collections/btree_map/struct.keys)
- [collections::btree\_map::OccupiedEntry](collections/btree_map/struct.occupiedentry)
- [collections::btree\_map::OccupiedError](collections/btree_map/struct.occupiederror)
- [collections::btree\_map::Range](collections/btree_map/struct.range)
- [collections::btree\_map::RangeMut](collections/btree_map/struct.rangemut)
- [collections::btree\_map::VacantEntry](collections/btree_map/struct.vacantentry)
- [collections::btree\_map::Values](collections/btree_map/struct.values)
- [collections::btree\_map::ValuesMut](collections/btree_map/struct.valuesmut)
- [collections::btree\_set::BTreeSet](collections/btree_set/struct.btreeset)
- [collections::btree\_set::Difference](collections/btree_set/struct.difference)
- [collections::btree\_set::DrainFilter](collections/btree_set/struct.drainfilter)
- [collections::btree\_set::Intersection](collections/btree_set/struct.intersection)
- [collections::btree\_set::IntoIter](collections/btree_set/struct.intoiter)
- [collections::btree\_set::Iter](collections/btree_set/struct.iter)
- [collections::btree\_set::Range](collections/btree_set/struct.range)
- [collections::btree\_set::SymmetricDifference](collections/btree_set/struct.symmetricdifference)
- [collections::btree\_set::Union](collections/btree_set/struct.union)
- [collections::hash\_map::DefaultHasher](collections/hash_map/struct.defaulthasher)
- [collections::hash\_map::Drain](collections/hash_map/struct.drain)
- [collections::hash\_map::DrainFilter](collections/hash_map/struct.drainfilter)
- [collections::hash\_map::HashMap](collections/hash_map/struct.hashmap)
- [collections::hash\_map::IntoIter](collections/hash_map/struct.intoiter)
- [collections::hash\_map::IntoKeys](collections/hash_map/struct.intokeys)
- [collections::hash\_map::IntoValues](collections/hash_map/struct.intovalues)
- [collections::hash\_map::Iter](collections/hash_map/struct.iter)
- [collections::hash\_map::IterMut](collections/hash_map/struct.itermut)
- [collections::hash\_map::Keys](collections/hash_map/struct.keys)
- [collections::hash\_map::OccupiedEntry](collections/hash_map/struct.occupiedentry)
- [collections::hash\_map::OccupiedError](collections/hash_map/struct.occupiederror)
- [collections::hash\_map::RandomState](collections/hash_map/struct.randomstate)
- [collections::hash\_map::RawEntryBuilder](collections/hash_map/struct.rawentrybuilder)
- [collections::hash\_map::RawEntryBuilderMut](collections/hash_map/struct.rawentrybuildermut)
- [collections::hash\_map::RawOccupiedEntryMut](collections/hash_map/struct.rawoccupiedentrymut)
- [collections::hash\_map::RawVacantEntryMut](collections/hash_map/struct.rawvacantentrymut)
- [collections::hash\_map::VacantEntry](collections/hash_map/struct.vacantentry)
- [collections::hash\_map::Values](collections/hash_map/struct.values)
- [collections::hash\_map::ValuesMut](collections/hash_map/struct.valuesmut)
- [collections::hash\_set::Difference](collections/hash_set/struct.difference)
- [collections::hash\_set::Drain](collections/hash_set/struct.drain)
- [collections::hash\_set::DrainFilter](collections/hash_set/struct.drainfilter)
- [collections::hash\_set::HashSet](collections/hash_set/struct.hashset)
- [collections::hash\_set::Intersection](collections/hash_set/struct.intersection)
- [collections::hash\_set::IntoIter](collections/hash_set/struct.intoiter)
- [collections::hash\_set::Iter](collections/hash_set/struct.iter)
- [collections::hash\_set::SymmetricDifference](collections/hash_set/struct.symmetricdifference)
- [collections::hash\_set::Union](collections/hash_set/struct.union)
- [collections::linked\_list::Cursor](collections/linked_list/struct.cursor)
- [collections::linked\_list::CursorMut](collections/linked_list/struct.cursormut)
- [collections::linked\_list::DrainFilter](collections/linked_list/struct.drainfilter)
- [collections::linked\_list::IntoIter](collections/linked_list/struct.intoiter)
- [collections::linked\_list::Iter](collections/linked_list/struct.iter)
- [collections::linked\_list::IterMut](collections/linked_list/struct.itermut)
- [collections::linked\_list::LinkedList](collections/linked_list/struct.linkedlist)
- [collections::vec\_deque::Drain](collections/vec_deque/struct.drain)
- [collections::vec\_deque::IntoIter](collections/vec_deque/struct.intoiter)
- [collections::vec\_deque::Iter](collections/vec_deque/struct.iter)
- [collections::vec\_deque::IterMut](collections/vec_deque/struct.itermut)
- [collections::vec\_deque::VecDeque](collections/vec_deque/struct.vecdeque)
- [env::Args](env/struct.args)
- [env::ArgsOs](env/struct.argsos)
- [env::JoinPathsError](env/struct.joinpathserror)
- [env::SplitPaths](env/struct.splitpaths)
- [env::Vars](env/struct.vars)
- [env::VarsOs](env/struct.varsos)
- [error::Report](error/struct.report)
- [ffi::CStr](ffi/struct.cstr)
- [ffi::CString](ffi/struct.cstring)
- [ffi::FromBytesWithNulError](ffi/struct.frombyteswithnulerror)
- [ffi::FromVecWithNulError](ffi/struct.fromvecwithnulerror)
- [ffi::IntoStringError](ffi/struct.intostringerror)
- [ffi::NulError](ffi/struct.nulerror)
- [ffi::OsStr](ffi/struct.osstr)
- [ffi::OsString](ffi/struct.osstring)
- [ffi::VaList](ffi/struct.valist)
- [ffi::VaListImpl](ffi/struct.valistimpl)
- [fmt::Arguments](fmt/struct.arguments)
- [fmt::DebugList](fmt/struct.debuglist)
- [fmt::DebugMap](fmt/struct.debugmap)
- [fmt::DebugSet](fmt/struct.debugset)
- [fmt::DebugStruct](fmt/struct.debugstruct)
- [fmt::DebugTuple](fmt/struct.debugtuple)
- [fmt::Error](fmt/struct.error)
- [fmt::Formatter](fmt/struct.formatter)
- [fs::DirBuilder](fs/struct.dirbuilder)
- [fs::DirEntry](fs/struct.direntry)
- [fs::File](fs/struct.file)
- [fs::FileTimes](fs/struct.filetimes)
- [fs::FileType](fs/struct.filetype)
- [fs::Metadata](fs/struct.metadata)
- [fs::OpenOptions](fs/struct.openoptions)
- [fs::Permissions](fs/struct.permissions)
- [fs::ReadDir](fs/struct.readdir)
- [future::Pending](future/struct.pending)
- [future::PollFn](future/struct.pollfn)
- [future::Ready](future/struct.ready)
- [hash::BuildHasherDefault](hash/struct.buildhasherdefault)
- [hash::SipHasher](hash/struct.siphasher)
- [io::BorrowedBuf](io/struct.borrowedbuf)
- [io::BorrowedCursor](io/struct.borrowedcursor)
- [io::BufReader](io/struct.bufreader)
- [io::BufWriter](io/struct.bufwriter)
- [io::Bytes](io/struct.bytes)
- [io::Chain](io/struct.chain)
- [io::Cursor](io/struct.cursor)
- [io::Empty](io/struct.empty)
- [io::Error](io/struct.error)
- [io::IntoInnerError](io/struct.intoinnererror)
- [io::IoSlice](io/struct.ioslice)
- [io::IoSliceMut](io/struct.ioslicemut)
- [io::LineWriter](io/struct.linewriter)
- [io::Lines](io/struct.lines)
- [io::Repeat](io/struct.repeat)
- [io::Sink](io/struct.sink)
- [io::Split](io/struct.split)
- [io::Stderr](io/struct.stderr)
- [io::StderrLock](io/struct.stderrlock)
- [io::Stdin](io/struct.stdin)
- [io::StdinLock](io/struct.stdinlock)
- [io::Stdout](io/struct.stdout)
- [io::StdoutLock](io/struct.stdoutlock)
- [io::Take](io/struct.take)
- [io::WriterPanicked](io/struct.writerpanicked)
- [iter::ArrayChunks](iter/struct.arraychunks)
- [iter::ByRefSized](iter/struct.byrefsized)
- [iter::Chain](iter/struct.chain)
- [iter::Cloned](iter/struct.cloned)
- [iter::Copied](iter/struct.copied)
- [iter::Cycle](iter/struct.cycle)
- [iter::Empty](iter/struct.empty)
- [iter::Enumerate](iter/struct.enumerate)
- [iter::Filter](iter/struct.filter)
- [iter::FilterMap](iter/struct.filtermap)
- [iter::FlatMap](iter/struct.flatmap)
- [iter::Flatten](iter/struct.flatten)
- [iter::FromFn](iter/struct.fromfn)
- [iter::Fuse](iter/struct.fuse)
- [iter::Inspect](iter/struct.inspect)
- [iter::Intersperse](iter/struct.intersperse)
- [iter::IntersperseWith](iter/struct.interspersewith)
- [iter::Map](iter/struct.map)
- [iter::MapWhile](iter/struct.mapwhile)
- [iter::Once](iter/struct.once)
- [iter::OnceWith](iter/struct.oncewith)
- [iter::Peekable](iter/struct.peekable)
- [iter::Repeat](iter/struct.repeat)
- [iter::RepeatWith](iter/struct.repeatwith)
- [iter::Rev](iter/struct.rev)
- [iter::Scan](iter/struct.scan)
- [iter::Skip](iter/struct.skip)
- [iter::SkipWhile](iter/struct.skipwhile)
- [iter::StepBy](iter/struct.stepby)
- [iter::Successors](iter/struct.successors)
- [iter::Take](iter/struct.take)
- [iter::TakeWhile](iter/struct.takewhile)
- [iter::Zip](iter/struct.zip)
- [marker::PhantomData](marker/struct.phantomdata)
- [marker::PhantomPinned](marker/struct.phantompinned)
- [mem::Assume](mem/struct.assume)
- [mem::Discriminant](mem/struct.discriminant)
- [mem::ManuallyDrop](mem/struct.manuallydrop)
- [net::AddrParseError](net/struct.addrparseerror)
- [net::Incoming](net/struct.incoming)
- [net::IntoIncoming](net/struct.intoincoming)
- [net::Ipv4Addr](net/struct.ipv4addr)
- [net::Ipv6Addr](net/struct.ipv6addr)
- [net::SocketAddrV4](net/struct.socketaddrv4)
- [net::SocketAddrV6](net/struct.socketaddrv6)
- [net::TcpListener](net/struct.tcplistener)
- [net::TcpStream](net/struct.tcpstream)
- [net::UdpSocket](net/struct.udpsocket)
- [num::NonZeroI128](num/struct.nonzeroi128)
- [num::NonZeroI16](num/struct.nonzeroi16)
- [num::NonZeroI32](num/struct.nonzeroi32)
- [num::NonZeroI64](num/struct.nonzeroi64)
- [num::NonZeroI8](num/struct.nonzeroi8)
- [num::NonZeroIsize](num/struct.nonzeroisize)
- [num::NonZeroU128](num/struct.nonzerou128)
- [num::NonZeroU16](num/struct.nonzerou16)
- [num::NonZeroU32](num/struct.nonzerou32)
- [num::NonZeroU64](num/struct.nonzerou64)
- [num::NonZeroU8](num/struct.nonzerou8)
- [num::NonZeroUsize](num/struct.nonzerousize)
- [num::ParseFloatError](num/struct.parsefloaterror)
- [num::ParseIntError](num/struct.parseinterror)
- [num::Saturating](num/struct.saturating)
- [num::TryFromIntError](num/struct.tryfrominterror)
- [num::Wrapping](num/struct.wrapping)
- [ops::Range](ops/struct.range)
- [ops::RangeFrom](ops/struct.rangefrom)
- [ops::RangeFull](ops/struct.rangefull)
- [ops::RangeInclusive](ops/struct.rangeinclusive)
- [ops::RangeTo](ops/struct.rangeto)
- [ops::RangeToInclusive](ops/struct.rangetoinclusive)
- [ops::Yeet](ops/struct.yeet)
- [option::IntoIter](option/struct.intoiter)
- [option::Iter](option/struct.iter)
- [option::IterMut](option/struct.itermut)
- [os::linux::process::PidFd](os/linux/process/struct.pidfd)
- [os::linux::raw::stat](os/linux/raw/struct.stat)
- [os::unix::io::BorrowedFd](os/unix/io/struct.borrowedfd)
- [os::unix::io::OwnedFd](os/unix/io/struct.ownedfd)
- [os::unix::net::Incoming](os/unix/net/struct.incoming)
- [os::unix::net::Messages](os/unix/net/struct.messages)
- [os::unix::net::ScmCredentials](os/unix/net/struct.scmcredentials)
- [os::unix::net::ScmRights](os/unix/net/struct.scmrights)
- [os::unix::net::SocketAddr](os/unix/net/struct.socketaddr)
- [os::unix::net::SocketAncillary](os/unix/net/struct.socketancillary)
- [os::unix::net::SocketCred](os/unix/net/struct.socketcred)
- [os::unix::net::UnixDatagram](os/unix/net/struct.unixdatagram)
- [os::unix::net::UnixListener](os/unix/net/struct.unixlistener)
- [os::unix::net::UnixStream](os/unix/net/struct.unixstream)
- [os::unix::ucred::UCred](os/unix/ucred/struct.ucred)
- [os::wasi::io::BorrowedFd](os/wasi/io/struct.borrowedfd)
- [os::wasi::io::OwnedFd](os/wasi/io/struct.ownedfd)
- [os::windows::ffi::EncodeWide](os/windows/ffi/struct.encodewide)
- [os::windows::io::BorrowedHandle](os/windows/io/struct.borrowedhandle)
- [os::windows::io::BorrowedSocket](os/windows/io/struct.borrowedsocket)
- [os::windows::io::HandleOrInvalid](os/windows/io/struct.handleorinvalid)
- [os::windows::io::HandleOrNull](os/windows/io/struct.handleornull)
- [os::windows::io::InvalidHandleError](os/windows/io/struct.invalidhandleerror)
- [os::windows::io::NullHandleError](os/windows/io/struct.nullhandleerror)
- [os::windows::io::OwnedHandle](os/windows/io/struct.ownedhandle)
- [os::windows::io::OwnedSocket](os/windows/io/struct.ownedsocket)
- [panic::AssertUnwindSafe](panic/struct.assertunwindsafe)
- [panic::Location](panic/struct.location)
- [panic::PanicInfo](panic/struct.panicinfo)
- [path::Ancestors](path/struct.ancestors)
- [path::Components](path/struct.components)
- [path::Display](path/struct.display)
- [path::Iter](path/struct.iter)
- [path::Path](path/struct.path)
- [path::PathBuf](path/struct.pathbuf)
- [path::PrefixComponent](path/struct.prefixcomponent)
- [path::StripPrefixError](path/struct.stripprefixerror)
- [pin::Pin](pin/struct.pin)
- [process::Child](process/struct.child)
- [process::ChildStderr](process/struct.childstderr)
- [process::ChildStdin](process/struct.childstdin)
- [process::ChildStdout](process/struct.childstdout)
- [process::Command](process/struct.command)
- [process::CommandArgs](process/struct.commandargs)
- [process::CommandEnvs](process/struct.commandenvs)
- [process::ExitCode](process/struct.exitcode)
- [process::ExitStatus](process/struct.exitstatus)
- [process::ExitStatusError](process/struct.exitstatuserror)
- [process::Output](process/struct.output)
- [process::Stdio](process/struct.stdio)
- [ptr::DynMetadata](ptr/struct.dynmetadata)
- [ptr::NonNull](ptr/struct.nonnull)
- [rc::Rc](rc/struct.rc)
- [rc::Weak](rc/struct.weak)
- [result::IntoIter](result/struct.intoiter)
- [result::Iter](result/struct.iter)
- [result::IterMut](result/struct.itermut)
- [simd::LaneCount](simd/struct.lanecount)
- [simd::Mask](simd/struct.mask)
- [simd::Simd](simd/struct.simd)
- [slice::ArrayChunks](slice/struct.arraychunks)
- [slice::ArrayChunksMut](slice/struct.arraychunksmut)
- [slice::ArrayWindows](slice/struct.arraywindows)
- [slice::Chunks](slice/struct.chunks)
- [slice::ChunksExact](slice/struct.chunksexact)
- [slice::ChunksExactMut](slice/struct.chunksexactmut)
- [slice::ChunksMut](slice/struct.chunksmut)
- [slice::EscapeAscii](slice/struct.escapeascii)
- [slice::GroupBy](slice/struct.groupby)
- [slice::GroupByMut](slice/struct.groupbymut)
- [slice::Iter](slice/struct.iter)
- [slice::IterMut](slice/struct.itermut)
- [slice::RChunks](slice/struct.rchunks)
- [slice::RChunksExact](slice/struct.rchunksexact)
- [slice::RChunksExactMut](slice/struct.rchunksexactmut)
- [slice::RChunksMut](slice/struct.rchunksmut)
- [slice::RSplit](slice/struct.rsplit)
- [slice::RSplitMut](slice/struct.rsplitmut)
- [slice::RSplitN](slice/struct.rsplitn)
- [slice::RSplitNMut](slice/struct.rsplitnmut)
- [slice::Split](slice/struct.split)
- [slice::SplitInclusive](slice/struct.splitinclusive)
- [slice::SplitInclusiveMut](slice/struct.splitinclusivemut)
- [slice::SplitMut](slice/struct.splitmut)
- [slice::SplitN](slice/struct.splitn)
- [slice::SplitNMut](slice/struct.splitnmut)
- [slice::Windows](slice/struct.windows)
- [str::Bytes](str/struct.bytes)
- [str::CharIndices](str/struct.charindices)
- [str::Chars](str/struct.chars)
- [str::EncodeUtf16](str/struct.encodeutf16)
- [str::EscapeDebug](str/struct.escapedebug)
- [str::EscapeDefault](str/struct.escapedefault)
- [str::EscapeUnicode](str/struct.escapeunicode)
- [str::Lines](str/struct.lines)
- [str::LinesAny](str/struct.linesany)
- [str::MatchIndices](str/struct.matchindices)
- [str::Matches](str/struct.matches)
- [str::ParseBoolError](str/struct.parseboolerror)
- [str::RMatchIndices](str/struct.rmatchindices)
- [str::RMatches](str/struct.rmatches)
- [str::RSplit](str/struct.rsplit)
- [str::RSplitN](str/struct.rsplitn)
- [str::RSplitTerminator](str/struct.rsplitterminator)
- [str::Split](str/struct.split)
- [str::SplitAsciiWhitespace](str/struct.splitasciiwhitespace)
- [str::SplitInclusive](str/struct.splitinclusive)
- [str::SplitN](str/struct.splitn)
- [str::SplitTerminator](str/struct.splitterminator)
- [str::SplitWhitespace](str/struct.splitwhitespace)
- [str::Utf8Chunk](str/struct.utf8chunk)
- [str::Utf8Chunks](str/struct.utf8chunks)
- [str::Utf8Error](str/struct.utf8error)
- [str::pattern::CharArrayRefSearcher](str/pattern/struct.chararrayrefsearcher)
- [str::pattern::CharArraySearcher](str/pattern/struct.chararraysearcher)
- [str::pattern::CharPredicateSearcher](str/pattern/struct.charpredicatesearcher)
- [str::pattern::CharSearcher](str/pattern/struct.charsearcher)
- [str::pattern::CharSliceSearcher](str/pattern/struct.charslicesearcher)
- [str::pattern::StrSearcher](str/pattern/struct.strsearcher)
- [string::Drain](string/struct.drain)
- [string::FromUtf16Error](string/struct.fromutf16error)
- [string::FromUtf8Error](string/struct.fromutf8error)
- [string::String](string/struct.string)
- [sync::Arc](sync/struct.arc)
- [sync::Barrier](sync/struct.barrier)
- [sync::BarrierWaitResult](sync/struct.barrierwaitresult)
- [sync::Condvar](sync/struct.condvar)
- [sync::Exclusive](sync/struct.exclusive)
- [sync::LazyLock](sync/struct.lazylock)
- [sync::Mutex](sync/struct.mutex)
- [sync::MutexGuard](sync/struct.mutexguard)
- [sync::Once](sync/struct.once)
- [sync::OnceLock](sync/struct.oncelock)
- [sync::OnceState](sync/struct.oncestate)
- [sync::PoisonError](sync/struct.poisonerror)
- [sync::RwLock](sync/struct.rwlock)
- [sync::RwLockReadGuard](sync/struct.rwlockreadguard)
- [sync::RwLockWriteGuard](sync/struct.rwlockwriteguard)
- [sync::WaitTimeoutResult](sync/struct.waittimeoutresult)
- [sync::Weak](sync/struct.weak)
- [sync::atomic::AtomicBool](sync/atomic/struct.atomicbool)
- [sync::atomic::AtomicI16](sync/atomic/struct.atomici16)
- [sync::atomic::AtomicI32](sync/atomic/struct.atomici32)
- [sync::atomic::AtomicI64](sync/atomic/struct.atomici64)
- [sync::atomic::AtomicI8](sync/atomic/struct.atomici8)
- [sync::atomic::AtomicIsize](sync/atomic/struct.atomicisize)
- [sync::atomic::AtomicPtr](sync/atomic/struct.atomicptr)
- [sync::atomic::AtomicU16](sync/atomic/struct.atomicu16)
- [sync::atomic::AtomicU32](sync/atomic/struct.atomicu32)
- [sync::atomic::AtomicU64](sync/atomic/struct.atomicu64)
- [sync::atomic::AtomicU8](sync/atomic/struct.atomicu8)
- [sync::atomic::AtomicUsize](sync/atomic/struct.atomicusize)
- [sync::mpsc::IntoIter](sync/mpsc/struct.intoiter)
- [sync::mpsc::Iter](sync/mpsc/struct.iter)
- [sync::mpsc::Receiver](sync/mpsc/struct.receiver)
- [sync::mpsc::RecvError](sync/mpsc/struct.recverror)
- [sync::mpsc::SendError](sync/mpsc/struct.senderror)
- [sync::mpsc::Sender](sync/mpsc/struct.sender)
- [sync::mpsc::SyncSender](sync/mpsc/struct.syncsender)
- [sync::mpsc::TryIter](sync/mpsc/struct.tryiter)
- [task::Context](task/struct.context)
- [task::RawWaker](task/struct.rawwaker)
- [task::RawWakerVTable](task/struct.rawwakervtable)
- [task::Ready](task/struct.ready)
- [task::Waker](task/struct.waker)
- [thread::AccessError](thread/struct.accesserror)
- [thread::Builder](thread/struct.builder)
- [thread::JoinHandle](thread/struct.joinhandle)
- [thread::LocalKey](thread/struct.localkey)
- [thread::Scope](thread/struct.scope)
- [thread::ScopedJoinHandle](thread/struct.scopedjoinhandle)
- [thread::Thread](thread/struct.thread)
- [thread::ThreadId](thread/struct.threadid)
- [time::Duration](time/struct.duration)
- [time::FromFloatSecsError](time/struct.fromfloatsecserror)
- [time::Instant](time/struct.instant)
- [time::SystemTime](time/struct.systemtime)
- [time::SystemTimeError](time/struct.systemtimeerror)
- [vec::Drain](vec/struct.drain)
- [vec::DrainFilter](vec/struct.drainfilter)
- [vec::IntoIter](vec/struct.intoiter)
- [vec::Splice](vec/struct.splice)
- [vec::Vec](vec/struct.vec)
### Enums
- [backtrace::BacktraceStatus](backtrace/enum.backtracestatus)
- [borrow::Cow](borrow/enum.cow)
- [cmp::Ordering](cmp/enum.ordering)
- [collections::TryReserveErrorKind](collections/enum.tryreserveerrorkind)
- [collections::btree\_map::Entry](collections/btree_map/enum.entry)
- [collections::hash\_map::Entry](collections/hash_map/enum.entry)
- [collections::hash\_map::RawEntryMut](collections/hash_map/enum.rawentrymut)
- [convert::Infallible](convert/enum.infallible)
- [env::VarError](env/enum.varerror)
- [ffi::c\_void](ffi/enum.c_void)
- [fmt::Alignment](fmt/enum.alignment)
- [io::ErrorKind](io/enum.errorkind)
- [io::SeekFrom](io/enum.seekfrom)
- [net::IpAddr](net/enum.ipaddr)
- [net::Ipv6MulticastScope](net/enum.ipv6multicastscope)
- [net::Shutdown](net/enum.shutdown)
- [net::SocketAddr](net/enum.socketaddr)
- [num::FpCategory](num/enum.fpcategory)
- [num::IntErrorKind](num/enum.interrorkind)
- [ops::Bound](ops/enum.bound)
- [ops::ControlFlow](ops/enum.controlflow)
- [ops::GeneratorState](ops/enum.generatorstate)
- [option::Option](option/enum.option)
- [os::unix::net::AncillaryData](os/unix/net/enum.ancillarydata)
- [os::unix::net::AncillaryError](os/unix/net/enum.ancillaryerror)
- [panic::BacktraceStyle](panic/enum.backtracestyle)
- [path::Component](path/enum.component)
- [path::Prefix](path/enum.prefix)
- [result::Result](result/enum.result)
- [simd::Which](simd/enum.which)
- [str::pattern::SearchStep](str/pattern/enum.searchstep)
- [sync::TryLockError](sync/enum.trylockerror)
- [sync::atomic::Ordering](sync/atomic/enum.ordering)
- [sync::mpsc::RecvTimeoutError](sync/mpsc/enum.recvtimeouterror)
- [sync::mpsc::TryRecvError](sync/mpsc/enum.tryrecverror)
- [sync::mpsc::TrySendError](sync/mpsc/enum.trysenderror)
- [task::Poll](task/enum.poll)
### Unions
- [mem::MaybeUninit](mem/union.maybeuninit)
### Primitives
- [array](primitive.array)
- [bool](primitive.bool)
- [char](primitive.char)
- [f32](primitive.f32)
- [f64](primitive.f64)
- [fn](primitive.fn)
- [i128](primitive.i128)
- [i16](primitive.i16)
- [i32](primitive.i32)
- [i64](primitive.i64)
- [i8](primitive.i8)
- [isize](primitive.isize)
- [never](primitive.never)
- [pointer](primitive.pointer)
- [reference](primitive.reference)
- [slice](primitive.slice)
- [str](primitive.str)
- [tuple](primitive.tuple)
- [u128](primitive.u128)
- [u16](primitive.u16)
- [u32](primitive.u32)
- [u64](primitive.u64)
- [u8](primitive.u8)
- [unit](primitive.unit)
- [usize](primitive.usize)
### Traits
- [alloc::Allocator](alloc/trait.allocator)
- [alloc::GlobalAlloc](alloc/trait.globalalloc)
- [any::Any](any/trait.any)
- [any::Provider](any/trait.provider)
- [ascii::AsciiExt](ascii/trait.asciiext)
- [async\_iter::AsyncIterator](async_iter/trait.asynciterator)
- [borrow::Borrow](borrow/trait.borrow)
- [borrow::BorrowMut](borrow/trait.borrowmut)
- [borrow::ToOwned](borrow/trait.toowned)
- [clone::Clone](clone/trait.clone)
- [cmp::Eq](cmp/trait.eq)
- [cmp::Ord](cmp/trait.ord)
- [cmp::PartialEq](cmp/trait.partialeq)
- [cmp::PartialOrd](cmp/trait.partialord)
- [convert::AsMut](convert/trait.asmut)
- [convert::AsRef](convert/trait.asref)
- [convert::FloatToInt](convert/trait.floattoint)
- [convert::From](convert/trait.from)
- [convert::Into](convert/trait.into)
- [convert::TryFrom](convert/trait.tryfrom)
- [convert::TryInto](convert/trait.tryinto)
- [default::Default](default/trait.default)
- [error::Error](error/trait.error)
- [fmt::Binary](fmt/trait.binary)
- [fmt::Debug](fmt/trait.debug)
- [fmt::Display](fmt/trait.display)
- [fmt::LowerExp](fmt/trait.lowerexp)
- [fmt::LowerHex](fmt/trait.lowerhex)
- [fmt::Octal](fmt/trait.octal)
- [fmt::Pointer](fmt/trait.pointer)
- [fmt::UpperExp](fmt/trait.upperexp)
- [fmt::UpperHex](fmt/trait.upperhex)
- [fmt::Write](fmt/trait.write)
- [future::Future](future/trait.future)
- [future::IntoFuture](future/trait.intofuture)
- [hash::BuildHasher](hash/trait.buildhasher)
- [hash::Hash](hash/trait.hash)
- [hash::Hasher](hash/trait.hasher)
- [io::BufRead](io/trait.bufread)
- [io::Read](io/trait.read)
- [io::Seek](io/trait.seek)
- [io::Write](io/trait.write)
- [iter::DoubleEndedIterator](iter/trait.doubleendediterator)
- [iter::ExactSizeIterator](iter/trait.exactsizeiterator)
- [iter::Extend](iter/trait.extend)
- [iter::FromIterator](iter/trait.fromiterator)
- [iter::FusedIterator](iter/trait.fusediterator)
- [iter::IntoIterator](iter/trait.intoiterator)
- [iter::Iterator](iter/trait.iterator)
- [iter::Product](iter/trait.product)
- [iter::Step](iter/trait.step)
- [iter::Sum](iter/trait.sum)
- [iter::TrustedLen](iter/trait.trustedlen)
- [iter::TrustedStep](iter/trait.trustedstep)
- [marker::Copy](marker/trait.copy)
- [marker::Destruct](marker/trait.destruct)
- [marker::DiscriminantKind](marker/trait.discriminantkind)
- [marker::Send](marker/trait.send)
- [marker::Sized](marker/trait.sized)
- [marker::StructuralEq](marker/trait.structuraleq)
- [marker::StructuralPartialEq](marker/trait.structuralpartialeq)
- [marker::Sync](marker/trait.sync)
- [marker::Tuple](marker/trait.tuple)
- [marker::Unpin](marker/trait.unpin)
- [marker::Unsize](marker/trait.unsize)
- [mem::BikeshedIntrinsicFrom](mem/trait.bikeshedintrinsicfrom)
- [net::ToSocketAddrs](net/trait.tosocketaddrs)
- [ops::Add](ops/trait.add)
- [ops::AddAssign](ops/trait.addassign)
- [ops::BitAnd](ops/trait.bitand)
- [ops::BitAndAssign](ops/trait.bitandassign)
- [ops::BitOr](ops/trait.bitor)
- [ops::BitOrAssign](ops/trait.bitorassign)
- [ops::BitXor](ops/trait.bitxor)
- [ops::BitXorAssign](ops/trait.bitxorassign)
- [ops::CoerceUnsized](ops/trait.coerceunsized)
- [ops::Deref](ops/trait.deref)
- [ops::DerefMut](ops/trait.derefmut)
- [ops::DispatchFromDyn](ops/trait.dispatchfromdyn)
- [ops::Div](ops/trait.div)
- [ops::DivAssign](ops/trait.divassign)
- [ops::Drop](ops/trait.drop)
- [ops::Fn](ops/trait.fn)
- [ops::FnMut](ops/trait.fnmut)
- [ops::FnOnce](ops/trait.fnonce)
- [ops::FromResidual](ops/trait.fromresidual)
- [ops::Generator](ops/trait.generator)
- [ops::Index](ops/trait.index)
- [ops::IndexMut](ops/trait.indexmut)
- [ops::Mul](ops/trait.mul)
- [ops::MulAssign](ops/trait.mulassign)
- [ops::Neg](ops/trait.neg)
- [ops::Not](ops/trait.not)
- [ops::OneSidedRange](ops/trait.onesidedrange)
- [ops::RangeBounds](ops/trait.rangebounds)
- [ops::Rem](ops/trait.rem)
- [ops::RemAssign](ops/trait.remassign)
- [ops::Residual](ops/trait.residual)
- [ops::Shl](ops/trait.shl)
- [ops::ShlAssign](ops/trait.shlassign)
- [ops::Shr](ops/trait.shr)
- [ops::ShrAssign](ops/trait.shrassign)
- [ops::Sub](ops/trait.sub)
- [ops::SubAssign](ops/trait.subassign)
- [ops::Try](ops/trait.try)
- [os::linux::fs::MetadataExt](os/linux/fs/trait.metadataext)
- [os::linux::net::TcpStreamExt](os/linux/net/trait.tcpstreamext)
- [os::linux::process::ChildExt](os/linux/process/trait.childext)
- [os::linux::process::CommandExt](os/linux/process/trait.commandext)
- [os::unix::ffi::OsStrExt](os/unix/ffi/trait.osstrext)
- [os::unix::ffi::OsStringExt](os/unix/ffi/trait.osstringext)
- [os::unix::fs::DirBuilderExt](os/unix/fs/trait.dirbuilderext)
- [os::unix::fs::DirEntryExt](os/unix/fs/trait.direntryext)
- [os::unix::fs::DirEntryExt2](os/unix/fs/trait.direntryext2)
- [os::unix::fs::FileExt](os/unix/fs/trait.fileext)
- [os::unix::fs::FileTypeExt](os/unix/fs/trait.filetypeext)
- [os::unix::fs::MetadataExt](os/unix/fs/trait.metadataext)
- [os::unix::fs::OpenOptionsExt](os/unix/fs/trait.openoptionsext)
- [os::unix::fs::PermissionsExt](os/unix/fs/trait.permissionsext)
- [os::unix::io::AsFd](os/unix/io/trait.asfd)
- [os::unix::io::AsRawFd](os/unix/io/trait.asrawfd)
- [os::unix::io::FromRawFd](os/unix/io/trait.fromrawfd)
- [os::unix::io::IntoRawFd](os/unix/io/trait.intorawfd)
- [os::unix::process::CommandExt](os/unix/process/trait.commandext)
- [os::unix::process::ExitStatusExt](os/unix/process/trait.exitstatusext)
- [os::unix::thread::JoinHandleExt](os/unix/thread/trait.joinhandleext)
- [os::wasi::ffi::OsStrExt](os/wasi/ffi/trait.osstrext)
- [os::wasi::ffi::OsStringExt](os/wasi/ffi/trait.osstringext)
- [os::wasi::fs::DirEntryExt](os/wasi/fs/trait.direntryext)
- [os::wasi::fs::FileExt](os/wasi/fs/trait.fileext)
- [os::wasi::fs::FileTypeExt](os/wasi/fs/trait.filetypeext)
- [os::wasi::fs::MetadataExt](os/wasi/fs/trait.metadataext)
- [os::wasi::fs::OpenOptionsExt](os/wasi/fs/trait.openoptionsext)
- [os::wasi::io::AsFd](os/wasi/io/trait.asfd)
- [os::wasi::io::AsRawFd](os/wasi/io/trait.asrawfd)
- [os::wasi::io::FromRawFd](os/wasi/io/trait.fromrawfd)
- [os::wasi::io::IntoRawFd](os/wasi/io/trait.intorawfd)
- [os::wasi::net::TcpListenerExt](os/wasi/net/trait.tcplistenerext)
- [os::windows::ffi::OsStrExt](os/windows/ffi/trait.osstrext)
- [os::windows::ffi::OsStringExt](os/windows/ffi/trait.osstringext)
- [os::windows::fs::FileExt](os/windows/fs/trait.fileext)
- [os::windows::fs::FileTypeExt](os/windows/fs/trait.filetypeext)
- [os::windows::fs::MetadataExt](os/windows/fs/trait.metadataext)
- [os::windows::fs::OpenOptionsExt](os/windows/fs/trait.openoptionsext)
- [os::windows::io::AsHandle](os/windows/io/trait.ashandle)
- [os::windows::io::AsRawHandle](os/windows/io/trait.asrawhandle)
- [os::windows::io::AsRawSocket](os/windows/io/trait.asrawsocket)
- [os::windows::io::AsSocket](os/windows/io/trait.assocket)
- [os::windows::io::FromRawHandle](os/windows/io/trait.fromrawhandle)
- [os::windows::io::FromRawSocket](os/windows/io/trait.fromrawsocket)
- [os::windows::io::IntoRawHandle](os/windows/io/trait.intorawhandle)
- [os::windows::io::IntoRawSocket](os/windows/io/trait.intorawsocket)
- [os::windows::process::ChildExt](os/windows/process/trait.childext)
- [os::windows::process::CommandExt](os/windows/process/trait.commandext)
- [os::windows::process::ExitCodeExt](os/windows/process/trait.exitcodeext)
- [os::windows::process::ExitStatusExt](os/windows/process/trait.exitstatusext)
- [panic::RefUnwindSafe](panic/trait.refunwindsafe)
- [panic::UnwindSafe](panic/trait.unwindsafe)
- [process::Termination](process/trait.termination)
- [ptr::Pointee](ptr/trait.pointee)
- [simd::MaskElement](simd/trait.maskelement)
- [simd::SimdElement](simd/trait.simdelement)
- [simd::SimdFloat](simd/trait.simdfloat)
- [simd::SimdInt](simd/trait.simdint)
- [simd::SimdOrd](simd/trait.simdord)
- [simd::SimdPartialEq](simd/trait.simdpartialeq)
- [simd::SimdPartialOrd](simd/trait.simdpartialord)
- [simd::SimdUint](simd/trait.simduint)
- [simd::StdFloat](simd/trait.stdfloat)
- [simd::SupportedLaneCount](simd/trait.supportedlanecount)
- [simd::Swizzle](simd/trait.swizzle)
- [simd::Swizzle2](simd/trait.swizzle2)
- [simd::ToBitMask](simd/trait.tobitmask)
- [slice::Concat](slice/trait.concat)
- [slice::Join](slice/trait.join)
- [slice::SliceIndex](slice/trait.sliceindex)
- [str::FromStr](str/trait.fromstr)
- [str::pattern::DoubleEndedSearcher](str/pattern/trait.doubleendedsearcher)
- [str::pattern::Pattern](str/pattern/trait.pattern)
- [str::pattern::ReverseSearcher](str/pattern/trait.reversesearcher)
- [str::pattern::Searcher](str/pattern/trait.searcher)
- [string::ToString](string/trait.tostring)
- [task::Wake](task/trait.wake)
### Macros
- [arch::is\_aarch64\_feature\_detected](arch/macro.is_aarch64_feature_detected)
- [arch::is\_arm\_feature\_detected](arch/macro.is_arm_feature_detected)
- [arch::is\_mips64\_feature\_detected](arch/macro.is_mips64_feature_detected)
- [arch::is\_mips\_feature\_detected](arch/macro.is_mips_feature_detected)
- [arch::is\_powerpc64\_feature\_detected](arch/macro.is_powerpc64_feature_detected)
- [arch::is\_powerpc\_feature\_detected](arch/macro.is_powerpc_feature_detected)
- [arch::is\_riscv\_feature\_detected](arch/macro.is_riscv_feature_detected)
- [arch::is\_x86\_feature\_detected](arch/macro.is_x86_feature_detected)
- [assert](macro.assert)
- [assert\_eq](macro.assert_eq)
- [assert\_matches::assert\_matches](assert_matches/macro.assert_matches)
- [assert\_matches::debug\_assert\_matches](assert_matches/macro.debug_assert_matches)
- [assert\_ne](macro.assert_ne)
- [cfg](macro.cfg)
- [clone::Clone](clone/macro.clone)
- [cmp::Eq](cmp/macro.eq)
- [cmp::Ord](cmp/macro.ord)
- [cmp::PartialEq](cmp/macro.partialeq)
- [cmp::PartialOrd](cmp/macro.partialord)
- [column](macro.column)
- [compile\_error](macro.compile_error)
- [concat](macro.concat)
- [concat\_bytes](macro.concat_bytes)
- [concat\_idents](macro.concat_idents)
- [const\_format\_args](macro.const_format_args)
- [dbg](macro.dbg)
- [debug\_assert](macro.debug_assert)
- [debug\_assert\_eq](macro.debug_assert_eq)
- [debug\_assert\_ne](macro.debug_assert_ne)
- [default::Default](default/macro.default)
- [env](macro.env)
- [eprint](macro.eprint)
- [eprintln](macro.eprintln)
- [file](macro.file)
- [fmt::Debug](fmt/macro.debug)
- [format](macro.format)
- [format\_args](macro.format_args)
- [format\_args\_nl](macro.format_args_nl)
- [future::join](future/macro.join)
- [hash::Hash](hash/macro.hash)
- [include](macro.include)
- [include\_bytes](macro.include_bytes)
- [include\_str](macro.include_str)
- [is\_x86\_feature\_detected](macro.is_x86_feature_detected)
- [line](macro.line)
- [log\_syntax](macro.log_syntax)
- [marker::Copy](marker/macro.copy)
- [matches](macro.matches)
- [module\_path](macro.module_path)
- [option\_env](macro.option_env)
- [panic](macro.panic)
- [pin::pin](pin/macro.pin)
- [prelude::v1::bench](prelude/v1/macro.bench)
- [prelude::v1::cfg\_accessible](prelude/v1/macro.cfg_accessible)
- [prelude::v1::cfg\_eval](prelude/v1/macro.cfg_eval)
- [prelude::v1::derive](prelude/v1/macro.derive)
- [prelude::v1::global\_allocator](prelude/v1/macro.global_allocator)
- [prelude::v1::test](prelude/v1/macro.test)
- [prelude::v1::test\_case](prelude/v1/macro.test_case)
- [print](macro.print)
- [println](macro.println)
- [ptr::addr\_of](ptr/macro.addr_of)
- [ptr::addr\_of\_mut](ptr/macro.addr_of_mut)
- [simd::simd\_swizzle](simd/macro.simd_swizzle)
- [stringify](macro.stringify)
- [task::ready](task/macro.ready)
- [thread\_local](macro.thread_local)
- [todo](macro.todo)
- [trace\_macros](macro.trace_macros)
- [try](macro.try)
- [unimplemented](macro.unimplemented)
- [unreachable](macro.unreachable)
- [vec](macro.vec)
- [write](macro.write)
- [writeln](macro.writeln)
### Functions
- [alloc::alloc](alloc/fn.alloc)
- [alloc::alloc\_zeroed](alloc/fn.alloc_zeroed)
- [alloc::dealloc](alloc/fn.dealloc)
- [alloc::handle\_alloc\_error](alloc/fn.handle_alloc_error)
- [alloc::realloc](alloc/fn.realloc)
- [alloc::set\_alloc\_error\_hook](alloc/fn.set_alloc_error_hook)
- [alloc::take\_alloc\_error\_hook](alloc/fn.take_alloc_error_hook)
- [any::request\_ref](any/fn.request_ref)
- [any::request\_value](any/fn.request_value)
- [any::type\_name](any/fn.type_name)
- [any::type\_name\_of\_val](any/fn.type_name_of_val)
- [array::from\_fn](array/fn.from_fn)
- [array::from\_mut](array/fn.from_mut)
- [array::from\_ref](array/fn.from_ref)
- [array::try\_from\_fn](array/fn.try_from_fn)
- [ascii::escape\_default](ascii/fn.escape_default)
- [async\_iter::from\_iter](async_iter/fn.from_iter)
- [char::decode\_utf16](char/fn.decode_utf16)
- [char::from\_digit](char/fn.from_digit)
- [char::from\_u32](char/fn.from_u32)
- [char::from\_u32\_unchecked](char/fn.from_u32_unchecked)
- [cmp::max](cmp/fn.max)
- [cmp::max\_by](cmp/fn.max_by)
- [cmp::max\_by\_key](cmp/fn.max_by_key)
- [cmp::min](cmp/fn.min)
- [cmp::min\_by](cmp/fn.min_by)
- [cmp::min\_by\_key](cmp/fn.min_by_key)
- [convert::identity](convert/fn.identity)
- [default::default](default/fn.default)
- [env::args](env/fn.args)
- [env::args\_os](env/fn.args_os)
- [env::current\_dir](env/fn.current_dir)
- [env::current\_exe](env/fn.current_exe)
- [env::home\_dir](env/fn.home_dir)
- [env::join\_paths](env/fn.join_paths)
- [env::remove\_var](env/fn.remove_var)
- [env::set\_current\_dir](env/fn.set_current_dir)
- [env::set\_var](env/fn.set_var)
- [env::split\_paths](env/fn.split_paths)
- [env::temp\_dir](env/fn.temp_dir)
- [env::var](env/fn.var)
- [env::var\_os](env/fn.var_os)
- [env::vars](env/fn.vars)
- [env::vars\_os](env/fn.vars_os)
- [fmt::format](fmt/fn.format)
- [fmt::write](fmt/fn.write)
- [fs::canonicalize](fs/fn.canonicalize)
- [fs::copy](fs/fn.copy)
- [fs::create\_dir](fs/fn.create_dir)
- [fs::create\_dir\_all](fs/fn.create_dir_all)
- [fs::hard\_link](fs/fn.hard_link)
- [fs::metadata](fs/fn.metadata)
- [fs::read](fs/fn.read)
- [fs::read\_dir](fs/fn.read_dir)
- [fs::read\_link](fs/fn.read_link)
- [fs::read\_to\_string](fs/fn.read_to_string)
- [fs::remove\_dir](fs/fn.remove_dir)
- [fs::remove\_dir\_all](fs/fn.remove_dir_all)
- [fs::remove\_file](fs/fn.remove_file)
- [fs::rename](fs/fn.rename)
- [fs::set\_permissions](fs/fn.set_permissions)
- [fs::soft\_link](fs/fn.soft_link)
- [fs::symlink\_metadata](fs/fn.symlink_metadata)
- [fs::try\_exists](fs/fn.try_exists)
- [fs::write](fs/fn.write)
- [future::pending](future/fn.pending)
- [future::poll\_fn](future/fn.poll_fn)
- [future::ready](future/fn.ready)
- [hint::black\_box](hint/fn.black_box)
- [hint::must\_use](hint/fn.must_use)
- [hint::spin\_loop](hint/fn.spin_loop)
- [hint::unreachable\_unchecked](hint/fn.unreachable_unchecked)
- [intrinsics::abort](intrinsics/fn.abort)
- [intrinsics::add\_with\_overflow](intrinsics/fn.add_with_overflow)
- [intrinsics::arith\_offset](intrinsics/fn.arith_offset)
- [intrinsics::assert\_inhabited](intrinsics/fn.assert_inhabited)
- [intrinsics::assert\_uninit\_valid](intrinsics/fn.assert_uninit_valid)
- [intrinsics::assert\_zero\_valid](intrinsics/fn.assert_zero_valid)
- [intrinsics::assume](intrinsics/fn.assume)
- [intrinsics::atomic\_and\_acqrel](intrinsics/fn.atomic_and_acqrel)
- [intrinsics::atomic\_and\_acquire](intrinsics/fn.atomic_and_acquire)
- [intrinsics::atomic\_and\_relaxed](intrinsics/fn.atomic_and_relaxed)
- [intrinsics::atomic\_and\_release](intrinsics/fn.atomic_and_release)
- [intrinsics::atomic\_and\_seqcst](intrinsics/fn.atomic_and_seqcst)
- [intrinsics::atomic\_cxchg\_acqrel\_acquire](intrinsics/fn.atomic_cxchg_acqrel_acquire)
- [intrinsics::atomic\_cxchg\_acqrel\_relaxed](intrinsics/fn.atomic_cxchg_acqrel_relaxed)
- [intrinsics::atomic\_cxchg\_acqrel\_seqcst](intrinsics/fn.atomic_cxchg_acqrel_seqcst)
- [intrinsics::atomic\_cxchg\_acquire\_acquire](intrinsics/fn.atomic_cxchg_acquire_acquire)
- [intrinsics::atomic\_cxchg\_acquire\_relaxed](intrinsics/fn.atomic_cxchg_acquire_relaxed)
- [intrinsics::atomic\_cxchg\_acquire\_seqcst](intrinsics/fn.atomic_cxchg_acquire_seqcst)
- [intrinsics::atomic\_cxchg\_relaxed\_acquire](intrinsics/fn.atomic_cxchg_relaxed_acquire)
- [intrinsics::atomic\_cxchg\_relaxed\_relaxed](intrinsics/fn.atomic_cxchg_relaxed_relaxed)
- [intrinsics::atomic\_cxchg\_relaxed\_seqcst](intrinsics/fn.atomic_cxchg_relaxed_seqcst)
- [intrinsics::atomic\_cxchg\_release\_acquire](intrinsics/fn.atomic_cxchg_release_acquire)
- [intrinsics::atomic\_cxchg\_release\_relaxed](intrinsics/fn.atomic_cxchg_release_relaxed)
- [intrinsics::atomic\_cxchg\_release\_seqcst](intrinsics/fn.atomic_cxchg_release_seqcst)
- [intrinsics::atomic\_cxchg\_seqcst\_acquire](intrinsics/fn.atomic_cxchg_seqcst_acquire)
- [intrinsics::atomic\_cxchg\_seqcst\_relaxed](intrinsics/fn.atomic_cxchg_seqcst_relaxed)
- [intrinsics::atomic\_cxchg\_seqcst\_seqcst](intrinsics/fn.atomic_cxchg_seqcst_seqcst)
- [intrinsics::atomic\_cxchgweak\_acqrel\_acquire](intrinsics/fn.atomic_cxchgweak_acqrel_acquire)
- [intrinsics::atomic\_cxchgweak\_acqrel\_relaxed](intrinsics/fn.atomic_cxchgweak_acqrel_relaxed)
- [intrinsics::atomic\_cxchgweak\_acqrel\_seqcst](intrinsics/fn.atomic_cxchgweak_acqrel_seqcst)
- [intrinsics::atomic\_cxchgweak\_acquire\_acquire](intrinsics/fn.atomic_cxchgweak_acquire_acquire)
- [intrinsics::atomic\_cxchgweak\_acquire\_relaxed](intrinsics/fn.atomic_cxchgweak_acquire_relaxed)
- [intrinsics::atomic\_cxchgweak\_acquire\_seqcst](intrinsics/fn.atomic_cxchgweak_acquire_seqcst)
- [intrinsics::atomic\_cxchgweak\_relaxed\_acquire](intrinsics/fn.atomic_cxchgweak_relaxed_acquire)
- [intrinsics::atomic\_cxchgweak\_relaxed\_relaxed](intrinsics/fn.atomic_cxchgweak_relaxed_relaxed)
- [intrinsics::atomic\_cxchgweak\_relaxed\_seqcst](intrinsics/fn.atomic_cxchgweak_relaxed_seqcst)
- [intrinsics::atomic\_cxchgweak\_release\_acquire](intrinsics/fn.atomic_cxchgweak_release_acquire)
- [intrinsics::atomic\_cxchgweak\_release\_relaxed](intrinsics/fn.atomic_cxchgweak_release_relaxed)
- [intrinsics::atomic\_cxchgweak\_release\_seqcst](intrinsics/fn.atomic_cxchgweak_release_seqcst)
- [intrinsics::atomic\_cxchgweak\_seqcst\_acquire](intrinsics/fn.atomic_cxchgweak_seqcst_acquire)
- [intrinsics::atomic\_cxchgweak\_seqcst\_relaxed](intrinsics/fn.atomic_cxchgweak_seqcst_relaxed)
- [intrinsics::atomic\_cxchgweak\_seqcst\_seqcst](intrinsics/fn.atomic_cxchgweak_seqcst_seqcst)
- [intrinsics::atomic\_fence\_acqrel](intrinsics/fn.atomic_fence_acqrel)
- [intrinsics::atomic\_fence\_acquire](intrinsics/fn.atomic_fence_acquire)
- [intrinsics::atomic\_fence\_release](intrinsics/fn.atomic_fence_release)
- [intrinsics::atomic\_fence\_seqcst](intrinsics/fn.atomic_fence_seqcst)
- [intrinsics::atomic\_load\_acquire](intrinsics/fn.atomic_load_acquire)
- [intrinsics::atomic\_load\_relaxed](intrinsics/fn.atomic_load_relaxed)
- [intrinsics::atomic\_load\_seqcst](intrinsics/fn.atomic_load_seqcst)
- [intrinsics::atomic\_load\_unordered](intrinsics/fn.atomic_load_unordered)
- [intrinsics::atomic\_max\_acqrel](intrinsics/fn.atomic_max_acqrel)
- [intrinsics::atomic\_max\_acquire](intrinsics/fn.atomic_max_acquire)
- [intrinsics::atomic\_max\_relaxed](intrinsics/fn.atomic_max_relaxed)
- [intrinsics::atomic\_max\_release](intrinsics/fn.atomic_max_release)
- [intrinsics::atomic\_max\_seqcst](intrinsics/fn.atomic_max_seqcst)
- [intrinsics::atomic\_min\_acqrel](intrinsics/fn.atomic_min_acqrel)
- [intrinsics::atomic\_min\_acquire](intrinsics/fn.atomic_min_acquire)
- [intrinsics::atomic\_min\_relaxed](intrinsics/fn.atomic_min_relaxed)
- [intrinsics::atomic\_min\_release](intrinsics/fn.atomic_min_release)
- [intrinsics::atomic\_min\_seqcst](intrinsics/fn.atomic_min_seqcst)
- [intrinsics::atomic\_nand\_acqrel](intrinsics/fn.atomic_nand_acqrel)
- [intrinsics::atomic\_nand\_acquire](intrinsics/fn.atomic_nand_acquire)
- [intrinsics::atomic\_nand\_relaxed](intrinsics/fn.atomic_nand_relaxed)
- [intrinsics::atomic\_nand\_release](intrinsics/fn.atomic_nand_release)
- [intrinsics::atomic\_nand\_seqcst](intrinsics/fn.atomic_nand_seqcst)
- [intrinsics::atomic\_or\_acqrel](intrinsics/fn.atomic_or_acqrel)
- [intrinsics::atomic\_or\_acquire](intrinsics/fn.atomic_or_acquire)
- [intrinsics::atomic\_or\_relaxed](intrinsics/fn.atomic_or_relaxed)
- [intrinsics::atomic\_or\_release](intrinsics/fn.atomic_or_release)
- [intrinsics::atomic\_or\_seqcst](intrinsics/fn.atomic_or_seqcst)
- [intrinsics::atomic\_singlethreadfence\_acqrel](intrinsics/fn.atomic_singlethreadfence_acqrel)
- [intrinsics::atomic\_singlethreadfence\_acquire](intrinsics/fn.atomic_singlethreadfence_acquire)
- [intrinsics::atomic\_singlethreadfence\_release](intrinsics/fn.atomic_singlethreadfence_release)
- [intrinsics::atomic\_singlethreadfence\_seqcst](intrinsics/fn.atomic_singlethreadfence_seqcst)
- [intrinsics::atomic\_store\_relaxed](intrinsics/fn.atomic_store_relaxed)
- [intrinsics::atomic\_store\_release](intrinsics/fn.atomic_store_release)
- [intrinsics::atomic\_store\_seqcst](intrinsics/fn.atomic_store_seqcst)
- [intrinsics::atomic\_store\_unordered](intrinsics/fn.atomic_store_unordered)
- [intrinsics::atomic\_umax\_acqrel](intrinsics/fn.atomic_umax_acqrel)
- [intrinsics::atomic\_umax\_acquire](intrinsics/fn.atomic_umax_acquire)
- [intrinsics::atomic\_umax\_relaxed](intrinsics/fn.atomic_umax_relaxed)
- [intrinsics::atomic\_umax\_release](intrinsics/fn.atomic_umax_release)
- [intrinsics::atomic\_umax\_seqcst](intrinsics/fn.atomic_umax_seqcst)
- [intrinsics::atomic\_umin\_acqrel](intrinsics/fn.atomic_umin_acqrel)
- [intrinsics::atomic\_umin\_acquire](intrinsics/fn.atomic_umin_acquire)
- [intrinsics::atomic\_umin\_relaxed](intrinsics/fn.atomic_umin_relaxed)
- [intrinsics::atomic\_umin\_release](intrinsics/fn.atomic_umin_release)
- [intrinsics::atomic\_umin\_seqcst](intrinsics/fn.atomic_umin_seqcst)
- [intrinsics::atomic\_xadd\_acqrel](intrinsics/fn.atomic_xadd_acqrel)
- [intrinsics::atomic\_xadd\_acquire](intrinsics/fn.atomic_xadd_acquire)
- [intrinsics::atomic\_xadd\_relaxed](intrinsics/fn.atomic_xadd_relaxed)
- [intrinsics::atomic\_xadd\_release](intrinsics/fn.atomic_xadd_release)
- [intrinsics::atomic\_xadd\_seqcst](intrinsics/fn.atomic_xadd_seqcst)
- [intrinsics::atomic\_xchg\_acqrel](intrinsics/fn.atomic_xchg_acqrel)
- [intrinsics::atomic\_xchg\_acquire](intrinsics/fn.atomic_xchg_acquire)
- [intrinsics::atomic\_xchg\_relaxed](intrinsics/fn.atomic_xchg_relaxed)
- [intrinsics::atomic\_xchg\_release](intrinsics/fn.atomic_xchg_release)
- [intrinsics::atomic\_xchg\_seqcst](intrinsics/fn.atomic_xchg_seqcst)
- [intrinsics::atomic\_xor\_acqrel](intrinsics/fn.atomic_xor_acqrel)
- [intrinsics::atomic\_xor\_acquire](intrinsics/fn.atomic_xor_acquire)
- [intrinsics::atomic\_xor\_relaxed](intrinsics/fn.atomic_xor_relaxed)
- [intrinsics::atomic\_xor\_release](intrinsics/fn.atomic_xor_release)
- [intrinsics::atomic\_xor\_seqcst](intrinsics/fn.atomic_xor_seqcst)
- [intrinsics::atomic\_xsub\_acqrel](intrinsics/fn.atomic_xsub_acqrel)
- [intrinsics::atomic\_xsub\_acquire](intrinsics/fn.atomic_xsub_acquire)
- [intrinsics::atomic\_xsub\_relaxed](intrinsics/fn.atomic_xsub_relaxed)
- [intrinsics::atomic\_xsub\_release](intrinsics/fn.atomic_xsub_release)
- [intrinsics::atomic\_xsub\_seqcst](intrinsics/fn.atomic_xsub_seqcst)
- [intrinsics::bitreverse](intrinsics/fn.bitreverse)
- [intrinsics::black\_box](intrinsics/fn.black_box)
- [intrinsics::breakpoint](intrinsics/fn.breakpoint)
- [intrinsics::bswap](intrinsics/fn.bswap)
- [intrinsics::caller\_location](intrinsics/fn.caller_location)
- [intrinsics::ceilf32](intrinsics/fn.ceilf32)
- [intrinsics::ceilf64](intrinsics/fn.ceilf64)
- [intrinsics::const\_allocate](intrinsics/fn.const_allocate)
- [intrinsics::const\_deallocate](intrinsics/fn.const_deallocate)
- [intrinsics::const\_eval\_select](intrinsics/fn.const_eval_select)
- [intrinsics::copy](intrinsics/fn.copy)
- [intrinsics::copy\_nonoverlapping](intrinsics/fn.copy_nonoverlapping)
- [intrinsics::copysignf32](intrinsics/fn.copysignf32)
- [intrinsics::copysignf64](intrinsics/fn.copysignf64)
- [intrinsics::cosf32](intrinsics/fn.cosf32)
- [intrinsics::cosf64](intrinsics/fn.cosf64)
- [intrinsics::ctlz](intrinsics/fn.ctlz)
- [intrinsics::ctlz\_nonzero](intrinsics/fn.ctlz_nonzero)
- [intrinsics::ctpop](intrinsics/fn.ctpop)
- [intrinsics::cttz](intrinsics/fn.cttz)
- [intrinsics::cttz\_nonzero](intrinsics/fn.cttz_nonzero)
- [intrinsics::discriminant\_value](intrinsics/fn.discriminant_value)
- [intrinsics::drop\_in\_place](intrinsics/fn.drop_in_place)
- [intrinsics::exact\_div](intrinsics/fn.exact_div)
- [intrinsics::exp2f32](intrinsics/fn.exp2f32)
- [intrinsics::exp2f64](intrinsics/fn.exp2f64)
- [intrinsics::expf32](intrinsics/fn.expf32)
- [intrinsics::expf64](intrinsics/fn.expf64)
- [intrinsics::fabsf32](intrinsics/fn.fabsf32)
- [intrinsics::fabsf64](intrinsics/fn.fabsf64)
- [intrinsics::fadd\_fast](intrinsics/fn.fadd_fast)
- [intrinsics::fdiv\_fast](intrinsics/fn.fdiv_fast)
- [intrinsics::float\_to\_int\_unchecked](intrinsics/fn.float_to_int_unchecked)
- [intrinsics::floorf32](intrinsics/fn.floorf32)
- [intrinsics::floorf64](intrinsics/fn.floorf64)
- [intrinsics::fmaf32](intrinsics/fn.fmaf32)
- [intrinsics::fmaf64](intrinsics/fn.fmaf64)
- [intrinsics::fmul\_fast](intrinsics/fn.fmul_fast)
- [intrinsics::forget](intrinsics/fn.forget)
- [intrinsics::frem\_fast](intrinsics/fn.frem_fast)
- [intrinsics::fsub\_fast](intrinsics/fn.fsub_fast)
- [intrinsics::likely](intrinsics/fn.likely)
- [intrinsics::log10f32](intrinsics/fn.log10f32)
- [intrinsics::log10f64](intrinsics/fn.log10f64)
- [intrinsics::log2f32](intrinsics/fn.log2f32)
- [intrinsics::log2f64](intrinsics/fn.log2f64)
- [intrinsics::logf32](intrinsics/fn.logf32)
- [intrinsics::logf64](intrinsics/fn.logf64)
- [intrinsics::maxnumf32](intrinsics/fn.maxnumf32)
- [intrinsics::maxnumf64](intrinsics/fn.maxnumf64)
- [intrinsics::min\_align\_of](intrinsics/fn.min_align_of)
- [intrinsics::min\_align\_of\_val](intrinsics/fn.min_align_of_val)
- [intrinsics::minnumf32](intrinsics/fn.minnumf32)
- [intrinsics::minnumf64](intrinsics/fn.minnumf64)
- [intrinsics::mul\_with\_overflow](intrinsics/fn.mul_with_overflow)
- [intrinsics::nearbyintf32](intrinsics/fn.nearbyintf32)
- [intrinsics::nearbyintf64](intrinsics/fn.nearbyintf64)
- [intrinsics::needs\_drop](intrinsics/fn.needs_drop)
- [intrinsics::nontemporal\_store](intrinsics/fn.nontemporal_store)
- [intrinsics::offset](intrinsics/fn.offset)
- [intrinsics::powf32](intrinsics/fn.powf32)
- [intrinsics::powf64](intrinsics/fn.powf64)
- [intrinsics::powif32](intrinsics/fn.powif32)
- [intrinsics::powif64](intrinsics/fn.powif64)
- [intrinsics::pref\_align\_of](intrinsics/fn.pref_align_of)
- [intrinsics::prefetch\_read\_data](intrinsics/fn.prefetch_read_data)
- [intrinsics::prefetch\_read\_instruction](intrinsics/fn.prefetch_read_instruction)
- [intrinsics::prefetch\_write\_data](intrinsics/fn.prefetch_write_data)
- [intrinsics::prefetch\_write\_instruction](intrinsics/fn.prefetch_write_instruction)
- [intrinsics::ptr\_guaranteed\_cmp](intrinsics/fn.ptr_guaranteed_cmp)
- [intrinsics::ptr\_mask](intrinsics/fn.ptr_mask)
- [intrinsics::ptr\_offset\_from](intrinsics/fn.ptr_offset_from)
- [intrinsics::ptr\_offset\_from\_unsigned](intrinsics/fn.ptr_offset_from_unsigned)
- [intrinsics::raw\_eq](intrinsics/fn.raw_eq)
- [intrinsics::rintf32](intrinsics/fn.rintf32)
- [intrinsics::rintf64](intrinsics/fn.rintf64)
- [intrinsics::rotate\_left](intrinsics/fn.rotate_left)
- [intrinsics::rotate\_right](intrinsics/fn.rotate_right)
- [intrinsics::roundf32](intrinsics/fn.roundf32)
- [intrinsics::roundf64](intrinsics/fn.roundf64)
- [intrinsics::rustc\_peek](intrinsics/fn.rustc_peek)
- [intrinsics::saturating\_add](intrinsics/fn.saturating_add)
- [intrinsics::saturating\_sub](intrinsics/fn.saturating_sub)
- [intrinsics::sinf32](intrinsics/fn.sinf32)
- [intrinsics::sinf64](intrinsics/fn.sinf64)
- [intrinsics::size\_of](intrinsics/fn.size_of)
- [intrinsics::size\_of\_val](intrinsics/fn.size_of_val)
- [intrinsics::sqrtf32](intrinsics/fn.sqrtf32)
- [intrinsics::sqrtf64](intrinsics/fn.sqrtf64)
- [intrinsics::sub\_with\_overflow](intrinsics/fn.sub_with_overflow)
- [intrinsics::transmute](intrinsics/fn.transmute)
- [intrinsics::truncf32](intrinsics/fn.truncf32)
- [intrinsics::truncf64](intrinsics/fn.truncf64)
- [intrinsics::try](intrinsics/fn.try)
- [intrinsics::type\_id](intrinsics/fn.type_id)
- [intrinsics::type\_name](intrinsics/fn.type_name)
- [intrinsics::unaligned\_volatile\_load](intrinsics/fn.unaligned_volatile_load)
- [intrinsics::unaligned\_volatile\_store](intrinsics/fn.unaligned_volatile_store)
- [intrinsics::unchecked\_add](intrinsics/fn.unchecked_add)
- [intrinsics::unchecked\_div](intrinsics/fn.unchecked_div)
- [intrinsics::unchecked\_mul](intrinsics/fn.unchecked_mul)
- [intrinsics::unchecked\_rem](intrinsics/fn.unchecked_rem)
- [intrinsics::unchecked\_shl](intrinsics/fn.unchecked_shl)
- [intrinsics::unchecked\_shr](intrinsics/fn.unchecked_shr)
- [intrinsics::unchecked\_sub](intrinsics/fn.unchecked_sub)
- [intrinsics::unlikely](intrinsics/fn.unlikely)
- [intrinsics::unreachable](intrinsics/fn.unreachable)
- [intrinsics::variant\_count](intrinsics/fn.variant_count)
- [intrinsics::volatile\_copy\_memory](intrinsics/fn.volatile_copy_memory)
- [intrinsics::volatile\_copy\_nonoverlapping\_memory](intrinsics/fn.volatile_copy_nonoverlapping_memory)
- [intrinsics::volatile\_load](intrinsics/fn.volatile_load)
- [intrinsics::volatile\_set\_memory](intrinsics/fn.volatile_set_memory)
- [intrinsics::volatile\_store](intrinsics/fn.volatile_store)
- [intrinsics::vtable\_align](intrinsics/fn.vtable_align)
- [intrinsics::vtable\_size](intrinsics/fn.vtable_size)
- [intrinsics::wrapping\_add](intrinsics/fn.wrapping_add)
- [intrinsics::wrapping\_mul](intrinsics/fn.wrapping_mul)
- [intrinsics::wrapping\_sub](intrinsics/fn.wrapping_sub)
- [intrinsics::write\_bytes](intrinsics/fn.write_bytes)
- [io::copy](io/fn.copy)
- [io::empty](io/fn.empty)
- [io::read\_to\_string](io/fn.read_to_string)
- [io::repeat](io/fn.repeat)
- [io::sink](io/fn.sink)
- [io::stderr](io/fn.stderr)
- [io::stdin](io/fn.stdin)
- [io::stdout](io/fn.stdout)
- [iter::empty](iter/fn.empty)
- [iter::from\_fn](iter/fn.from_fn)
- [iter::from\_generator](iter/fn.from_generator)
- [iter::once](iter/fn.once)
- [iter::once\_with](iter/fn.once_with)
- [iter::repeat](iter/fn.repeat)
- [iter::repeat\_with](iter/fn.repeat_with)
- [iter::successors](iter/fn.successors)
- [iter::zip](iter/fn.zip)
- [mem::align\_of](mem/fn.align_of)
- [mem::align\_of\_val](mem/fn.align_of_val)
- [mem::align\_of\_val\_raw](mem/fn.align_of_val_raw)
- [mem::copy](mem/fn.copy)
- [mem::discriminant](mem/fn.discriminant)
- [mem::drop](mem/fn.drop)
- [mem::forget](mem/fn.forget)
- [mem::forget\_unsized](mem/fn.forget_unsized)
- [mem::min\_align\_of](mem/fn.min_align_of)
- [mem::min\_align\_of\_val](mem/fn.min_align_of_val)
- [mem::needs\_drop](mem/fn.needs_drop)
- [mem::replace](mem/fn.replace)
- [mem::size\_of](mem/fn.size_of)
- [mem::size\_of\_val](mem/fn.size_of_val)
- [mem::size\_of\_val\_raw](mem/fn.size_of_val_raw)
- [mem::swap](mem/fn.swap)
- [mem::take](mem/fn.take)
- [mem::transmute](mem/fn.transmute)
- [mem::transmute\_copy](mem/fn.transmute_copy)
- [mem::uninitialized](mem/fn.uninitialized)
- [mem::variant\_count](mem/fn.variant_count)
- [mem::zeroed](mem/fn.zeroed)
- [os::unix::fs::chown](os/unix/fs/fn.chown)
- [os::unix::fs::chroot](os/unix/fs/fn.chroot)
- [os::unix::fs::fchown](os/unix/fs/fn.fchown)
- [os::unix::fs::lchown](os/unix/fs/fn.lchown)
- [os::unix::fs::symlink](os/unix/fs/fn.symlink)
- [os::unix::process::parent\_id](os/unix/process/fn.parent_id)
- [os::unix::ucred::impl\_linux::peer\_cred](os/unix/ucred/impl_linux/fn.peer_cred)
- [os::wasi::fs::link](os/wasi/fs/fn.link)
- [os::wasi::fs::rename](os/wasi/fs/fn.rename)
- [os::wasi::fs::symlink](os/wasi/fs/fn.symlink)
- [os::wasi::fs::symlink\_path](os/wasi/fs/fn.symlink_path)
- [os::windows::fs::symlink\_dir](os/windows/fs/fn.symlink_dir)
- [os::windows::fs::symlink\_file](os/windows/fs/fn.symlink_file)
- [panic::always\_abort](panic/fn.always_abort)
- [panic::catch\_unwind](panic/fn.catch_unwind)
- [panic::get\_backtrace\_style](panic/fn.get_backtrace_style)
- [panic::panic\_any](panic/fn.panic_any)
- [panic::resume\_unwind](panic/fn.resume_unwind)
- [panic::set\_backtrace\_style](panic/fn.set_backtrace_style)
- [panic::set\_hook](panic/fn.set_hook)
- [panic::take\_hook](panic/fn.take_hook)
- [panic::update\_hook](panic/fn.update_hook)
- [path::absolute](path/fn.absolute)
- [path::is\_separator](path/fn.is_separator)
- [process::abort](process/fn.abort)
- [process::exit](process/fn.exit)
- [process::id](process/fn.id)
- [ptr::copy](ptr/fn.copy)
- [ptr::copy\_nonoverlapping](ptr/fn.copy_nonoverlapping)
- [ptr::drop\_in\_place](ptr/fn.drop_in_place)
- [ptr::eq](ptr/fn.eq)
- [ptr::from\_exposed\_addr](ptr/fn.from_exposed_addr)
- [ptr::from\_exposed\_addr\_mut](ptr/fn.from_exposed_addr_mut)
- [ptr::from\_raw\_parts](ptr/fn.from_raw_parts)
- [ptr::from\_raw\_parts\_mut](ptr/fn.from_raw_parts_mut)
- [ptr::hash](ptr/fn.hash)
- [ptr::invalid](ptr/fn.invalid)
- [ptr::invalid\_mut](ptr/fn.invalid_mut)
- [ptr::metadata](ptr/fn.metadata)
- [ptr::null](ptr/fn.null)
- [ptr::null\_mut](ptr/fn.null_mut)
- [ptr::read](ptr/fn.read)
- [ptr::read\_unaligned](ptr/fn.read_unaligned)
- [ptr::read\_volatile](ptr/fn.read_volatile)
- [ptr::replace](ptr/fn.replace)
- [ptr::slice\_from\_raw\_parts](ptr/fn.slice_from_raw_parts)
- [ptr::slice\_from\_raw\_parts\_mut](ptr/fn.slice_from_raw_parts_mut)
- [ptr::swap](ptr/fn.swap)
- [ptr::swap\_nonoverlapping](ptr/fn.swap_nonoverlapping)
- [ptr::write](ptr/fn.write)
- [ptr::write\_bytes](ptr/fn.write_bytes)
- [ptr::write\_unaligned](ptr/fn.write_unaligned)
- [ptr::write\_volatile](ptr/fn.write_volatile)
- [slice::from\_mut](slice/fn.from_mut)
- [slice::from\_mut\_ptr\_range](slice/fn.from_mut_ptr_range)
- [slice::from\_ptr\_range](slice/fn.from_ptr_range)
- [slice::from\_raw\_parts](slice/fn.from_raw_parts)
- [slice::from\_raw\_parts\_mut](slice/fn.from_raw_parts_mut)
- [slice::from\_ref](slice/fn.from_ref)
- [slice::range](slice/fn.range)
- [str::from\_boxed\_utf8\_unchecked](str/fn.from_boxed_utf8_unchecked)
- [str::from\_utf8](str/fn.from_utf8)
- [str::from\_utf8\_mut](str/fn.from_utf8_mut)
- [str::from\_utf8\_unchecked](str/fn.from_utf8_unchecked)
- [str::from\_utf8\_unchecked\_mut](str/fn.from_utf8_unchecked_mut)
- [sync::atomic::compiler\_fence](sync/atomic/fn.compiler_fence)
- [sync::atomic::fence](sync/atomic/fn.fence)
- [sync::atomic::spin\_loop\_hint](sync/atomic/fn.spin_loop_hint)
- [sync::mpsc::channel](sync/mpsc/fn.channel)
- [sync::mpsc::sync\_channel](sync/mpsc/fn.sync_channel)
- [thread::available\_parallelism](thread/fn.available_parallelism)
- [thread::current](thread/fn.current)
- [thread::panicking](thread/fn.panicking)
- [thread::park](thread/fn.park)
- [thread::park\_timeout](thread/fn.park_timeout)
- [thread::park\_timeout\_ms](thread/fn.park_timeout_ms)
- [thread::scope](thread/fn.scope)
- [thread::sleep](thread/fn.sleep)
- [thread::sleep\_ms](thread/fn.sleep_ms)
- [thread::spawn](thread/fn.spawn)
- [thread::yield\_now](thread/fn.yield_now)
### Typedefs
- [alloc::LayoutErr](alloc/type.layouterr)
- [ffi::c\_char](ffi/type.c_char)
- [ffi::c\_double](ffi/type.c_double)
- [ffi::c\_float](ffi/type.c_float)
- [ffi::c\_int](ffi/type.c_int)
- [ffi::c\_long](ffi/type.c_long)
- [ffi::c\_longlong](ffi/type.c_longlong)
- [ffi::c\_schar](ffi/type.c_schar)
- [ffi::c\_short](ffi/type.c_short)
- [ffi::c\_uchar](ffi/type.c_uchar)
- [ffi::c\_uint](ffi/type.c_uint)
- [ffi::c\_ulong](ffi/type.c_ulong)
- [ffi::c\_ulonglong](ffi/type.c_ulonglong)
- [ffi::c\_ushort](ffi/type.c_ushort)
- [fmt::Result](fmt/type.result)
- [io::Result](io/type.result)
- [os::linux::raw::blkcnt\_t](os/linux/raw/type.blkcnt_t)
- [os::linux::raw::blksize\_t](os/linux/raw/type.blksize_t)
- [os::linux::raw::dev\_t](os/linux/raw/type.dev_t)
- [os::linux::raw::ino\_t](os/linux/raw/type.ino_t)
- [os::linux::raw::mode\_t](os/linux/raw/type.mode_t)
- [os::linux::raw::nlink\_t](os/linux/raw/type.nlink_t)
- [os::linux::raw::off\_t](os/linux/raw/type.off_t)
- [os::linux::raw::pthread\_t](os/linux/raw/type.pthread_t)
- [os::linux::raw::time\_t](os/linux/raw/type.time_t)
- [os::raw::c\_char](os/raw/type.c_char)
- [os::raw::c\_double](os/raw/type.c_double)
- [os::raw::c\_float](os/raw/type.c_float)
- [os::raw::c\_int](os/raw/type.c_int)
- [os::raw::c\_long](os/raw/type.c_long)
- [os::raw::c\_longlong](os/raw/type.c_longlong)
- [os::raw::c\_schar](os/raw/type.c_schar)
- [os::raw::c\_short](os/raw/type.c_short)
- [os::raw::c\_uchar](os/raw/type.c_uchar)
- [os::raw::c\_uint](os/raw/type.c_uint)
- [os::raw::c\_ulong](os/raw/type.c_ulong)
- [os::raw::c\_ulonglong](os/raw/type.c_ulonglong)
- [os::raw::c\_ushort](os/raw/type.c_ushort)
- [os::raw::c\_void](os/raw/type.c_void)
- [os::unix::io::RawFd](os/unix/io/type.rawfd)
- [os::unix::raw::blkcnt\_t](os/unix/raw/type.blkcnt_t)
- [os::unix::raw::blksize\_t](os/unix/raw/type.blksize_t)
- [os::unix::raw::dev\_t](os/unix/raw/type.dev_t)
- [os::unix::raw::gid\_t](os/unix/raw/type.gid_t)
- [os::unix::raw::ino\_t](os/unix/raw/type.ino_t)
- [os::unix::raw::mode\_t](os/unix/raw/type.mode_t)
- [os::unix::raw::nlink\_t](os/unix/raw/type.nlink_t)
- [os::unix::raw::off\_t](os/unix/raw/type.off_t)
- [os::unix::raw::pid\_t](os/unix/raw/type.pid_t)
- [os::unix::raw::pthread\_t](os/unix/raw/type.pthread_t)
- [os::unix::raw::time\_t](os/unix/raw/type.time_t)
- [os::unix::raw::uid\_t](os/unix/raw/type.uid_t)
- [os::unix::thread::RawPthread](os/unix/thread/type.rawpthread)
- [os::wasi::io::RawFd](os/wasi/io/type.rawfd)
- [os::windows::io::RawHandle](os/windows/io/type.rawhandle)
- [os::windows::io::RawSocket](os/windows/io/type.rawsocket)
- [os::windows::raw::HANDLE](os/windows/raw/type.handle)
- [os::windows::raw::SOCKET](os/windows/raw/type.socket)
- [simd::f32x16](simd/type.f32x16)
- [simd::f32x2](simd/type.f32x2)
- [simd::f32x4](simd/type.f32x4)
- [simd::f32x8](simd/type.f32x8)
- [simd::f64x2](simd/type.f64x2)
- [simd::f64x4](simd/type.f64x4)
- [simd::f64x8](simd/type.f64x8)
- [simd::i16x16](simd/type.i16x16)
- [simd::i16x2](simd/type.i16x2)
- [simd::i16x32](simd/type.i16x32)
- [simd::i16x4](simd/type.i16x4)
- [simd::i16x8](simd/type.i16x8)
- [simd::i32x16](simd/type.i32x16)
- [simd::i32x2](simd/type.i32x2)
- [simd::i32x4](simd/type.i32x4)
- [simd::i32x8](simd/type.i32x8)
- [simd::i64x2](simd/type.i64x2)
- [simd::i64x4](simd/type.i64x4)
- [simd::i64x8](simd/type.i64x8)
- [simd::i8x16](simd/type.i8x16)
- [simd::i8x32](simd/type.i8x32)
- [simd::i8x4](simd/type.i8x4)
- [simd::i8x64](simd/type.i8x64)
- [simd::i8x8](simd/type.i8x8)
- [simd::isizex2](simd/type.isizex2)
- [simd::isizex4](simd/type.isizex4)
- [simd::isizex8](simd/type.isizex8)
- [simd::mask16x16](simd/type.mask16x16)
- [simd::mask16x32](simd/type.mask16x32)
- [simd::mask16x4](simd/type.mask16x4)
- [simd::mask16x8](simd/type.mask16x8)
- [simd::mask32x16](simd/type.mask32x16)
- [simd::mask32x2](simd/type.mask32x2)
- [simd::mask32x4](simd/type.mask32x4)
- [simd::mask32x8](simd/type.mask32x8)
- [simd::mask64x2](simd/type.mask64x2)
- [simd::mask64x4](simd/type.mask64x4)
- [simd::mask64x8](simd/type.mask64x8)
- [simd::mask8x16](simd/type.mask8x16)
- [simd::mask8x32](simd/type.mask8x32)
- [simd::mask8x64](simd/type.mask8x64)
- [simd::mask8x8](simd/type.mask8x8)
- [simd::masksizex2](simd/type.masksizex2)
- [simd::masksizex4](simd/type.masksizex4)
- [simd::masksizex8](simd/type.masksizex8)
- [simd::u16x16](simd/type.u16x16)
- [simd::u16x2](simd/type.u16x2)
- [simd::u16x32](simd/type.u16x32)
- [simd::u16x4](simd/type.u16x4)
- [simd::u16x8](simd/type.u16x8)
- [simd::u32x16](simd/type.u32x16)
- [simd::u32x2](simd/type.u32x2)
- [simd::u32x4](simd/type.u32x4)
- [simd::u32x8](simd/type.u32x8)
- [simd::u64x2](simd/type.u64x2)
- [simd::u64x4](simd/type.u64x4)
- [simd::u64x8](simd/type.u64x8)
- [simd::u8x16](simd/type.u8x16)
- [simd::u8x32](simd/type.u8x32)
- [simd::u8x4](simd/type.u8x4)
- [simd::u8x64](simd/type.u8x64)
- [simd::u8x8](simd/type.u8x8)
- [simd::usizex2](simd/type.usizex2)
- [simd::usizex4](simd/type.usizex4)
- [simd::usizex8](simd/type.usizex8)
- [string::ParseError](string/type.parseerror)
- [sync::LockResult](sync/type.lockresult)
- [sync::TryLockResult](sync/type.trylockresult)
- [thread::Result](thread/type.result)
### Constants
- [char::MAX](char/constant.max)
- [char::REPLACEMENT\_CHARACTER](char/constant.replacement_character)
- [char::UNICODE\_VERSION](char/constant.unicode_version)
- [env::consts::ARCH](env/consts/constant.arch)
- [env::consts::DLL\_EXTENSION](env/consts/constant.dll_extension)
- [env::consts::DLL\_PREFIX](env/consts/constant.dll_prefix)
- [env::consts::DLL\_SUFFIX](env/consts/constant.dll_suffix)
- [env::consts::EXE\_EXTENSION](env/consts/constant.exe_extension)
- [env::consts::EXE\_SUFFIX](env/consts/constant.exe_suffix)
- [env::consts::FAMILY](env/consts/constant.family)
- [env::consts::OS](env/consts/constant.os)
- [f32::DIGITS](f32/constant.digits)
- [f32::EPSILON](f32/constant.epsilon)
- [f32::INFINITY](f32/constant.infinity)
- [f32::MANTISSA\_DIGITS](f32/constant.mantissa_digits)
- [f32::MAX](f32/constant.max)
- [f32::MAX\_10\_EXP](f32/constant.max_10_exp)
- [f32::MAX\_EXP](f32/constant.max_exp)
- [f32::MIN](f32/constant.min)
- [f32::MIN\_10\_EXP](f32/constant.min_10_exp)
- [f32::MIN\_EXP](f32/constant.min_exp)
- [f32::MIN\_POSITIVE](f32/constant.min_positive)
- [f32::NAN](f32/constant.nan)
- [f32::NEG\_INFINITY](f32/constant.neg_infinity)
- [f32::RADIX](f32/constant.radix)
- [f32::consts::E](f32/consts/constant.e)
- [f32::consts::FRAC\_1\_PI](f32/consts/constant.frac_1_pi)
- [f32::consts::FRAC\_1\_SQRT\_2](f32/consts/constant.frac_1_sqrt_2)
- [f32::consts::FRAC\_2\_PI](f32/consts/constant.frac_2_pi)
- [f32::consts::FRAC\_2\_SQRT\_PI](f32/consts/constant.frac_2_sqrt_pi)
- [f32::consts::FRAC\_PI\_2](f32/consts/constant.frac_pi_2)
- [f32::consts::FRAC\_PI\_3](f32/consts/constant.frac_pi_3)
- [f32::consts::FRAC\_PI\_4](f32/consts/constant.frac_pi_4)
- [f32::consts::FRAC\_PI\_6](f32/consts/constant.frac_pi_6)
- [f32::consts::FRAC\_PI\_8](f32/consts/constant.frac_pi_8)
- [f32::consts::LN\_10](f32/consts/constant.ln_10)
- [f32::consts::LN\_2](f32/consts/constant.ln_2)
- [f32::consts::LOG10\_2](f32/consts/constant.log10_2)
- [f32::consts::LOG10\_E](f32/consts/constant.log10_e)
- [f32::consts::LOG2\_10](f32/consts/constant.log2_10)
- [f32::consts::LOG2\_E](f32/consts/constant.log2_e)
- [f32::consts::PI](f32/consts/constant.pi)
- [f32::consts::SQRT\_2](f32/consts/constant.sqrt_2)
- [f32::consts::TAU](f32/consts/constant.tau)
- [f64::DIGITS](f64/constant.digits)
- [f64::EPSILON](f64/constant.epsilon)
- [f64::INFINITY](f64/constant.infinity)
- [f64::MANTISSA\_DIGITS](f64/constant.mantissa_digits)
- [f64::MAX](f64/constant.max)
- [f64::MAX\_10\_EXP](f64/constant.max_10_exp)
- [f64::MAX\_EXP](f64/constant.max_exp)
- [f64::MIN](f64/constant.min)
- [f64::MIN\_10\_EXP](f64/constant.min_10_exp)
- [f64::MIN\_EXP](f64/constant.min_exp)
- [f64::MIN\_POSITIVE](f64/constant.min_positive)
- [f64::NAN](f64/constant.nan)
- [f64::NEG\_INFINITY](f64/constant.neg_infinity)
- [f64::RADIX](f64/constant.radix)
- [f64::consts::E](f64/consts/constant.e)
- [f64::consts::FRAC\_1\_PI](f64/consts/constant.frac_1_pi)
- [f64::consts::FRAC\_1\_SQRT\_2](f64/consts/constant.frac_1_sqrt_2)
- [f64::consts::FRAC\_2\_PI](f64/consts/constant.frac_2_pi)
- [f64::consts::FRAC\_2\_SQRT\_PI](f64/consts/constant.frac_2_sqrt_pi)
- [f64::consts::FRAC\_PI\_2](f64/consts/constant.frac_pi_2)
- [f64::consts::FRAC\_PI\_3](f64/consts/constant.frac_pi_3)
- [f64::consts::FRAC\_PI\_4](f64/consts/constant.frac_pi_4)
- [f64::consts::FRAC\_PI\_6](f64/consts/constant.frac_pi_6)
- [f64::consts::FRAC\_PI\_8](f64/consts/constant.frac_pi_8)
- [f64::consts::LN\_10](f64/consts/constant.ln_10)
- [f64::consts::LN\_2](f64/consts/constant.ln_2)
- [f64::consts::LOG10\_2](f64/consts/constant.log10_2)
- [f64::consts::LOG10\_E](f64/consts/constant.log10_e)
- [f64::consts::LOG2\_10](f64/consts/constant.log2_10)
- [f64::consts::LOG2\_E](f64/consts/constant.log2_e)
- [f64::consts::PI](f64/consts/constant.pi)
- [f64::consts::SQRT\_2](f64/consts/constant.sqrt_2)
- [f64::consts::TAU](f64/consts/constant.tau)
- [i128::MAX](i128/constant.max)
- [i128::MIN](i128/constant.min)
- [i16::MAX](i16/constant.max)
- [i16::MIN](i16/constant.min)
- [i32::MAX](i32/constant.max)
- [i32::MIN](i32/constant.min)
- [i64::MAX](i64/constant.max)
- [i64::MIN](i64/constant.min)
- [i8::MAX](i8/constant.max)
- [i8::MIN](i8/constant.min)
- [isize::MAX](isize/constant.max)
- [isize::MIN](isize/constant.min)
- [path::MAIN\_SEPARATOR](path/constant.main_separator)
- [path::MAIN\_SEPARATOR\_STR](path/constant.main_separator_str)
- [sync::ONCE\_INIT](sync/constant.once_init)
- [sync::atomic::ATOMIC\_BOOL\_INIT](sync/atomic/constant.atomic_bool_init)
- [sync::atomic::ATOMIC\_I16\_INIT](sync/atomic/constant.atomic_i16_init)
- [sync::atomic::ATOMIC\_I32\_INIT](sync/atomic/constant.atomic_i32_init)
- [sync::atomic::ATOMIC\_I64\_INIT](sync/atomic/constant.atomic_i64_init)
- [sync::atomic::ATOMIC\_I8\_INIT](sync/atomic/constant.atomic_i8_init)
- [sync::atomic::ATOMIC\_ISIZE\_INIT](sync/atomic/constant.atomic_isize_init)
- [sync::atomic::ATOMIC\_U16\_INIT](sync/atomic/constant.atomic_u16_init)
- [sync::atomic::ATOMIC\_U32\_INIT](sync/atomic/constant.atomic_u32_init)
- [sync::atomic::ATOMIC\_U64\_INIT](sync/atomic/constant.atomic_u64_init)
- [sync::atomic::ATOMIC\_U8\_INIT](sync/atomic/constant.atomic_u8_init)
- [sync::atomic::ATOMIC\_USIZE\_INIT](sync/atomic/constant.atomic_usize_init)
- [time::UNIX\_EPOCH](time/constant.unix_epoch)
- [u128::MAX](u128/constant.max)
- [u128::MIN](u128/constant.min)
- [u16::MAX](u16/constant.max)
- [u16::MIN](u16/constant.min)
- [u32::MAX](u32/constant.max)
- [u32::MIN](u32/constant.min)
- [u64::MAX](u64/constant.max)
- [u64::MIN](u64/constant.min)
- [u8::MAX](u8/constant.max)
- [u8::MIN](u8/constant.min)
- [usize::MAX](usize/constant.max)
- [usize::MIN](usize/constant.min)
| programming_docs |
rust Macro std::is_x86_feature_detected Macro std::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::print Macro std::print
================
```
macro_rules! print {
($($arg:tt)*) => { ... };
}
```
Prints to the standard output.
Equivalent to the [`println!`](macro.println) macro except that a newline is not printed at the end of the message.
Note that stdout is frequently line-buffered by default so it may be necessary to use [`io::stdout().flush()`](io/trait.write#tymethod.flush) to ensure the output is emitted immediately.
The `print!` macro will lock the standard output on each call. If you call `print!` within a hot loop, this behavior may be the bottleneck of the loop. To avoid this, lock stdout with [`io::stdout().lock()`](io/struct.stdout):
```
use std::io::{stdout, Write};
let mut lock = stdout().lock();
write!(lock, "hello world").unwrap();
```
Use `print!` only for the primary output of your program. Use [`eprint!`](macro.eprint) instead to print error and progress messages.
Panics
------
Panics if writing to `io::stdout()` fails.
Writing to non-blocking stdout can cause an error, which will lead this macro to panic.
Examples
--------
```
use std::io::{self, Write};
print!("this ");
print!("will ");
print!("be ");
print!("on ");
print!("the ");
print!("same ");
print!("line ");
io::stdout().flush().unwrap();
print!("this string has a newline, why not choose println! instead?\n");
io::stdout().flush().unwrap();
```
rust Macro std::thread_local Macro std::thread\_local
========================
```
macro_rules! thread_local {
() => { ... };
($(#[$attr:meta])* $vis:vis static $name:ident: $t:ty = const { $init:expr }; $($rest:tt)*) => { ... };
($(#[$attr:meta])* $vis:vis static $name:ident: $t:ty = const { $init:expr }) => { ... };
($(#[$attr:meta])* $vis:vis static $name:ident: $t:ty = $init:expr; $($rest:tt)*) => { ... };
($(#[$attr:meta])* $vis:vis static $name:ident: $t:ty = $init:expr) => { ... };
}
```
Declare a new thread local storage key of type [`std::thread::LocalKey`](thread/struct.localkey).
Syntax
------
The macro wraps any number of static declarations and makes them thread local. Publicity and attributes for each static are allowed. Example:
```
use std::cell::RefCell;
thread_local! {
pub static FOO: RefCell<u32> = RefCell::new(1);
#[allow(unused)]
static BAR: RefCell<f32> = RefCell::new(1.0);
}
```
See [`LocalKey` documentation](thread/struct.localkey) for more information.
rust Primitive Type i128 Primitive Type i128
===================
The 128-bit signed integer type.
Implementations
---------------
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#232)### impl i128
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#233-240)1.43.0 · #### pub const MIN: i128 = -170\_141\_183\_460\_469\_231\_731\_687\_303\_715\_884\_105\_728i128
The smallest value that can be represented by this integer type (−2127)
##### Examples
Basic usage:
```
assert_eq!(i128::MIN, -170141183460469231731687303715884105728);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#233-240)1.43.0 · #### pub const MAX: i128 = 170\_141\_183\_460\_469\_231\_731\_687\_303\_715\_884\_105\_727i128
The largest value that can be represented by this integer type (2127 − 1)
##### Examples
Basic usage:
```
assert_eq!(i128::MAX, 170141183460469231731687303715884105727);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#233-240)1.53.0 · #### pub const BITS: u32 = 128u32
The size of this integer type in bits.
##### Examples
```
assert_eq!(i128::BITS, 128);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#233-240)1.0.0 · #### pub fn from\_str\_radix(src: &str, radix: u32) -> Result<i128, ParseIntError>
Converts a string slice in a given base to an integer.
The string is expected to be an optional `+` or `-` sign followed by digits. Leading and trailing whitespace represent an error. Digits are a subset of these characters, depending on `radix`:
* `0-9`
* `a-z`
* `A-Z`
##### Panics
This function panics if `radix` is not in the range from 2 to 36.
##### Examples
Basic usage:
```
assert_eq!(i128::from_str_radix("A", 16), Ok(10));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#233-240)1.0.0 (const: 1.32.0) · #### pub const fn count\_ones(self) -> u32
Returns the number of ones in the binary representation of `self`.
##### Examples
Basic usage:
```
let n = 0b100_0000i128;
assert_eq!(n.count_ones(), 1);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#233-240)1.0.0 (const: 1.32.0) · #### pub const fn count\_zeros(self) -> u32
Returns the number of zeros in the binary representation of `self`.
##### Examples
Basic usage:
```
assert_eq!(i128::MAX.count_zeros(), 1);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#233-240)1.0.0 (const: 1.32.0) · #### pub const fn leading\_zeros(self) -> u32
Returns the number of leading zeros in the binary representation of `self`.
##### Examples
Basic usage:
```
let n = -1i128;
assert_eq!(n.leading_zeros(), 0);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#233-240)1.0.0 (const: 1.32.0) · #### pub const fn trailing\_zeros(self) -> u32
Returns the number of trailing zeros in the binary representation of `self`.
##### Examples
Basic usage:
```
let n = -4i128;
assert_eq!(n.trailing_zeros(), 2);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#233-240)1.46.0 (const: 1.46.0) · #### pub const fn leading\_ones(self) -> u32
Returns the number of leading ones in the binary representation of `self`.
##### Examples
Basic usage:
```
let n = -1i128;
assert_eq!(n.leading_ones(), 128);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#233-240)1.46.0 (const: 1.46.0) · #### pub const fn trailing\_ones(self) -> u32
Returns the number of trailing ones in the binary representation of `self`.
##### Examples
Basic usage:
```
let n = 3i128;
assert_eq!(n.trailing_ones(), 2);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#233-240)1.0.0 (const: 1.32.0) · #### pub const fn rotate\_left(self, n: u32) -> i128
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:
```
let n = 0x13f40000000000000000000000004f76i128;
let m = 0x4f7613f4;
assert_eq!(n.rotate_left(16), m);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#233-240)1.0.0 (const: 1.32.0) · #### pub const fn rotate\_right(self, n: u32) -> i128
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:
```
let n = 0x4f7613f4i128;
let m = 0x13f40000000000000000000000004f76;
assert_eq!(n.rotate_right(16), m);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#233-240)1.0.0 (const: 1.32.0) · #### pub const fn swap\_bytes(self) -> i128
Reverses the byte order of the integer.
##### Examples
Basic usage:
```
let n = 0x12345678901234567890123456789012i128;
let m = n.swap_bytes();
assert_eq!(m, 0x12907856341290785634129078563412);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#233-240)1.37.0 (const: 1.37.0) · #### pub const fn reverse\_bits(self) -> i128
Reverses the order of bits in the integer. The least significant bit becomes the most significant bit, second least-significant bit becomes second most-significant bit, etc.
##### Examples
Basic usage:
```
let n = 0x12345678901234567890123456789012i128;
let m = n.reverse_bits();
assert_eq!(m, 0x48091e6a2c48091e6a2c48091e6a2c48);
assert_eq!(0, 0i128.reverse_bits());
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#233-240)1.0.0 (const: 1.32.0) · #### pub const fn from\_be(x: i128) -> i128
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:
```
let n = 0x1Ai128;
if cfg!(target_endian = "big") {
assert_eq!(i128::from_be(n), n)
} else {
assert_eq!(i128::from_be(n), n.swap_bytes())
}
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#233-240)1.0.0 (const: 1.32.0) · #### pub const fn from\_le(x: i128) -> i128
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:
```
let n = 0x1Ai128;
if cfg!(target_endian = "little") {
assert_eq!(i128::from_le(n), n)
} else {
assert_eq!(i128::from_le(n), n.swap_bytes())
}
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#233-240)1.0.0 (const: 1.32.0) · #### pub const fn to\_be(self) -> i128
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:
```
let n = 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/mod.rs.html#233-240)1.0.0 (const: 1.32.0) · #### pub const fn to\_le(self) -> i128
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:
```
let n = 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/mod.rs.html#233-240)1.0.0 (const: 1.47.0) · #### pub const fn checked\_add(self, rhs: i128) -> Option<i128>
Checked integer addition. Computes `self + rhs`, returning `None` if overflow occurred.
##### Examples
Basic usage:
```
assert_eq!((i128::MAX - 2).checked_add(1), Some(i128::MAX - 1));
assert_eq!((i128::MAX - 2).checked_add(3), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#233-240)const: [unstable](https://github.com/rust-lang/rust/issues/85122 "Tracking issue for const_inherent_unchecked_arith") · #### pub unsafe fn unchecked\_add(self, rhs: i128) -> i128
🔬This is a nightly-only experimental API. (`unchecked_math` [#85122](https://github.com/rust-lang/rust/issues/85122))
Unchecked integer addition. Computes `self + rhs`, assuming overflow cannot occur.
##### Safety
This results in undefined behavior when `self + rhs > i128::MAX` or `self + rhs < i128::MIN`, i.e. when [`checked_add`](primitive.i128#method.checked_add) would return `None`.
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#233-240)const: [unstable](https://github.com/rust-lang/rust/issues/87840 "Tracking issue for mixed_integer_ops") · #### pub fn checked\_add\_unsigned(self, rhs: u128) -> Option<i128>
🔬This is a nightly-only experimental API. (`mixed_integer_ops` [#87840](https://github.com/rust-lang/rust/issues/87840))
Checked addition with an unsigned integer. Computes `self + rhs`, returning `None` if overflow occurred.
##### Examples
Basic usage:
```
assert_eq!(1i128.checked_add_unsigned(2), Some(3));
assert_eq!((i128::MAX - 2).checked_add_unsigned(3), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#233-240)1.0.0 (const: 1.47.0) · #### pub const fn checked\_sub(self, rhs: i128) -> Option<i128>
Checked integer subtraction. Computes `self - rhs`, returning `None` if overflow occurred.
##### Examples
Basic usage:
```
assert_eq!((i128::MIN + 2).checked_sub(1), Some(i128::MIN + 1));
assert_eq!((i128::MIN + 2).checked_sub(3), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#233-240)const: [unstable](https://github.com/rust-lang/rust/issues/85122 "Tracking issue for const_inherent_unchecked_arith") · #### pub unsafe fn unchecked\_sub(self, rhs: i128) -> i128
🔬This is a nightly-only experimental API. (`unchecked_math` [#85122](https://github.com/rust-lang/rust/issues/85122))
Unchecked integer subtraction. Computes `self - rhs`, assuming overflow cannot occur.
##### Safety
This results in undefined behavior when `self - rhs > i128::MAX` or `self - rhs < i128::MIN`, i.e. when [`checked_sub`](primitive.i128#method.checked_sub) would return `None`.
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#233-240)const: [unstable](https://github.com/rust-lang/rust/issues/87840 "Tracking issue for mixed_integer_ops") · #### pub fn checked\_sub\_unsigned(self, rhs: u128) -> Option<i128>
🔬This is a nightly-only experimental API. (`mixed_integer_ops` [#87840](https://github.com/rust-lang/rust/issues/87840))
Checked subtraction with an unsigned integer. Computes `self - rhs`, returning `None` if overflow occurred.
##### Examples
Basic usage:
```
assert_eq!(1i128.checked_sub_unsigned(2), Some(-1));
assert_eq!((i128::MIN + 2).checked_sub_unsigned(3), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#233-240)1.0.0 (const: 1.47.0) · #### pub const fn checked\_mul(self, rhs: i128) -> Option<i128>
Checked integer multiplication. Computes `self * rhs`, returning `None` if overflow occurred.
##### Examples
Basic usage:
```
assert_eq!(i128::MAX.checked_mul(1), Some(i128::MAX));
assert_eq!(i128::MAX.checked_mul(2), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#233-240)const: [unstable](https://github.com/rust-lang/rust/issues/85122 "Tracking issue for const_inherent_unchecked_arith") · #### pub unsafe fn unchecked\_mul(self, rhs: i128) -> i128
🔬This is a nightly-only experimental API. (`unchecked_math` [#85122](https://github.com/rust-lang/rust/issues/85122))
Unchecked integer multiplication. Computes `self * rhs`, assuming overflow cannot occur.
##### Safety
This results in undefined behavior when `self * rhs > i128::MAX` or `self * rhs < i128::MIN`, i.e. when [`checked_mul`](primitive.i128#method.checked_mul) would return `None`.
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#233-240)1.0.0 (const: 1.52.0) · #### pub const fn checked\_div(self, rhs: i128) -> Option<i128>
Checked integer division. Computes `self / rhs`, returning `None` if `rhs == 0` or the division results in overflow.
##### Examples
Basic usage:
```
assert_eq!((i128::MIN + 1).checked_div(-1), Some(170141183460469231731687303715884105727));
assert_eq!(i128::MIN.checked_div(-1), None);
assert_eq!((1i128).checked_div(0), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#233-240)1.38.0 (const: 1.52.0) · #### pub const fn checked\_div\_euclid(self, rhs: i128) -> Option<i128>
Checked Euclidean division. Computes `self.div_euclid(rhs)`, returning `None` if `rhs == 0` or the division results in overflow.
##### Examples
Basic usage:
```
assert_eq!((i128::MIN + 1).checked_div_euclid(-1), Some(170141183460469231731687303715884105727));
assert_eq!(i128::MIN.checked_div_euclid(-1), None);
assert_eq!((1i128).checked_div_euclid(0), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#233-240)1.7.0 (const: 1.52.0) · #### pub const fn checked\_rem(self, rhs: i128) -> Option<i128>
Checked integer remainder. Computes `self % rhs`, returning `None` if `rhs == 0` or the division results in overflow.
##### Examples
Basic usage:
```
assert_eq!(5i128.checked_rem(2), Some(1));
assert_eq!(5i128.checked_rem(0), None);
assert_eq!(i128::MIN.checked_rem(-1), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#233-240)1.38.0 (const: 1.52.0) · #### pub const fn checked\_rem\_euclid(self, rhs: i128) -> Option<i128>
Checked Euclidean remainder. Computes `self.rem_euclid(rhs)`, returning `None` if `rhs == 0` or the division results in overflow.
##### Examples
Basic usage:
```
assert_eq!(5i128.checked_rem_euclid(2), Some(1));
assert_eq!(5i128.checked_rem_euclid(0), None);
assert_eq!(i128::MIN.checked_rem_euclid(-1), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#233-240)1.7.0 (const: 1.47.0) · #### pub const fn checked\_neg(self) -> Option<i128>
Checked negation. Computes `-self`, returning `None` if `self == MIN`.
##### Examples
Basic usage:
```
assert_eq!(5i128.checked_neg(), Some(-5));
assert_eq!(i128::MIN.checked_neg(), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#233-240)1.7.0 (const: 1.47.0) · #### pub const fn checked\_shl(self, rhs: u32) -> Option<i128>
Checked shift left. Computes `self << rhs`, returning `None` if `rhs` is larger than or equal to the number of bits in `self`.
##### Examples
Basic usage:
```
assert_eq!(0x1i128.checked_shl(4), Some(0x10));
assert_eq!(0x1i128.checked_shl(129), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#233-240)const: [unstable](https://github.com/rust-lang/rust/issues/85122 "Tracking issue for const_inherent_unchecked_arith") · #### pub unsafe fn unchecked\_shl(self, rhs: i128) -> i128
🔬This is a nightly-only experimental API. (`unchecked_math` [#85122](https://github.com/rust-lang/rust/issues/85122))
Unchecked shift left. Computes `self << rhs`, assuming that `rhs` is less than the number of bits in `self`.
##### Safety
This results in undefined behavior if `rhs` is larger than or equal to the number of bits in `self`, i.e. when [`checked_shl`](primitive.i128#method.checked_shl) would return `None`.
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#233-240)1.7.0 (const: 1.47.0) · #### pub const fn checked\_shr(self, rhs: u32) -> Option<i128>
Checked shift right. Computes `self >> rhs`, returning `None` if `rhs` is larger than or equal to the number of bits in `self`.
##### Examples
Basic usage:
```
assert_eq!(0x10i128.checked_shr(4), Some(0x1));
assert_eq!(0x10i128.checked_shr(128), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#233-240)const: [unstable](https://github.com/rust-lang/rust/issues/85122 "Tracking issue for const_inherent_unchecked_arith") · #### pub unsafe fn unchecked\_shr(self, rhs: i128) -> i128
🔬This is a nightly-only experimental API. (`unchecked_math` [#85122](https://github.com/rust-lang/rust/issues/85122))
Unchecked shift right. Computes `self >> rhs`, assuming that `rhs` is less than the number of bits in `self`.
##### Safety
This results in undefined behavior if `rhs` is larger than or equal to the number of bits in `self`, i.e. when [`checked_shr`](primitive.i128#method.checked_shr) would return `None`.
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#233-240)1.13.0 (const: 1.47.0) · #### pub const fn checked\_abs(self) -> Option<i128>
Checked absolute value. Computes `self.abs()`, returning `None` if `self == MIN`.
##### Examples
Basic usage:
```
assert_eq!((-5i128).checked_abs(), Some(5));
assert_eq!(i128::MIN.checked_abs(), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#233-240)1.34.0 (const: 1.50.0) · #### pub const fn checked\_pow(self, exp: u32) -> Option<i128>
Checked exponentiation. Computes `self.pow(exp)`, returning `None` if overflow occurred.
##### Examples
Basic usage:
```
assert_eq!(8i128.checked_pow(2), Some(64));
assert_eq!(i128::MAX.checked_pow(2), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#233-240)1.0.0 (const: 1.47.0) · #### pub const fn saturating\_add(self, rhs: i128) -> i128
Saturating integer addition. Computes `self + rhs`, saturating at the numeric bounds instead of overflowing.
##### Examples
Basic usage:
```
assert_eq!(100i128.saturating_add(1), 101);
assert_eq!(i128::MAX.saturating_add(100), i128::MAX);
assert_eq!(i128::MIN.saturating_add(-1), i128::MIN);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#233-240)const: [unstable](https://github.com/rust-lang/rust/issues/87840 "Tracking issue for mixed_integer_ops") · #### pub fn saturating\_add\_unsigned(self, rhs: u128) -> i128
🔬This is a nightly-only experimental API. (`mixed_integer_ops` [#87840](https://github.com/rust-lang/rust/issues/87840))
Saturating addition with an unsigned integer. Computes `self + rhs`, saturating at the numeric bounds instead of overflowing.
##### Examples
Basic usage:
```
assert_eq!(1i128.saturating_add_unsigned(2), 3);
assert_eq!(i128::MAX.saturating_add_unsigned(100), i128::MAX);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#233-240)1.0.0 (const: 1.47.0) · #### pub const fn saturating\_sub(self, rhs: i128) -> i128
Saturating integer subtraction. Computes `self - rhs`, saturating at the numeric bounds instead of overflowing.
##### Examples
Basic usage:
```
assert_eq!(100i128.saturating_sub(127), -27);
assert_eq!(i128::MIN.saturating_sub(100), i128::MIN);
assert_eq!(i128::MAX.saturating_sub(-1), i128::MAX);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#233-240)const: [unstable](https://github.com/rust-lang/rust/issues/87840 "Tracking issue for mixed_integer_ops") · #### pub fn saturating\_sub\_unsigned(self, rhs: u128) -> i128
🔬This is a nightly-only experimental API. (`mixed_integer_ops` [#87840](https://github.com/rust-lang/rust/issues/87840))
Saturating subtraction with an unsigned integer. Computes `self - rhs`, saturating at the numeric bounds instead of overflowing.
##### Examples
Basic usage:
```
assert_eq!(100i128.saturating_sub_unsigned(127), -27);
assert_eq!(i128::MIN.saturating_sub_unsigned(100), i128::MIN);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#233-240)1.45.0 (const: 1.47.0) · #### pub const fn saturating\_neg(self) -> i128
Saturating integer negation. Computes `-self`, returning `MAX` if `self == MIN` instead of overflowing.
##### Examples
Basic usage:
```
assert_eq!(100i128.saturating_neg(), -100);
assert_eq!((-100i128).saturating_neg(), 100);
assert_eq!(i128::MIN.saturating_neg(), i128::MAX);
assert_eq!(i128::MAX.saturating_neg(), i128::MIN + 1);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#233-240)1.45.0 (const: 1.47.0) · #### pub const fn saturating\_abs(self) -> i128
Saturating absolute value. Computes `self.abs()`, returning `MAX` if `self == MIN` instead of overflowing.
##### Examples
Basic usage:
```
assert_eq!(100i128.saturating_abs(), 100);
assert_eq!((-100i128).saturating_abs(), 100);
assert_eq!(i128::MIN.saturating_abs(), i128::MAX);
assert_eq!((i128::MIN + 1).saturating_abs(), i128::MAX);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#233-240)1.7.0 (const: 1.47.0) · #### pub const fn saturating\_mul(self, rhs: i128) -> i128
Saturating integer multiplication. Computes `self * rhs`, saturating at the numeric bounds instead of overflowing.
##### Examples
Basic usage:
```
assert_eq!(10i128.saturating_mul(12), 120);
assert_eq!(i128::MAX.saturating_mul(10), i128::MAX);
assert_eq!(i128::MIN.saturating_mul(10), i128::MIN);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#233-240)1.58.0 (const: 1.58.0) · #### pub const fn saturating\_div(self, rhs: i128) -> i128
Saturating integer division. Computes `self / rhs`, saturating at the numeric bounds instead of overflowing.
##### Examples
Basic usage:
```
assert_eq!(5i128.saturating_div(2), 2);
assert_eq!(i128::MAX.saturating_div(-1), i128::MIN + 1);
assert_eq!(i128::MIN.saturating_div(-1), i128::MAX);
```
ⓘ
```
let _ = 1i128.saturating_div(0);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#233-240)1.34.0 (const: 1.50.0) · #### pub const fn saturating\_pow(self, exp: u32) -> i128
Saturating integer exponentiation. Computes `self.pow(exp)`, saturating at the numeric bounds instead of overflowing.
##### Examples
Basic usage:
```
assert_eq!((-4i128).saturating_pow(3), -64);
assert_eq!(i128::MIN.saturating_pow(2), i128::MAX);
assert_eq!(i128::MIN.saturating_pow(3), i128::MIN);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#233-240)1.0.0 (const: 1.32.0) · #### pub const fn wrapping\_add(self, rhs: i128) -> i128
Wrapping (modular) addition. Computes `self + rhs`, wrapping around at the boundary of the type.
##### Examples
Basic usage:
```
assert_eq!(100i128.wrapping_add(27), 127);
assert_eq!(i128::MAX.wrapping_add(2), i128::MIN + 1);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#233-240)const: [unstable](https://github.com/rust-lang/rust/issues/87840 "Tracking issue for mixed_integer_ops") · #### pub fn wrapping\_add\_unsigned(self, rhs: u128) -> i128
🔬This is a nightly-only experimental API. (`mixed_integer_ops` [#87840](https://github.com/rust-lang/rust/issues/87840))
Wrapping (modular) addition with an unsigned integer. Computes `self + rhs`, wrapping around at the boundary of the type.
##### Examples
Basic usage:
```
assert_eq!(100i128.wrapping_add_unsigned(27), 127);
assert_eq!(i128::MAX.wrapping_add_unsigned(2), i128::MIN + 1);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#233-240)1.0.0 (const: 1.32.0) · #### pub const fn wrapping\_sub(self, rhs: i128) -> i128
Wrapping (modular) subtraction. Computes `self - rhs`, wrapping around at the boundary of the type.
##### Examples
Basic usage:
```
assert_eq!(0i128.wrapping_sub(127), -127);
assert_eq!((-2i128).wrapping_sub(i128::MAX), i128::MAX);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#233-240)const: [unstable](https://github.com/rust-lang/rust/issues/87840 "Tracking issue for mixed_integer_ops") · #### pub fn wrapping\_sub\_unsigned(self, rhs: u128) -> i128
🔬This is a nightly-only experimental API. (`mixed_integer_ops` [#87840](https://github.com/rust-lang/rust/issues/87840))
Wrapping (modular) subtraction with an unsigned integer. Computes `self - rhs`, wrapping around at the boundary of the type.
##### Examples
Basic usage:
```
assert_eq!(0i128.wrapping_sub_unsigned(127), -127);
assert_eq!((-2i128).wrapping_sub_unsigned(u128::MAX), -1);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#233-240)1.0.0 (const: 1.32.0) · #### pub const fn wrapping\_mul(self, rhs: i128) -> i128
Wrapping (modular) multiplication. Computes `self * rhs`, wrapping around at the boundary of the type.
##### Examples
Basic usage:
```
assert_eq!(10i128.wrapping_mul(12), 120);
assert_eq!(11i8.wrapping_mul(12), -124);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#233-240)1.2.0 (const: 1.52.0) · #### pub const fn wrapping\_div(self, rhs: i128) -> i128
Wrapping (modular) division. Computes `self / rhs`, wrapping around at the boundary of the type.
The only case where such wrapping can occur is when one divides `MIN / -1` on a signed type (where `MIN` is the negative minimal value for the type); this is equivalent to `-MIN`, a positive value that is too large to represent in the type. In such a case, this function returns `MIN` itself.
##### Panics
This function will panic if `rhs` is 0.
##### Examples
Basic usage:
```
assert_eq!(100i128.wrapping_div(10), 10);
assert_eq!((-128i8).wrapping_div(-1), -128);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#233-240)1.38.0 (const: 1.52.0) · #### pub const fn wrapping\_div\_euclid(self, rhs: i128) -> i128
Wrapping Euclidean division. Computes `self.div_euclid(rhs)`, wrapping around at the boundary of the type.
Wrapping will only occur in `MIN / -1` on a signed type (where `MIN` is the negative minimal value for the type). This is equivalent to `-MIN`, a positive value that is too large to represent in the type. In this case, this method returns `MIN` itself.
##### Panics
This function will panic if `rhs` is 0.
##### Examples
Basic usage:
```
assert_eq!(100i128.wrapping_div_euclid(10), 10);
assert_eq!((-128i8).wrapping_div_euclid(-1), -128);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#233-240)1.2.0 (const: 1.52.0) · #### pub const fn wrapping\_rem(self, rhs: i128) -> i128
Wrapping (modular) remainder. Computes `self % rhs`, wrapping around at the boundary of the type.
Such wrap-around never actually occurs mathematically; implementation artifacts make `x % y` invalid for `MIN / -1` on a signed type (where `MIN` is the negative minimal value). In such a case, this function returns `0`.
##### Panics
This function will panic if `rhs` is 0.
##### Examples
Basic usage:
```
assert_eq!(100i128.wrapping_rem(10), 0);
assert_eq!((-128i8).wrapping_rem(-1), 0);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#233-240)1.38.0 (const: 1.52.0) · #### pub const fn wrapping\_rem\_euclid(self, rhs: i128) -> i128
Wrapping Euclidean remainder. Computes `self.rem_euclid(rhs)`, wrapping around at the boundary of the type.
Wrapping will only occur in `MIN % -1` on a signed type (where `MIN` is the negative minimal value for the type). In this case, this method returns 0.
##### Panics
This function will panic if `rhs` is 0.
##### Examples
Basic usage:
```
assert_eq!(100i128.wrapping_rem_euclid(10), 0);
assert_eq!((-128i8).wrapping_rem_euclid(-1), 0);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#233-240)1.2.0 (const: 1.32.0) · #### pub const fn wrapping\_neg(self) -> i128
Wrapping (modular) negation. Computes `-self`, wrapping around at the boundary of the type.
The only case where such wrapping can occur is when one negates `MIN` on a signed type (where `MIN` is 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:
```
assert_eq!(100i128.wrapping_neg(), -100);
assert_eq!(i128::MIN.wrapping_neg(), i128::MIN);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#233-240)1.2.0 (const: 1.32.0) · #### pub const fn wrapping\_shl(self, rhs: u32) -> i128
Panic-free bitwise shift-left; yields `self << mask(rhs)`, where `mask` removes any high-order bits of `rhs` that would cause the shift to exceed the bitwidth of the type.
Note that this is *not* the same as a rotate-left; the RHS of a wrapping shift-left is restricted to the range of the type, rather than the bits shifted out of the LHS being returned to the other end. The primitive integer types all implement a [`rotate_left`](primitive.i128#method.rotate_left) function, which may be what you want instead.
##### Examples
Basic usage:
```
assert_eq!((-1i128).wrapping_shl(7), -128);
assert_eq!((-1i128).wrapping_shl(128), -1);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#233-240)1.2.0 (const: 1.32.0) · #### pub const fn wrapping\_shr(self, rhs: u32) -> i128
Panic-free bitwise shift-right; yields `self >> mask(rhs)`, where `mask` removes any high-order bits of `rhs` that would cause the shift to exceed the bitwidth of the type.
Note that this is *not* the same as a rotate-right; the RHS of a wrapping shift-right is restricted to the range of the type, rather than the bits shifted out of the LHS being returned to the other end. The primitive integer types all implement a [`rotate_right`](primitive.i128#method.rotate_right) function, which may be what you want instead.
##### Examples
Basic usage:
```
assert_eq!((-128i128).wrapping_shr(7), -1);
assert_eq!((-128i16).wrapping_shr(64), -128);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#233-240)1.13.0 (const: 1.32.0) · #### pub const fn wrapping\_abs(self) -> i128
Wrapping (modular) absolute value. Computes `self.abs()`, 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:
```
assert_eq!(100i128.wrapping_abs(), 100);
assert_eq!((-100i128).wrapping_abs(), 100);
assert_eq!(i128::MIN.wrapping_abs(), i128::MIN);
assert_eq!((-128i8).wrapping_abs() as u8, 128);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#233-240)1.51.0 (const: 1.51.0) · #### pub const fn unsigned\_abs(self) -> u128
Computes the absolute value of `self` without any wrapping or panicking.
##### Examples
Basic usage:
```
assert_eq!(100i128.unsigned_abs(), 100u128);
assert_eq!((-100i128).unsigned_abs(), 100u128);
assert_eq!((-128i8).unsigned_abs(), 128u8);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#233-240)1.34.0 (const: 1.50.0) · #### pub const fn wrapping\_pow(self, exp: u32) -> i128
Wrapping (modular) exponentiation. Computes `self.pow(exp)`, wrapping around at the boundary of the type.
##### Examples
Basic usage:
```
assert_eq!(3i128.wrapping_pow(4), 81);
assert_eq!(3i8.wrapping_pow(5), -13);
assert_eq!(3i8.wrapping_pow(6), -39);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#233-240)1.7.0 (const: 1.32.0) · #### pub const fn overflowing\_add(self, rhs: i128) -> (i128, bool)
Calculates `self` + `rhs`
Returns a tuple of the addition along with a boolean indicating whether an arithmetic overflow would occur. If an overflow would have occurred then the wrapped value is returned.
##### Examples
Basic usage:
```
assert_eq!(5i128.overflowing_add(2), (7, false));
assert_eq!(i128::MAX.overflowing_add(1), (i128::MIN, true));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#233-240)const: [unstable](https://github.com/rust-lang/rust/issues/85532 "Tracking issue for const_bigint_helper_methods") · #### pub fn carrying\_add(self, rhs: i128, carry: bool) -> (i128, bool)
🔬This is a nightly-only experimental API. (`bigint_helper_methods` [#85532](https://github.com/rust-lang/rust/issues/85532))
Calculates `self + rhs + carry` without the ability to overflow.
Performs “signed ternary addition” which takes in an extra bit to add, and may return an additional bit of overflow. This signed function is used only on the highest-ordered data, for which the signed overflow result indicates whether the big integer overflowed or not.
##### Examples
Basic usage:
```
#![feature(bigint_helper_methods)]
assert_eq!(5i128.carrying_add(2, false), (7, false));
assert_eq!(5i128.carrying_add(2, true), (8, false));
assert_eq!(i128::MAX.carrying_add(1, false), (i128::MIN, true));
assert_eq!(i128::MAX.carrying_add(0, true), (i128::MIN, true));
assert_eq!(i128::MAX.carrying_add(1, true), (i128::MIN + 1, true));
assert_eq!(i128::MAX.carrying_add(i128::MAX, true), (-1, true));
assert_eq!(i128::MIN.carrying_add(-1, true), (i128::MIN, false));
assert_eq!(0i128.carrying_add(i128::MAX, true), (i128::MIN, true));
```
If `carry` is false, this method is equivalent to [`overflowing_add`](primitive.i128#method.overflowing_add):
```
#![feature(bigint_helper_methods)]
assert_eq!(5_i128.carrying_add(2, false), 5_i128.overflowing_add(2));
assert_eq!(i128::MAX.carrying_add(1, false), i128::MAX.overflowing_add(1));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#233-240)const: [unstable](https://github.com/rust-lang/rust/issues/87840 "Tracking issue for mixed_integer_ops") · #### pub fn overflowing\_add\_unsigned(self, rhs: u128) -> (i128, bool)
🔬This is a nightly-only experimental API. (`mixed_integer_ops` [#87840](https://github.com/rust-lang/rust/issues/87840))
Calculates `self` + `rhs` with an unsigned `rhs`
Returns a tuple of the addition along with a boolean indicating whether an arithmetic overflow would occur. If an overflow would have occurred then the wrapped value is returned.
##### Examples
Basic usage:
```
assert_eq!(1i128.overflowing_add_unsigned(2), (3, false));
assert_eq!((i128::MIN).overflowing_add_unsigned(u128::MAX), (i128::MAX, false));
assert_eq!((i128::MAX - 2).overflowing_add_unsigned(3), (i128::MIN, true));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#233-240)1.7.0 (const: 1.32.0) · #### pub const fn overflowing\_sub(self, rhs: i128) -> (i128, bool)
Calculates `self` - `rhs`
Returns a tuple of the subtraction along with a boolean indicating whether an arithmetic overflow would occur. If an overflow would have occurred then the wrapped value is returned.
##### Examples
Basic usage:
```
assert_eq!(5i128.overflowing_sub(2), (3, false));
assert_eq!(i128::MIN.overflowing_sub(1), (i128::MAX, true));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#233-240)const: [unstable](https://github.com/rust-lang/rust/issues/85532 "Tracking issue for const_bigint_helper_methods") · #### pub fn borrowing\_sub(self, rhs: i128, borrow: bool) -> (i128, bool)
🔬This is a nightly-only experimental API. (`bigint_helper_methods` [#85532](https://github.com/rust-lang/rust/issues/85532))
Calculates `self - rhs - borrow` without the ability to overflow.
Performs “signed ternary subtraction” which takes in an extra bit to subtract, and may return an additional bit of overflow. This signed function is used only on the highest-ordered data, for which the signed overflow result indicates whether the big integer overflowed or not.
##### Examples
Basic usage:
```
#![feature(bigint_helper_methods)]
assert_eq!(5i128.borrowing_sub(2, false), (3, false));
assert_eq!(5i128.borrowing_sub(2, true), (2, false));
assert_eq!(0i128.borrowing_sub(1, false), (-1, false));
assert_eq!(0i128.borrowing_sub(1, true), (-2, false));
assert_eq!(i128::MIN.borrowing_sub(1, true), (i128::MAX - 1, true));
assert_eq!(i128::MAX.borrowing_sub(-1, false), (i128::MIN, true));
assert_eq!(i128::MAX.borrowing_sub(-1, true), (i128::MAX, false));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#233-240)const: [unstable](https://github.com/rust-lang/rust/issues/87840 "Tracking issue for mixed_integer_ops") · #### pub fn overflowing\_sub\_unsigned(self, rhs: u128) -> (i128, bool)
🔬This is a nightly-only experimental API. (`mixed_integer_ops` [#87840](https://github.com/rust-lang/rust/issues/87840))
Calculates `self` - `rhs` with an unsigned `rhs`
Returns a tuple of the subtraction along with a boolean indicating whether an arithmetic overflow would occur. If an overflow would have occurred then the wrapped value is returned.
##### Examples
Basic usage:
```
assert_eq!(1i128.overflowing_sub_unsigned(2), (-1, false));
assert_eq!((i128::MAX).overflowing_sub_unsigned(u128::MAX), (i128::MIN, false));
assert_eq!((i128::MIN + 2).overflowing_sub_unsigned(3), (i128::MAX, true));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#233-240)1.7.0 (const: 1.32.0) · #### pub const fn overflowing\_mul(self, rhs: i128) -> (i128, bool)
Calculates the multiplication of `self` and `rhs`.
Returns a tuple of the multiplication along with a boolean indicating whether an arithmetic overflow would occur. If an overflow would have occurred then the wrapped value is returned.
##### Examples
Basic usage:
```
assert_eq!(5i128.overflowing_mul(2), (10, false));
assert_eq!(1_000_000_000i32.overflowing_mul(10), (1410065408, true));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#233-240)1.7.0 (const: 1.52.0) · #### pub const fn overflowing\_div(self, rhs: i128) -> (i128, bool)
Calculates the divisor when `self` is divided by `rhs`.
Returns a tuple of the divisor along with a boolean indicating whether an arithmetic overflow would occur. If an overflow would occur then self is returned.
##### Panics
This function will panic if `rhs` is 0.
##### Examples
Basic usage:
```
assert_eq!(5i128.overflowing_div(2), (2, false));
assert_eq!(i128::MIN.overflowing_div(-1), (i128::MIN, true));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#233-240)1.38.0 (const: 1.52.0) · #### pub const fn overflowing\_div\_euclid(self, rhs: i128) -> (i128, bool)
Calculates the quotient of Euclidean division `self.div_euclid(rhs)`.
Returns a tuple of the divisor along with a boolean indicating whether an arithmetic overflow would occur. If an overflow would occur then `self` is returned.
##### Panics
This function will panic if `rhs` is 0.
##### Examples
Basic usage:
```
assert_eq!(5i128.overflowing_div_euclid(2), (2, false));
assert_eq!(i128::MIN.overflowing_div_euclid(-1), (i128::MIN, true));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#233-240)1.7.0 (const: 1.52.0) · #### pub const fn overflowing\_rem(self, rhs: i128) -> (i128, bool)
Calculates the remainder when `self` is divided by `rhs`.
Returns a tuple of the remainder after dividing along with a boolean indicating whether an arithmetic overflow would occur. If an overflow would occur then 0 is returned.
##### Panics
This function will panic if `rhs` is 0.
##### Examples
Basic usage:
```
assert_eq!(5i128.overflowing_rem(2), (1, false));
assert_eq!(i128::MIN.overflowing_rem(-1), (0, true));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#233-240)1.38.0 (const: 1.52.0) · #### pub const fn overflowing\_rem\_euclid(self, rhs: i128) -> (i128, bool)
Overflowing Euclidean remainder. Calculates `self.rem_euclid(rhs)`.
Returns a tuple of the remainder after dividing along with a boolean indicating whether an arithmetic overflow would occur. If an overflow would occur then 0 is returned.
##### Panics
This function will panic if `rhs` is 0.
##### Examples
Basic usage:
```
assert_eq!(5i128.overflowing_rem_euclid(2), (1, false));
assert_eq!(i128::MIN.overflowing_rem_euclid(-1), (0, true));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#233-240)1.7.0 (const: 1.32.0) · #### pub const fn overflowing\_neg(self) -> (i128, bool)
Negates self, overflowing if this is equal to the minimum value.
Returns a tuple of the negated version of self along with a boolean indicating whether an overflow happened. If `self` is the minimum value (e.g., `i32::MIN` for values of type `i32`), then the minimum value will be returned again and `true` will be returned for an overflow happening.
##### Examples
Basic usage:
```
assert_eq!(2i128.overflowing_neg(), (-2, false));
assert_eq!(i128::MIN.overflowing_neg(), (i128::MIN, true));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#233-240)1.7.0 (const: 1.32.0) · #### pub const fn overflowing\_shl(self, rhs: u32) -> (i128, bool)
Shifts self left by `rhs` bits.
Returns a tuple of the shifted version of self along with a boolean indicating whether the shift value was larger than or equal to the number of bits. If the shift value is too large, then value is masked (N-1) where N is the number of bits, and this value is then used to perform the shift.
##### Examples
Basic usage:
```
assert_eq!(0x1i128.overflowing_shl(4), (0x10, false));
assert_eq!(0x1i32.overflowing_shl(36), (0x10, true));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#233-240)1.7.0 (const: 1.32.0) · #### pub const fn overflowing\_shr(self, rhs: u32) -> (i128, bool)
Shifts self right by `rhs` bits.
Returns a tuple of the shifted version of self along with a boolean indicating whether the shift value was larger than or equal to the number of bits. If the shift value is too large, then value is masked (N-1) where N is the number of bits, and this value is then used to perform the shift.
##### Examples
Basic usage:
```
assert_eq!(0x10i128.overflowing_shr(4), (0x1, false));
assert_eq!(0x10i32.overflowing_shr(36), (0x1, true));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#233-240)1.13.0 (const: 1.32.0) · #### pub const fn overflowing\_abs(self) -> (i128, bool)
Computes the absolute value of `self`.
Returns a tuple of the absolute version of self along with a boolean indicating whether an overflow happened. If self is the minimum value (e.g., i128::MIN for values of type i128), then the minimum value will be returned again and true will be returned for an overflow happening.
##### Examples
Basic usage:
```
assert_eq!(10i128.overflowing_abs(), (10, false));
assert_eq!((-10i128).overflowing_abs(), (10, false));
assert_eq!((i128::MIN).overflowing_abs(), (i128::MIN, true));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#233-240)1.34.0 (const: 1.50.0) · #### pub const fn overflowing\_pow(self, exp: u32) -> (i128, bool)
Raises self to the power of `exp`, using exponentiation by squaring.
Returns a tuple of the exponentiation along with a bool indicating whether an overflow happened.
##### Examples
Basic usage:
```
assert_eq!(3i128.overflowing_pow(4), (81, false));
assert_eq!(3i8.overflowing_pow(5), (-13, true));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#233-240)1.0.0 (const: 1.50.0) · #### pub const fn pow(self, exp: u32) -> i128
Raises self to the power of `exp`, using exponentiation by squaring.
##### Examples
Basic usage:
```
let x: i128 = 2; // or any other integer type
assert_eq!(x.pow(5), 32);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#233-240)1.38.0 (const: 1.52.0) · #### pub const fn div\_euclid(self, rhs: i128) -> i128
Calculates the quotient of Euclidean division of `self` by `rhs`.
This computes the integer `q` such that `self = q * rhs + r`, with `r = self.rem_euclid(rhs)` and `0 <= r < abs(rhs)`.
In other words, the result is `self / rhs` rounded to the integer `q` such that `self >= q * rhs`. If `self > 0`, this is equal to round towards zero (the default in Rust); if `self < 0`, this is equal to round towards +/- infinity.
##### Panics
This function will panic if `rhs` is 0 or the division results in overflow.
##### Examples
Basic usage:
```
let a: i128 = 7; // or any other integer type
let b = 4;
assert_eq!(a.div_euclid(b), 1); // 7 >= 4 * 1
assert_eq!(a.div_euclid(-b), -1); // 7 >= -4 * -1
assert_eq!((-a).div_euclid(b), -2); // -7 >= 4 * -2
assert_eq!((-a).div_euclid(-b), 2); // -7 >= -4 * 2
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#233-240)1.38.0 (const: 1.52.0) · #### pub const fn rem\_euclid(self, rhs: i128) -> i128
Calculates the least nonnegative remainder of `self (mod rhs)`.
This is done as if by the Euclidean division algorithm – given `r = self.rem_euclid(rhs)`, `self = rhs * self.div_euclid(rhs) + r`, and `0 <= r < abs(rhs)`.
##### Panics
This function will panic if `rhs` is 0 or the division results in overflow.
##### Examples
Basic usage:
```
let a: i128 = 7; // or any other integer type
let b = 4;
assert_eq!(a.rem_euclid(b), 3);
assert_eq!((-a).rem_euclid(b), 1);
assert_eq!(a.rem_euclid(-b), 3);
assert_eq!((-a).rem_euclid(-b), 1);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#233-240)#### pub const fn div\_floor(self, rhs: i128) -> i128
🔬This is a nightly-only experimental API. (`int_roundings` [#88581](https://github.com/rust-lang/rust/issues/88581))
Calculates the quotient of `self` and `rhs`, rounding the result towards negative infinity.
##### Panics
This function will panic if `rhs` is zero.
###### [Overflow behavior](#overflow-behavior)
On overflow, this function will panic if overflow checks are enabled (default in debug mode) and wrap if overflow checks are disabled (default in release mode).
##### Examples
Basic usage:
```
#![feature(int_roundings)]
let a: i128 = 8;
let b = 3;
assert_eq!(a.div_floor(b), 2);
assert_eq!(a.div_floor(-b), -3);
assert_eq!((-a).div_floor(b), -3);
assert_eq!((-a).div_floor(-b), 2);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#233-240)#### pub const fn div\_ceil(self, rhs: i128) -> i128
🔬This is a nightly-only experimental API. (`int_roundings` [#88581](https://github.com/rust-lang/rust/issues/88581))
Calculates the quotient of `self` and `rhs`, rounding the result towards positive infinity.
##### Panics
This function will panic if `rhs` is zero.
###### [Overflow behavior](#overflow-behavior-1)
On overflow, this function will panic if overflow checks are enabled (default in debug mode) and wrap if overflow checks are disabled (default in release mode).
##### Examples
Basic usage:
```
#![feature(int_roundings)]
let a: i128 = 8;
let b = 3;
assert_eq!(a.div_ceil(b), 3);
assert_eq!(a.div_ceil(-b), -2);
assert_eq!((-a).div_ceil(b), -2);
assert_eq!((-a).div_ceil(-b), 3);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#233-240)#### pub const fn next\_multiple\_of(self, rhs: i128) -> i128
🔬This is a nightly-only experimental API. (`int_roundings` [#88581](https://github.com/rust-lang/rust/issues/88581))
If `rhs` is positive, calculates the smallest value greater than or equal to `self` that is a multiple of `rhs`. If `rhs` is negative, calculates the largest value less than or equal to `self` that is a multiple of `rhs`.
##### Panics
This function will panic if `rhs` is zero.
###### [Overflow behavior](#overflow-behavior-2)
On overflow, this function will panic if overflow checks are enabled (default in debug mode) and wrap if overflow checks are disabled (default in release mode).
##### Examples
Basic usage:
```
#![feature(int_roundings)]
assert_eq!(16_i128.next_multiple_of(8), 16);
assert_eq!(23_i128.next_multiple_of(8), 24);
assert_eq!(16_i128.next_multiple_of(-8), 16);
assert_eq!(23_i128.next_multiple_of(-8), 16);
assert_eq!((-16_i128).next_multiple_of(8), -16);
assert_eq!((-23_i128).next_multiple_of(8), -16);
assert_eq!((-16_i128).next_multiple_of(-8), -16);
assert_eq!((-23_i128).next_multiple_of(-8), -24);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#233-240)#### pub const fn checked\_next\_multiple\_of(self, rhs: i128) -> Option<i128>
🔬This is a nightly-only experimental API. (`int_roundings` [#88581](https://github.com/rust-lang/rust/issues/88581))
If `rhs` is positive, calculates the smallest value greater than or equal to `self` that is a multiple of `rhs`. If `rhs` is negative, calculates the largest value less than or equal to `self` that is a multiple of `rhs`. Returns `None` if `rhs` is zero or the operation would result in overflow.
##### Examples
Basic usage:
```
#![feature(int_roundings)]
assert_eq!(16_i128.checked_next_multiple_of(8), Some(16));
assert_eq!(23_i128.checked_next_multiple_of(8), Some(24));
assert_eq!(16_i128.checked_next_multiple_of(-8), Some(16));
assert_eq!(23_i128.checked_next_multiple_of(-8), Some(16));
assert_eq!((-16_i128).checked_next_multiple_of(8), Some(-16));
assert_eq!((-23_i128).checked_next_multiple_of(8), Some(-16));
assert_eq!((-16_i128).checked_next_multiple_of(-8), Some(-16));
assert_eq!((-23_i128).checked_next_multiple_of(-8), Some(-24));
assert_eq!(1_i128.checked_next_multiple_of(0), None);
assert_eq!(i128::MAX.checked_next_multiple_of(2), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#233-240)#### pub const fn ilog(self, base: i128) -> u32
🔬This is a nightly-only experimental API. (`int_log` [#70887](https://github.com/rust-lang/rust/issues/70887))
Returns the logarithm of the number with respect to an arbitrary base, rounded down.
This method might not be optimized owing to implementation details; `ilog2` can produce results more efficiently for base 2, and `ilog10` can produce results more efficiently for base 10.
##### Panics
When the number is negative, zero, or if the base is not at least 2; it panics in debug mode and the return value is 0 in release mode.
##### Examples
```
#![feature(int_log)]
assert_eq!(5i128.ilog(5), 1);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#233-240)#### 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.
##### Panics
When the number is negative or zero it panics in debug mode and the return value is 0 in release mode.
##### Examples
```
#![feature(int_log)]
assert_eq!(2i128.ilog2(), 1);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#233-240)#### 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.
##### Panics
When the number is negative or zero it panics in debug mode and the return value is 0 in release mode.
##### Example
```
#![feature(int_log)]
assert_eq!(10i128.ilog10(), 1);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#233-240)#### pub const fn checked\_ilog(self, base: i128) -> Option<u32>
🔬This is a nightly-only experimental API. (`int_log` [#70887](https://github.com/rust-lang/rust/issues/70887))
Returns the logarithm of the number with respect to an arbitrary base, rounded down.
Returns `None` if the number is negative or zero, or if the base is not at least 2.
This method might not be optimized owing to implementation details; `checked_ilog2` can produce results more efficiently for base 2, and `checked_ilog10` can produce results more efficiently for base 10.
##### Examples
```
#![feature(int_log)]
assert_eq!(5i128.checked_ilog(5), Some(1));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#233-240)#### pub const fn checked\_ilog2(self) -> Option<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.
Returns `None` if the number is negative or zero.
##### Examples
```
#![feature(int_log)]
assert_eq!(2i128.checked_ilog2(), Some(1));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#233-240)#### pub const fn checked\_ilog10(self) -> Option<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.
Returns `None` if the number is negative or zero.
##### Example
```
#![feature(int_log)]
assert_eq!(10i128.checked_ilog10(), Some(1));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#233-240)1.0.0 (const: 1.32.0) · #### pub const fn abs(self) -> i128
Computes the absolute value of `self`.
##### Overflow behavior
The absolute value of `i128::MIN` cannot be represented as an `i128`, and attempting to calculate it will cause an overflow. This means that code in debug mode will trigger a panic on this case and optimized code will return `i128::MIN` without a panic.
##### Examples
Basic usage:
```
assert_eq!(10i128.abs(), 10);
assert_eq!((-10i128).abs(), 10);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#233-240)1.60.0 (const: 1.60.0) · #### pub const fn abs\_diff(self, other: i128) -> u128
Computes the absolute difference between `self` and `other`.
This function always returns the correct answer without overflow or panics by returning an unsigned integer.
##### Examples
Basic usage:
```
assert_eq!(100i128.abs_diff(80), 20u128);
assert_eq!(100i128.abs_diff(110), 10u128);
assert_eq!((-100i128).abs_diff(80), 180u128);
assert_eq!((-100i128).abs_diff(-120), 20u128);
assert_eq!(i128::MIN.abs_diff(i128::MAX), u128::MAX);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#233-240)1.0.0 (const: 1.47.0) · #### pub const fn signum(self) -> i128
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:
```
assert_eq!(10i128.signum(), 1);
assert_eq!(0i128.signum(), 0);
assert_eq!((-10i128).signum(), -1);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#233-240)1.0.0 (const: 1.32.0) · #### pub const fn is\_positive(self) -> bool
Returns `true` if `self` is positive and `false` if the number is zero or negative.
##### Examples
Basic usage:
```
assert!(10i128.is_positive());
assert!(!(-10i128).is_positive());
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#233-240)1.0.0 (const: 1.32.0) · #### pub const fn is\_negative(self) -> bool
Returns `true` if `self` is negative and `false` if the number is zero or positive.
##### Examples
Basic usage:
```
assert!((-10i128).is_negative());
assert!(!10i128.is_negative());
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#233-240)1.32.0 (const: 1.44.0) · #### pub const fn to\_be\_bytes(self) -> [u8; 16]
Return the memory representation of this integer as a byte array in big-endian (network) byte order.
##### Examples
```
let bytes = 0x12345678901234567890123456789012i128.to_be_bytes();
assert_eq!(bytes, [0x12, 0x34, 0x56, 0x78, 0x90, 0x12, 0x34, 0x56, 0x78, 0x90, 0x12, 0x34, 0x56, 0x78, 0x90, 0x12]);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#233-240)1.32.0 (const: 1.44.0) · #### pub const fn to\_le\_bytes(self) -> [u8; 16]
Return the memory representation of this integer as a byte array in little-endian byte order.
##### Examples
```
let bytes = 0x12345678901234567890123456789012i128.to_le_bytes();
assert_eq!(bytes, [0x12, 0x90, 0x78, 0x56, 0x34, 0x12, 0x90, 0x78, 0x56, 0x34, 0x12, 0x90, 0x78, 0x56, 0x34, 0x12]);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#233-240)1.32.0 (const: 1.44.0) · #### pub const fn to\_ne\_bytes(self) -> [u8; 16]
Return the memory representation of this integer as a byte array in native byte order.
As the target platform’s native endianness is used, portable code should use [`to_be_bytes`](primitive.i128#method.to_be_bytes) or [`to_le_bytes`](primitive.i128#method.to_le_bytes), as appropriate, instead.
##### Examples
```
let bytes = 0x12345678901234567890123456789012i128.to_ne_bytes();
assert_eq!(
bytes,
if cfg!(target_endian = "big") {
[0x12, 0x34, 0x56, 0x78, 0x90, 0x12, 0x34, 0x56, 0x78, 0x90, 0x12, 0x34, 0x56, 0x78, 0x90, 0x12]
} else {
[0x12, 0x90, 0x78, 0x56, 0x34, 0x12, 0x90, 0x78, 0x56, 0x34, 0x12, 0x90, 0x78, 0x56, 0x34, 0x12]
}
);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#233-240)1.32.0 (const: 1.44.0) · #### pub const fn from\_be\_bytes(bytes: [u8; 16]) -> i128
Create an integer value from its representation as a byte array in big endian.
##### Examples
```
let value = i128::from_be_bytes([0x12, 0x34, 0x56, 0x78, 0x90, 0x12, 0x34, 0x56, 0x78, 0x90, 0x12, 0x34, 0x56, 0x78, 0x90, 0x12]);
assert_eq!(value, 0x12345678901234567890123456789012);
```
When starting from a slice rather than an array, fallible conversion APIs can be used:
```
fn read_be_i128(input: &mut &[u8]) -> i128 {
let (int_bytes, rest) = input.split_at(std::mem::size_of::<i128>());
*input = rest;
i128::from_be_bytes(int_bytes.try_into().unwrap())
}
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#233-240)1.32.0 (const: 1.44.0) · #### pub const fn from\_le\_bytes(bytes: [u8; 16]) -> i128
Create an integer value from its representation as a byte array in little endian.
##### Examples
```
let value = i128::from_le_bytes([0x12, 0x90, 0x78, 0x56, 0x34, 0x12, 0x90, 0x78, 0x56, 0x34, 0x12, 0x90, 0x78, 0x56, 0x34, 0x12]);
assert_eq!(value, 0x12345678901234567890123456789012);
```
When starting from a slice rather than an array, fallible conversion APIs can be used:
```
fn read_le_i128(input: &mut &[u8]) -> i128 {
let (int_bytes, rest) = input.split_at(std::mem::size_of::<i128>());
*input = rest;
i128::from_le_bytes(int_bytes.try_into().unwrap())
}
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#233-240)1.32.0 (const: 1.44.0) · #### pub const fn from\_ne\_bytes(bytes: [u8; 16]) -> i128
Create an integer value from its memory representation as a byte array in native endianness.
As the target platform’s native endianness is used, portable code likely wants to use [`from_be_bytes`](primitive.i128#method.from_be_bytes) or [`from_le_bytes`](primitive.i128#method.from_le_bytes), as appropriate instead.
##### Examples
```
let value = i128::from_ne_bytes(if cfg!(target_endian = "big") {
[0x12, 0x34, 0x56, 0x78, 0x90, 0x12, 0x34, 0x56, 0x78, 0x90, 0x12, 0x34, 0x56, 0x78, 0x90, 0x12]
} else {
[0x12, 0x90, 0x78, 0x56, 0x34, 0x12, 0x90, 0x78, 0x56, 0x34, 0x12, 0x90, 0x78, 0x56, 0x34, 0x12]
});
assert_eq!(value, 0x12345678901234567890123456789012);
```
When starting from a slice rather than an array, fallible conversion APIs can be used:
```
fn read_ne_i128(input: &mut &[u8]) -> i128 {
let (int_bytes, rest) = input.split_at(std::mem::size_of::<i128>());
*input = rest;
i128::from_ne_bytes(int_bytes.try_into().unwrap())
}
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#233-240)1.0.0 (const: 1.32.0) · #### pub const fn min\_value() -> i128
👎Deprecating in a future Rust version: replaced by the `MIN` associated constant on this type
New code should prefer to use [`i128::MIN`](primitive.i128#associatedconstant.MIN "i128::MIN") instead.
Returns the smallest value that can be represented by this integer type.
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#233-240)1.0.0 (const: 1.32.0) · #### pub const fn max\_value() -> i128
👎Deprecating in a future Rust version: replaced by the `MAX` associated constant on this type
New code should prefer to use [`i128::MAX`](primitive.i128#associatedconstant.MAX "i128::MAX") instead.
Returns the largest value that can be represented by this integer type.
Trait Implementations
---------------------
[source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#133)1.0.0 (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
The resulting type after applying the `+` operator.
[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") · #### fn add(self, other: &i128) -> <i128 as Add<i128>>::Output
Performs the `+` operation. [Read more](ops/trait.add#tymethod.add)
[source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#133)1.0.0 (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
The resulting type after applying the `+` operator.
[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") · #### fn add(self, other: &i128) -> <i128 as Add<i128>>::Output
Performs the `+` operation. [Read more](ops/trait.add#tymethod.add)
[source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#133)1.0.0 (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
The resulting type after applying the `+` operator.
[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") · #### fn add(self, other: i128) -> <i128 as Add<i128>>::Output
Performs the `+` operation. [Read more](ops/trait.add#tymethod.add)
[source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#133)1.0.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Add<i128> for i128
#### type Output = i128
The resulting type after applying the `+` operator.
[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") · #### fn add(self, other: i128) -> i128
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<&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/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/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/ops/arith.rs.html#786)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/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/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/ops/arith.rs.html#786)1.8.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/ops/arith.rs.html#786)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/fmt/num.rs.html#179)1.0.0 · ### impl Binary for i128
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#179)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error>
Formats the value using the given formatter.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#181)1.0.0 (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
The resulting type after applying the `&` operator.
[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") · #### fn bitand(self, other: &i128) -> <i128 as BitAnd<i128>>::Output
Performs the `&` operation. [Read more](ops/trait.bitand#tymethod.bitand)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#181)1.0.0 (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
The resulting type after applying the `&` operator.
[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") · #### fn bitand(self, other: &i128) -> <i128 as BitAnd<i128>>::Output
Performs the `&` operation. [Read more](ops/trait.bitand#tymethod.bitand)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#181)1.0.0 (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
The resulting type after applying the `&` operator.
[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") · #### fn bitand(self, other: i128) -> <i128 as BitAnd<i128>>::Output
Performs the `&` operation. [Read more](ops/trait.bitand#tymethod.bitand)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#181)1.0.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitAnd<i128> for i128
#### type Output = i128
The resulting type after applying the `&` operator.
[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") · #### fn bitand(self, rhs: i128) -> i128
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<&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/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/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/ops/bit.rs.html#734)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/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/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/ops/bit.rs.html#734)1.8.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/ops/bit.rs.html#734)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/ops/bit.rs.html#282)1.0.0 (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
The resulting type after applying the `|` operator.
[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") · #### fn bitor(self, other: &i128) -> <i128 as BitOr<i128>>::Output
Performs the `|` operation. [Read more](ops/trait.bitor#tymethod.bitor)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#282)1.0.0 (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
The resulting type after applying the `|` operator.
[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") · #### fn bitor(self, other: &i128) -> <i128 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 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/ops/bit.rs.html#282)1.0.0 (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
The resulting type after applying the `|` operator.
[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") · #### fn bitor(self, other: i128) -> <i128 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 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/ops/bit.rs.html#282)1.0.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOr<i128> for i128
#### type Output = i128
The resulting type after applying the `|` operator.
[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") · #### fn bitor(self, rhs: i128) -> i128
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<&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/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/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/ops/bit.rs.html#806)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/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/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/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/ops/bit.rs.html#806)1.8.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/ops/bit.rs.html#806)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/ops/bit.rs.html#383)1.0.0 (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
The resulting type after applying the `^` operator.
[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") · #### fn bitxor(self, other: &i128) -> <i128 as BitXor<i128>>::Output
Performs the `^` operation. [Read more](ops/trait.bitxor#tymethod.bitxor)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#383)1.0.0 (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
The resulting type after applying the `^` operator.
[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") · #### fn bitxor(self, other: &i128) -> <i128 as BitXor<i128>>::Output
Performs the `^` operation. [Read more](ops/trait.bitxor#tymethod.bitxor)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#383)1.0.0 (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
The resulting type after applying the `^` operator.
[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") · #### fn bitxor(self, other: i128) -> <i128 as BitXor<i128>>::Output
Performs the `^` operation. [Read more](ops/trait.bitxor#tymethod.bitxor)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#383)1.0.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitXor<i128> for i128
#### type Output = i128
The resulting type after applying the `^` operator.
[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") · #### fn bitxor(self, other: i128) -> i128
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<&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/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/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/ops/bit.rs.html#878)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/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/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/ops/bit.rs.html#878)1.8.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/ops/bit.rs.html#878)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/clone.rs.html#197-202)1.0.0 (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") · #### fn clone(&self) -> i128
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/fmt/num.rs.html#197-200)1.0.0 · ### impl Debug for i128
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#197-200)#### 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/default.rs.html#219)1.0.0 (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#219)const: [unstable](https://github.com/rust-lang/rust/issues/87864 "Tracking issue for const_default_impls") · #### fn default() -> i128
Returns the default value of `0`
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#576)1.0.0 · ### impl Display for i128
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#577)#### 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/ops/arith.rs.html#507-510)1.0.0 (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
The resulting type after applying the `/` operator.
[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") · #### fn div(self, other: &i128) -> <i128 as Div<i128>>::Output
Performs the `/` operation. [Read more](ops/trait.div#tymethod.div)
[source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#507-510)1.0.0 (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
The resulting type after applying the `/` operator.
[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") · #### fn div(self, other: &i128) -> <i128 as Div<i128>>::Output
Performs the `/` operation. [Read more](ops/trait.div#tymethod.div)
[source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#507-510)1.0.0 (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
The resulting type after applying the `/` operator.
[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") · #### fn div(self, other: i128) -> <i128 as Div<i128>>::Output
Performs the `/` operation. [Read more](ops/trait.div#tymethod.div)
[source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#507-510)1.0.0 (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
The resulting type after applying the `/` operator.
[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") · #### fn div(self, other: i128) -> i128
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<&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/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/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/ops/arith.rs.html#968)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/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/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/ops/arith.rs.html#968)1.8.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/ops/arith.rs.html#968)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/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#96)1.28.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<bool> for i128
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#96)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: bool) -> i128
Converts a `bool` to a `i128`. The resulting value is `0` for `false` and `1` for `true` values.
##### Examples
```
assert_eq!(i128::from(true), 1);
assert_eq!(i128::from(false), 0);
```
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#120)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · ### impl From<i16> for i128
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#120)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: i16) -> i128
Converts `i16` to `i128` losslessly.
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#122)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · ### impl From<i32> for i128
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#122)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: i32) -> i128
Converts `i32` to `i128` losslessly.
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#123)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · ### impl From<i64> for i128
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#123)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: i64) -> i128
Converts `i64` to `i128` losslessly.
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#116)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · ### impl From<i8> for i128
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#116)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: i8) -> i128
Converts `i8` to `i128` losslessly.
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#132)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · ### impl From<u16> for i128
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#132)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: u16) -> i128
Converts `u16` to `i128` losslessly.
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#134)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · ### impl From<u32> for i128
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#134)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: u32) -> i128
Converts `u32` to `i128` losslessly.
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#135)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · ### impl From<u64> for i128
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#135)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: u64) -> i128
Converts `u64` to `i128` losslessly.
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#129)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · ### impl From<u8> for i128
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#129)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: u8) -> i128
Converts `u8` to `i128` losslessly.
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#1018)1.0.0 · ### impl FromStr for i128
#### type Err = ParseIntError
The associated error which can be returned from parsing.
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#1018)#### fn from\_str(src: &str) -> Result<i128, ParseIntError>
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/hash/mod.rs.html#829-842)1.0.0 · ### impl Hash for i128
[source](https://doc.rust-lang.org/src/core/hash/mod.rs.html#829-842)#### 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#829-842)#### fn hash\_slice<H>(data: &[i128], 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/fmt/num.rs.html#479)1.42.0 · ### impl LowerExp for i128
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#479)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error>
Formats the value using the given formatter.
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#179)1.0.0 · ### impl LowerHex for i128
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#179)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error>
Formats the value using the given formatter.
[source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#369)1.0.0 (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
The resulting type after applying the `*` operator.
[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") · #### fn mul(self, other: &i128) -> <i128 as Mul<i128>>::Output
Performs the `*` operation. [Read more](ops/trait.mul#tymethod.mul)
[source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#369)1.0.0 (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
The resulting type after applying the `*` operator.
[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") · #### fn mul(self, other: &i128) -> <i128 as Mul<i128>>::Output
Performs the `*` operation. [Read more](ops/trait.mul#tymethod.mul)
[source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#369)1.0.0 (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
The resulting type after applying the `*` operator.
[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") · #### fn mul(self, other: i128) -> <i128 as Mul<i128>>::Output
Performs the `*` operation. [Read more](ops/trait.mul#tymethod.mul)
[source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#369)1.0.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Mul<i128> for i128
#### type Output = i128
The resulting type after applying the `*` operator.
[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") · #### fn mul(self, other: i128) -> i128
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<&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/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/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/ops/arith.rs.html#911)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/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/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/ops/arith.rs.html#911)1.8.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/ops/arith.rs.html#911)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/ops/arith.rs.html#719)1.0.0 (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
The resulting type after applying the `-` operator.
[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") · #### fn neg(self) -> <i128 as Neg>::Output
Performs the unary `-` operation. [Read more](ops/trait.neg#tymethod.neg)
[source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#719)1.0.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Neg for i128
#### type Output = i128
The resulting type after applying the `-` operator.
[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") · #### fn neg(self) -> i128
Performs the unary `-` operation. [Read more](ops/trait.neg#tymethod.neg)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#69)1.0.0 (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
The resulting type after applying the `!` operator.
[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") · #### fn not(self) -> <i128 as Not>::Output
Performs the unary `!` operation. [Read more](ops/trait.not#tymethod.not)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#69)1.0.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Not for i128
#### type Output = i128
The resulting type after applying the `!` operator.
[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") · #### fn not(self) -> i128
Performs the unary `!` operation. [Read more](ops/trait.not#tymethod.not)
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#179)1.0.0 · ### impl Octal for i128
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#179)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error>
Formats the value using the given formatter.
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1486)1.0.0 (const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp")) · ### impl Ord for i128
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1486)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · #### fn cmp(&self, other: &i128) -> 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/cmp.rs.html#1366-1368)1.0.0 (const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp")) · ### impl PartialEq<i128> for i128
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1366-1368)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · #### fn eq(&self, other: &i128) -> 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#1366-1368)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · #### fn ne(&self, other: &i128) -> 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/cmp.rs.html#1486)1.0.0 (const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp")) · ### impl PartialOrd<i128> for i128
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1486)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · #### fn partial\_cmp(&self, other: &i128) -> 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#1486)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · #### fn lt(&self, other: &i128) -> 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#1486)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · #### fn le(&self, other: &i128) -> 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#1486)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · #### fn ge(&self, other: &i128) -> 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/cmp.rs.html#1486)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · #### fn gt(&self, other: &i128) -> 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/iter/traits/accum.rs.html#141)1.12.0 · ### impl<'a> Product<&'a i128> for i128
[source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)#### fn product<I>(iter: I) -> i128where I: [Iterator](iter/trait.iterator "trait std::iter::Iterator")<Item = &'a [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.12.0 · ### impl Product<i128> for i128
[source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)#### fn product<I>(iter: I) -> i128where I: [Iterator](iter/trait.iterator "trait std::iter::Iterator")<Item = [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/ops/arith.rs.html#609-612)1.0.0 (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
The resulting type after applying the `%` operator.
[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") · #### fn rem(self, other: &i128) -> <i128 as Rem<i128>>::Output
Performs the `%` operation. [Read more](ops/trait.rem#tymethod.rem)
[source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#609-612)1.0.0 (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
The resulting type after applying the `%` operator.
[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") · #### fn rem(self, other: &i128) -> <i128 as Rem<i128>>::Output
Performs the `%` operation. [Read more](ops/trait.rem#tymethod.rem)
[source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#609-612)1.0.0 (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
The resulting type after applying the `%` operator.
[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") · #### fn rem(self, other: i128) -> <i128 as Rem<i128>>::Output
Performs the `%` operation. [Read more](ops/trait.rem#tymethod.rem)
[source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#609-612)1.0.0 (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
The resulting type after applying the `%` operator.
[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") · #### fn rem(self, other: i128) -> i128
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<&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/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/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/ops/arith.rs.html#1029)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/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/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/ops/arith.rs.html#1029)1.8.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/ops/arith.rs.html#1029)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/ops/bit.rs.html#502)1.0.0 (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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i128) -> <i128 as Shl<i128>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i128) -> <i16 as Shl<i128>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i128) -> <i32 as Shl<i128>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i128) -> <i64 as Shl<i128>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i128) -> <i8 as Shl<i128>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i128) -> <isize as Shl<i128>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i128) -> <u128 as Shl<i128>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i128) -> <u16 as Shl<i128>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i128) -> <u32 as Shl<i128>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i128) -> <u64 as Shl<i128>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i128) -> <u8 as Shl<i128>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i128) -> <usize as Shl<i128>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i128) -> <i128 as Shl<i128>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i128) -> <i16 as Shl<i128>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i128) -> <i32 as Shl<i128>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i128) -> <i64 as Shl<i128>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i128) -> <i8 as Shl<i128>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i128) -> <isize as Shl<i128>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i128) -> <u128 as Shl<i128>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i128) -> <u16 as Shl<i128>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i128) -> <u32 as Shl<i128>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i128) -> <u64 as Shl<i128>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i128) -> <u8 as Shl<i128>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i128) -> <usize as Shl<i128>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i16) -> <i128 as Shl<i16>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i16) -> <i128 as Shl<i16>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i32) -> <i128 as Shl<i32>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i32) -> <i128 as Shl<i32>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i64) -> <i128 as Shl<i64>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i64) -> <i128 as Shl<i64>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i8) -> <i128 as Shl<i8>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i8) -> <i128 as Shl<i8>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &isize) -> <i128 as Shl<isize>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &isize) -> <i128 as Shl<isize>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u128) -> <i128 as Shl<u128>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u128) -> <i128 as Shl<u128>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u16) -> <i128 as Shl<u16>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u16) -> <i128 as Shl<u16>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u32) -> <i128 as Shl<u32>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u32) -> <i128 as Shl<u32>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u64) -> <i128 as Shl<u64>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u64) -> <i128 as Shl<u64>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u8) -> <i128 as Shl<u8>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u8) -> <i128 as Shl<u8>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &usize) -> <i128 as Shl<usize>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &usize) -> <i128 as Shl<usize>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i128) -> <i128 as Shl<i128>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i128) -> <i16 as Shl<i128>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i128) -> <i32 as Shl<i128>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i128) -> <i64 as Shl<i128>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i128) -> <i8 as Shl<i128>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i128) -> <isize as Shl<i128>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i128) -> <u128 as Shl<i128>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i128) -> <u16 as Shl<i128>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i128) -> <u32 as Shl<i128>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i128) -> <u64 as Shl<i128>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i128) -> <u8 as Shl<i128>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i128) -> <usize as Shl<i128>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shl<i128> for i128
#### type Output = i128
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i128) -> i128
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shl<i128> for i16
#### type Output = i16
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i128) -> i16
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shl<i128> for i32
#### type Output = i32
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i128) -> i32
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shl<i128> for i64
#### type Output = i64
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i128) -> i64
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shl<i128> for i8
#### type Output = i8
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i128) -> i8
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shl<i128> for isize
#### type Output = isize
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i128) -> isize
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shl<i128> for u128
#### type Output = u128
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i128) -> u128
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shl<i128> for u16
#### type Output = u16
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i128) -> u16
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shl<i128> for u32
#### type Output = u32
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i128) -> u32
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shl<i128> for u64
#### type Output = u64
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i128) -> u64
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shl<i128> for u8
#### type Output = u8
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i128) -> u8
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shl<i128> for usize
#### type Output = usize
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i128) -> usize
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i16) -> <i128 as Shl<i16>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shl<i16> for i128
#### type Output = i128
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i16) -> i128
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i32) -> <i128 as Shl<i32>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shl<i32> for i128
#### type Output = i128
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i32) -> i128
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i64) -> <i128 as Shl<i64>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shl<i64> for i128
#### type Output = i128
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i64) -> i128
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i8) -> <i128 as Shl<i8>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shl<i8> for i128
#### type Output = i128
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i8) -> i128
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: isize) -> <i128 as Shl<isize>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shl<isize> for i128
#### type Output = i128
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: isize) -> i128
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u128) -> <i128 as Shl<u128>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shl<u128> for i128
#### type Output = i128
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u128) -> i128
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u16) -> <i128 as Shl<u16>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shl<u16> for i128
#### type Output = i128
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u16) -> i128
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u32) -> <i128 as Shl<u32>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shl<u32> for i128
#### type Output = i128
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u32) -> i128
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u64) -> <i128 as Shl<u64>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shl<u64> for i128
#### type Output = i128
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u64) -> i128
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u8) -> <i128 as Shl<u8>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shl<u8> for i128
#### type Output = i128
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u8) -> i128
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: usize) -> <i128 as Shl<usize>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shl<usize> for i128
#### type Output = i128
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: usize) -> i128
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &i128)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &i128)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &i128)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &i128)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &i128)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &i128)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &i128)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &i128)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &i128)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &i128)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &i128)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &i128)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &i16)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &i32)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &i64)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &i8)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &isize)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &u128)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &u16)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &u32)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &u64)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &u8)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)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/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: i128)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: i128)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: i128)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: i128)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: i128)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: i128)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: i128)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: i128)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: i128)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: i128)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: i128)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: i128)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: i16)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: i32)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: i64)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: i8)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: isize)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: u128)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: u16)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: u32)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: u64)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: u8)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)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/ops/bit.rs.html#621)1.0.0 (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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i128) -> <i128 as Shr<i128>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i128) -> <i16 as Shr<i128>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i128) -> <i32 as Shr<i128>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i128) -> <i64 as Shr<i128>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i128) -> <i8 as Shr<i128>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i128) -> <isize as Shr<i128>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i128) -> <u128 as Shr<i128>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i128) -> <u16 as Shr<i128>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i128) -> <u32 as Shr<i128>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i128) -> <u64 as Shr<i128>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i128) -> <u8 as Shr<i128>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i128) -> <usize as Shr<i128>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i128) -> <i128 as Shr<i128>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i128) -> <i16 as Shr<i128>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i128) -> <i32 as Shr<i128>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i128) -> <i64 as Shr<i128>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i128) -> <i8 as Shr<i128>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i128) -> <isize as Shr<i128>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i128) -> <u128 as Shr<i128>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i128) -> <u16 as Shr<i128>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i128) -> <u32 as Shr<i128>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i128) -> <u64 as Shr<i128>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i128) -> <u8 as Shr<i128>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i128) -> <usize as Shr<i128>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i16) -> <i128 as Shr<i16>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i16) -> <i128 as Shr<i16>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i32) -> <i128 as Shr<i32>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i32) -> <i128 as Shr<i32>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i64) -> <i128 as Shr<i64>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i64) -> <i128 as Shr<i64>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i8) -> <i128 as Shr<i8>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i8) -> <i128 as Shr<i8>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &isize) -> <i128 as Shr<isize>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &isize) -> <i128 as Shr<isize>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u128) -> <i128 as Shr<u128>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u128) -> <i128 as Shr<u128>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u16) -> <i128 as Shr<u16>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u16) -> <i128 as Shr<u16>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u32) -> <i128 as Shr<u32>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u32) -> <i128 as Shr<u32>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u64) -> <i128 as Shr<u64>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u64) -> <i128 as Shr<u64>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u8) -> <i128 as Shr<u8>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u8) -> <i128 as Shr<u8>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &usize) -> <i128 as Shr<usize>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &usize) -> <i128 as Shr<usize>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i128) -> <i128 as Shr<i128>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i128) -> <i16 as Shr<i128>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i128) -> <i32 as Shr<i128>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i128) -> <i64 as Shr<i128>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i128) -> <i8 as Shr<i128>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i128) -> <isize as Shr<i128>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i128) -> <u128 as Shr<i128>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i128) -> <u16 as Shr<i128>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i128) -> <u32 as Shr<i128>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i128) -> <u64 as Shr<i128>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i128) -> <u8 as Shr<i128>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i128) -> <usize as Shr<i128>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shr<i128> for i128
#### type Output = i128
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i128) -> i128
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shr<i128> for i16
#### type Output = i16
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i128) -> i16
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shr<i128> for i32
#### type Output = i32
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i128) -> i32
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shr<i128> for i64
#### type Output = i64
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i128) -> i64
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shr<i128> for i8
#### type Output = i8
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i128) -> i8
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shr<i128> for isize
#### type Output = isize
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i128) -> isize
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shr<i128> for u128
#### type Output = u128
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i128) -> u128
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shr<i128> for u16
#### type Output = u16
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i128) -> u16
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shr<i128> for u32
#### type Output = u32
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i128) -> u32
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shr<i128> for u64
#### type Output = u64
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i128) -> u64
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shr<i128> for u8
#### type Output = u8
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i128) -> u8
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shr<i128> for usize
#### type Output = usize
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i128) -> usize
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i16) -> <i128 as Shr<i16>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shr<i16> for i128
#### type Output = i128
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i16) -> i128
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i32) -> <i128 as Shr<i32>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shr<i32> for i128
#### type Output = i128
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i32) -> i128
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i64) -> <i128 as Shr<i64>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shr<i64> for i128
#### type Output = i128
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i64) -> i128
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i8) -> <i128 as Shr<i8>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shr<i8> for i128
#### type Output = i128
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i8) -> i128
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: isize) -> <i128 as Shr<isize>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shr<isize> for i128
#### type Output = i128
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: isize) -> i128
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u128) -> <i128 as Shr<u128>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shr<u128> for i128
#### type Output = i128
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u128) -> i128
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u16) -> <i128 as Shr<u16>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shr<u16> for i128
#### type Output = i128
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u16) -> i128
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u32) -> <i128 as Shr<u32>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shr<u32> for i128
#### type Output = i128
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u32) -> i128
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u64) -> <i128 as Shr<u64>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shr<u64> for i128
#### type Output = i128
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u64) -> i128
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u8) -> <i128 as Shr<u8>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shr<u8> for i128
#### type Output = i128
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u8) -> i128
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: usize) -> <i128 as Shr<usize>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shr<usize> for i128
#### type Output = i128
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: usize) -> i128
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &i128)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &i128)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &i128)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &i128)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &i128)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &i128)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &i128)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &i128)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &i128)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &i128)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &i128)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &i128)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &i16)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &i32)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &i64)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &i8)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &isize)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &u128)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &u16)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &u32)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &u64)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &u8)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)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/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: i128)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: i128)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: i128)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: i128)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: i128)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: i128)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: i128)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: i128)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: i128)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: i128)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: i128)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: i128)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: i16)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: i32)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: i64)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: i8)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: isize)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: u128)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: u16)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: u32)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: u64)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: u8)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)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/iter/range.rs.html#391-394)### impl Step for i128
[source](https://doc.rust-lang.org/src/core/iter/range.rs.html#391-394)#### unsafe fn forward\_unchecked(start: i128, n: usize) -> i128
🔬This is a nightly-only experimental API. (`step_trait` [#42168](https://github.com/rust-lang/rust/issues/42168))
Returns the value that would be obtained by taking the *successor* of `self` `count` times. [Read more](iter/trait.step#method.forward_unchecked)
[source](https://doc.rust-lang.org/src/core/iter/range.rs.html#391-394)#### unsafe fn backward\_unchecked(start: i128, n: usize) -> i128
🔬This is a nightly-only experimental API. (`step_trait` [#42168](https://github.com/rust-lang/rust/issues/42168))
Returns the value that would be obtained by taking the *predecessor* of `self` `count` times. [Read more](iter/trait.step#method.backward_unchecked)
[source](https://doc.rust-lang.org/src/core/iter/range.rs.html#391-394)#### fn forward(start: i128, n: usize) -> i128
🔬This is a nightly-only experimental API. (`step_trait` [#42168](https://github.com/rust-lang/rust/issues/42168))
Returns the value that would be obtained by taking the *successor* of `self` `count` times. [Read more](iter/trait.step#method.forward)
[source](https://doc.rust-lang.org/src/core/iter/range.rs.html#391-394)#### fn backward(start: i128, n: usize) -> i128
🔬This is a nightly-only experimental API. (`step_trait` [#42168](https://github.com/rust-lang/rust/issues/42168))
Returns the value that would be obtained by taking the *predecessor* of `self` `count` times. [Read more](iter/trait.step#method.backward)
[source](https://doc.rust-lang.org/src/core/iter/range.rs.html#391-394)#### fn steps\_between(start: &i128, end: &i128) -> Option<usize>
🔬This is a nightly-only experimental API. (`step_trait` [#42168](https://github.com/rust-lang/rust/issues/42168))
Returns the number of *successor* steps required to get from `start` to `end`. [Read more](iter/trait.step#tymethod.steps_between)
[source](https://doc.rust-lang.org/src/core/iter/range.rs.html#391-394)#### fn forward\_checked(start: i128, n: usize) -> Option<i128>
🔬This is a nightly-only experimental API. (`step_trait` [#42168](https://github.com/rust-lang/rust/issues/42168))
Returns the value that would be obtained by taking the *successor* of `self` `count` times. [Read more](iter/trait.step#tymethod.forward_checked)
[source](https://doc.rust-lang.org/src/core/iter/range.rs.html#391-394)#### fn backward\_checked(start: i128, n: usize) -> Option<i128>
🔬This is a nightly-only experimental API. (`step_trait` [#42168](https://github.com/rust-lang/rust/issues/42168))
Returns the value that would be obtained by taking the *predecessor* of `self` `count` times. [Read more](iter/trait.step#tymethod.backward_checked)
[source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#240)1.0.0 (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
The resulting type after applying the `-` operator.
[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") · #### fn sub(self, other: &i128) -> <i128 as Sub<i128>>::Output
Performs the `-` operation. [Read more](ops/trait.sub#tymethod.sub)
[source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#240)1.0.0 (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
The resulting type after applying the `-` operator.
[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") · #### fn sub(self, other: &i128) -> <i128 as Sub<i128>>::Output
Performs the `-` operation. [Read more](ops/trait.sub#tymethod.sub)
[source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#240)1.0.0 (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
The resulting type after applying the `-` operator.
[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") · #### fn sub(self, other: i128) -> <i128 as Sub<i128>>::Output
Performs the `-` operation. [Read more](ops/trait.sub#tymethod.sub)
[source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#240)1.0.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Sub<i128> for i128
#### type Output = i128
The resulting type after applying the `-` operator.
[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") · #### fn sub(self, other: i128) -> i128
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<&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/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/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/ops/arith.rs.html#853)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/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/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/ops/arith.rs.html#853)1.8.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/ops/arith.rs.html#853)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/iter/traits/accum.rs.html#141)1.12.0 · ### impl<'a> Sum<&'a i128> for i128
[source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)#### fn sum<I>(iter: I) -> i128where I: [Iterator](iter/trait.iterator "trait std::iter::Iterator")<Item = &'a [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.12.0 · ### impl Sum<i128> for i128
[source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)#### fn sum<I>(iter: I) -> i128where I: [Iterator](iter/trait.iterator "trait std::iter::Iterator")<Item = [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/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/convert/num.rs.html#276)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<i128> for i16
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#276)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: i128) -> Result<i16, <i16 as TryFrom<i128>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#276)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<i128> for i32
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#276)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: i128) -> Result<i32, <i32 as TryFrom<i128>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#276)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<i128> for i64
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#276)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: i128) -> Result<i64, <i64 as TryFrom<i128>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#276)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<i128> for i8
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#276)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: i128) -> Result<i8, <i8 as TryFrom<i128>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#372)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<i128> for isize
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#372)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: i128) -> Result<isize, <isize as TryFrom<i128>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#290)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<i128> for u128
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#290)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: i128) -> Result<u128, <u128 as TryFrom<i128>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#294)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<i128> for u16
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#294)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: i128) -> Result<u16, <u16 as TryFrom<i128>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#294)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<i128> for u32
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#294)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: i128) -> Result<u32, <u32 as TryFrom<i128>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#294)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<i128> for u64
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#294)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: i128) -> Result<u64, <u64 as TryFrom<i128>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#294)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<i128> for u8
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#294)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: i128) -> Result<u8, <u8 as TryFrom<i128>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#367)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<i128> for usize
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#367)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: i128) -> Result<usize, <usize as TryFrom<i128>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#362)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<isize> for i128
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#362)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(value: isize) -> Result<i128, <i128 as TryFrom<isize>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#283)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<u128> for i128
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#283)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: u128) -> Result<i128, <i128 as TryFrom<u128>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#357)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<usize> for i128
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#357)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(value: usize) -> Result<i128, <i128 as TryFrom<usize>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### type Error = TryFromIntError
The type returned in the event of a conversion error.
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#479)1.42.0 · ### impl UpperExp for i128
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#479)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error>
Formats the value using the given formatter.
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#179)1.0.0 · ### impl UpperHex for i128
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#179)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error>
Formats the value using the given formatter.
[source](https://doc.rust-lang.org/src/core/marker.rs.html#830-835)1.0.0 · ### impl Copy for i128
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1377)1.0.0 · ### impl Eq for i128
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#38)### impl FloatToInt<i128> for f32
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#39)### impl FloatToInt<i128> for f64
[source](https://doc.rust-lang.org/src/core/iter/range.rs.html#17)### impl TrustedStep for i128
Auto Trait Implementations
--------------------------
### impl RefUnwindSafe for i128
### impl Send for i128
### impl Sync for i128
### impl Unpin for i128
### impl UnwindSafe for i128
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 Primitive Type u32 Primitive Type u32
==================
The 32-bit unsigned integer type.
Implementations
---------------
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#857)### impl u32
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#858-859)1.43.0 · #### pub const MIN: u32 = 0u32
The smallest value that can be represented by this integer type.
##### Examples
Basic usage:
```
assert_eq!(u32::MIN, 0);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#858-859)1.43.0 · #### pub const MAX: u32 = 4\_294\_967\_295u32
The largest value that can be represented by this integer type (232 − 1)
##### Examples
Basic usage:
```
assert_eq!(u32::MAX, 4294967295);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#858-859)1.53.0 · #### pub const BITS: u32 = 32u32
The size of this integer type in bits.
##### Examples
```
assert_eq!(u32::BITS, 32);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#858-859)#### pub fn from\_str\_radix(src: &str, radix: u32) -> Result<u32, ParseIntError>
Converts a string slice in a given base to an integer.
The string is expected to be an optional `+` sign followed by digits. Leading and trailing whitespace represent an error. Digits are a subset of these characters, depending on `radix`:
* `0-9`
* `a-z`
* `A-Z`
##### Panics
This function panics if `radix` is not in the range from 2 to 36.
##### Examples
Basic usage:
```
assert_eq!(u32::from_str_radix("A", 16), Ok(10));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#858-859)const: 1.32.0 · #### pub const fn count\_ones(self) -> u32
Returns the number of ones in the binary representation of `self`.
##### Examples
Basic usage:
```
let n = 0b01001100u32;
assert_eq!(n.count_ones(), 3);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#858-859)const: 1.32.0 · #### pub const fn count\_zeros(self) -> u32
Returns the number of zeros in the binary representation of `self`.
##### Examples
Basic usage:
```
assert_eq!(u32::MAX.count_zeros(), 0);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#858-859)const: 1.32.0 · #### pub const fn leading\_zeros(self) -> u32
Returns the number of leading zeros in the binary representation of `self`.
##### Examples
Basic usage:
```
let n = u32::MAX >> 2;
assert_eq!(n.leading_zeros(), 2);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#858-859)const: 1.32.0 · #### pub const fn trailing\_zeros(self) -> u32
Returns the number of trailing zeros in the binary representation of `self`.
##### Examples
Basic usage:
```
let n = 0b0101000u32;
assert_eq!(n.trailing_zeros(), 3);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#858-859)1.46.0 (const: 1.46.0) · #### pub const fn leading\_ones(self) -> u32
Returns the number of leading ones in the binary representation of `self`.
##### Examples
Basic usage:
```
let n = !(u32::MAX >> 2);
assert_eq!(n.leading_ones(), 2);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#858-859)1.46.0 (const: 1.46.0) · #### pub const fn trailing\_ones(self) -> u32
Returns the number of trailing ones in the binary representation of `self`.
##### Examples
Basic usage:
```
let n = 0b1010111u32;
assert_eq!(n.trailing_ones(), 3);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#858-859)const: 1.32.0 · #### pub const fn rotate\_left(self, n: u32) -> u32
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:
```
let n = 0x10000b3u32;
let m = 0xb301;
assert_eq!(n.rotate_left(8), m);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#858-859)const: 1.32.0 · #### pub const fn rotate\_right(self, n: u32) -> u32
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:
```
let n = 0xb301u32;
let m = 0x10000b3;
assert_eq!(n.rotate_right(8), m);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#858-859)const: 1.32.0 · #### pub const fn swap\_bytes(self) -> u32
Reverses the byte order of the integer.
##### Examples
Basic usage:
```
let n = 0x12345678u32;
let m = n.swap_bytes();
assert_eq!(m, 0x78563412);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#858-859)1.37.0 (const: 1.37.0) · #### pub const fn reverse\_bits(self) -> u32
Reverses the order of bits in the integer. The least significant bit becomes the most significant bit, second least-significant bit becomes second most-significant bit, etc.
##### Examples
Basic usage:
```
let n = 0x12345678u32;
let m = n.reverse_bits();
assert_eq!(m, 0x1e6a2c48);
assert_eq!(0, 0u32.reverse_bits());
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#858-859)const: 1.32.0 · #### pub const fn from\_be(x: u32) -> u32
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:
```
let n = 0x1Au32;
if cfg!(target_endian = "big") {
assert_eq!(u32::from_be(n), n)
} else {
assert_eq!(u32::from_be(n), n.swap_bytes())
}
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#858-859)const: 1.32.0 · #### pub const fn from\_le(x: u32) -> u32
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:
```
let n = 0x1Au32;
if cfg!(target_endian = "little") {
assert_eq!(u32::from_le(n), n)
} else {
assert_eq!(u32::from_le(n), n.swap_bytes())
}
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#858-859)const: 1.32.0 · #### pub const fn to\_be(self) -> u32
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:
```
let n = 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/mod.rs.html#858-859)const: 1.32.0 · #### pub const fn to\_le(self) -> u32
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:
```
let n = 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/mod.rs.html#858-859)const: 1.47.0 · #### pub const fn checked\_add(self, rhs: u32) -> Option<u32>
Checked integer addition. Computes `self + rhs`, returning `None` if overflow occurred.
##### Examples
Basic usage:
```
assert_eq!((u32::MAX - 2).checked_add(1), Some(u32::MAX - 1));
assert_eq!((u32::MAX - 2).checked_add(3), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#858-859)const: [unstable](https://github.com/rust-lang/rust/issues/85122 "Tracking issue for const_inherent_unchecked_arith") · #### pub unsafe fn unchecked\_add(self, rhs: u32) -> u32
🔬This is a nightly-only experimental API. (`unchecked_math` [#85122](https://github.com/rust-lang/rust/issues/85122))
Unchecked integer addition. Computes `self + rhs`, assuming overflow cannot occur.
##### Safety
This results in undefined behavior when `self + rhs > u32::MAX` or `self + rhs < u32::MIN`, i.e. when [`checked_add`](primitive.u32#method.checked_add) would return `None`.
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#858-859)const: [unstable](https://github.com/rust-lang/rust/issues/87840 "Tracking issue for mixed_integer_ops") · #### pub fn checked\_add\_signed(self, rhs: i32) -> Option<u32>
🔬This is a nightly-only experimental API. (`mixed_integer_ops` [#87840](https://github.com/rust-lang/rust/issues/87840))
Checked addition with a signed integer. Computes `self + rhs`, returning `None` if overflow occurred.
##### Examples
Basic usage:
```
assert_eq!(1u32.checked_add_signed(2), Some(3));
assert_eq!(1u32.checked_add_signed(-2), None);
assert_eq!((u32::MAX - 2).checked_add_signed(3), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#858-859)const: 1.47.0 · #### pub const fn checked\_sub(self, rhs: u32) -> Option<u32>
Checked integer subtraction. Computes `self - rhs`, returning `None` if overflow occurred.
##### Examples
Basic usage:
```
assert_eq!(1u32.checked_sub(1), Some(0));
assert_eq!(0u32.checked_sub(1), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#858-859)const: [unstable](https://github.com/rust-lang/rust/issues/85122 "Tracking issue for const_inherent_unchecked_arith") · #### pub unsafe fn unchecked\_sub(self, rhs: u32) -> u32
🔬This is a nightly-only experimental API. (`unchecked_math` [#85122](https://github.com/rust-lang/rust/issues/85122))
Unchecked integer subtraction. Computes `self - rhs`, assuming overflow cannot occur.
##### Safety
This results in undefined behavior when `self - rhs > u32::MAX` or `self - rhs < u32::MIN`, i.e. when [`checked_sub`](primitive.u32#method.checked_sub) would return `None`.
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#858-859)const: 1.47.0 · #### pub const fn checked\_mul(self, rhs: u32) -> Option<u32>
Checked integer multiplication. Computes `self * rhs`, returning `None` if overflow occurred.
##### Examples
Basic usage:
```
assert_eq!(5u32.checked_mul(1), Some(5));
assert_eq!(u32::MAX.checked_mul(2), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#858-859)const: [unstable](https://github.com/rust-lang/rust/issues/85122 "Tracking issue for const_inherent_unchecked_arith") · #### pub unsafe fn unchecked\_mul(self, rhs: u32) -> u32
🔬This is a nightly-only experimental API. (`unchecked_math` [#85122](https://github.com/rust-lang/rust/issues/85122))
Unchecked integer multiplication. Computes `self * rhs`, assuming overflow cannot occur.
##### Safety
This results in undefined behavior when `self * rhs > u32::MAX` or `self * rhs < u32::MIN`, i.e. when [`checked_mul`](primitive.u32#method.checked_mul) would return `None`.
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#858-859)const: 1.52.0 · #### pub const fn checked\_div(self, rhs: u32) -> Option<u32>
Checked integer division. Computes `self / rhs`, returning `None` if `rhs == 0`.
##### Examples
Basic usage:
```
assert_eq!(128u32.checked_div(2), Some(64));
assert_eq!(1u32.checked_div(0), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#858-859)1.38.0 (const: 1.52.0) · #### pub const fn checked\_div\_euclid(self, rhs: u32) -> Option<u32>
Checked Euclidean division. Computes `self.div_euclid(rhs)`, returning `None` if `rhs == 0`.
##### Examples
Basic usage:
```
assert_eq!(128u32.checked_div_euclid(2), Some(64));
assert_eq!(1u32.checked_div_euclid(0), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#858-859)1.7.0 (const: 1.52.0) · #### pub const fn checked\_rem(self, rhs: u32) -> Option<u32>
Checked integer remainder. Computes `self % rhs`, returning `None` if `rhs == 0`.
##### Examples
Basic usage:
```
assert_eq!(5u32.checked_rem(2), Some(1));
assert_eq!(5u32.checked_rem(0), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#858-859)1.38.0 (const: 1.52.0) · #### pub const fn checked\_rem\_euclid(self, rhs: u32) -> Option<u32>
Checked Euclidean modulo. Computes `self.rem_euclid(rhs)`, returning `None` if `rhs == 0`.
##### Examples
Basic usage:
```
assert_eq!(5u32.checked_rem_euclid(2), Some(1));
assert_eq!(5u32.checked_rem_euclid(0), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#858-859)#### pub const fn ilog(self, base: u32) -> u32
🔬This is a nightly-only experimental API. (`int_log` [#70887](https://github.com/rust-lang/rust/issues/70887))
Returns the logarithm of the number with respect to an arbitrary base, rounded down.
This method might not be optimized owing to implementation details; `ilog2` can produce results more efficiently for base 2, and `ilog10` can produce results more efficiently for base 10.
##### Panics
When the number is zero, or if the base is not at least 2; it panics in debug mode and the return value is 0 in release mode.
##### Examples
```
#![feature(int_log)]
assert_eq!(5u32.ilog(5), 1);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#858-859)#### 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.
##### Panics
When the number is zero it panics in debug mode and the return value is 0 in release mode.
##### Examples
```
#![feature(int_log)]
assert_eq!(2u32.ilog2(), 1);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#858-859)#### 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.
##### Panics
When the number is zero it panics in debug mode and the return value is 0 in release mode.
##### Example
```
#![feature(int_log)]
assert_eq!(10u32.ilog10(), 1);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#858-859)#### pub const fn checked\_ilog(self, base: u32) -> Option<u32>
🔬This is a nightly-only experimental API. (`int_log` [#70887](https://github.com/rust-lang/rust/issues/70887))
Returns the logarithm of the number with respect to an arbitrary base, rounded down.
Returns `None` if the number is zero, or if the base is not at least 2.
This method might not be optimized owing to implementation details; `checked_ilog2` can produce results more efficiently for base 2, and `checked_ilog10` can produce results more efficiently for base 10.
##### Examples
```
#![feature(int_log)]
assert_eq!(5u32.checked_ilog(5), Some(1));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#858-859)#### pub const fn checked\_ilog2(self) -> Option<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.
Returns `None` if the number is zero.
##### Examples
```
#![feature(int_log)]
assert_eq!(2u32.checked_ilog2(), Some(1));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#858-859)#### pub const fn checked\_ilog10(self) -> Option<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.
Returns `None` if the number is zero.
##### Examples
```
#![feature(int_log)]
assert_eq!(10u32.checked_ilog10(), Some(1));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#858-859)1.7.0 (const: 1.47.0) · #### pub const fn checked\_neg(self) -> Option<u32>
Checked negation. Computes `-self`, returning `None` unless `self == 0`.
Note that negating any positive integer will overflow.
##### Examples
Basic usage:
```
assert_eq!(0u32.checked_neg(), Some(0));
assert_eq!(1u32.checked_neg(), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#858-859)1.7.0 (const: 1.47.0) · #### pub const fn checked\_shl(self, rhs: u32) -> Option<u32>
Checked shift left. Computes `self << rhs`, returning `None` if `rhs` is larger than or equal to the number of bits in `self`.
##### Examples
Basic usage:
```
assert_eq!(0x1u32.checked_shl(4), Some(0x10));
assert_eq!(0x10u32.checked_shl(129), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#858-859)const: [unstable](https://github.com/rust-lang/rust/issues/85122 "Tracking issue for const_inherent_unchecked_arith") · #### pub unsafe fn unchecked\_shl(self, rhs: u32) -> u32
🔬This is a nightly-only experimental API. (`unchecked_math` [#85122](https://github.com/rust-lang/rust/issues/85122))
Unchecked shift left. Computes `self << rhs`, assuming that `rhs` is less than the number of bits in `self`.
##### Safety
This results in undefined behavior if `rhs` is larger than or equal to the number of bits in `self`, i.e. when [`checked_shl`](primitive.u32#method.checked_shl) would return `None`.
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#858-859)1.7.0 (const: 1.47.0) · #### pub const fn checked\_shr(self, rhs: u32) -> Option<u32>
Checked shift right. Computes `self >> rhs`, returning `None` if `rhs` is larger than or equal to the number of bits in `self`.
##### Examples
Basic usage:
```
assert_eq!(0x10u32.checked_shr(4), Some(0x1));
assert_eq!(0x10u32.checked_shr(129), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#858-859)const: [unstable](https://github.com/rust-lang/rust/issues/85122 "Tracking issue for const_inherent_unchecked_arith") · #### pub unsafe fn unchecked\_shr(self, rhs: u32) -> u32
🔬This is a nightly-only experimental API. (`unchecked_math` [#85122](https://github.com/rust-lang/rust/issues/85122))
Unchecked shift right. Computes `self >> rhs`, assuming that `rhs` is less than the number of bits in `self`.
##### Safety
This results in undefined behavior if `rhs` is larger than or equal to the number of bits in `self`, i.e. when [`checked_shr`](primitive.u32#method.checked_shr) would return `None`.
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#858-859)1.34.0 (const: 1.50.0) · #### pub const fn checked\_pow(self, exp: u32) -> Option<u32>
Checked exponentiation. Computes `self.pow(exp)`, returning `None` if overflow occurred.
##### Examples
Basic usage:
```
assert_eq!(2u32.checked_pow(5), Some(32));
assert_eq!(u32::MAX.checked_pow(2), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#858-859)const: 1.47.0 · #### pub const fn saturating\_add(self, rhs: u32) -> u32
Saturating integer addition. Computes `self + rhs`, saturating at the numeric bounds instead of overflowing.
##### Examples
Basic usage:
```
assert_eq!(100u32.saturating_add(1), 101);
assert_eq!(u32::MAX.saturating_add(127), u32::MAX);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#858-859)const: [unstable](https://github.com/rust-lang/rust/issues/87840 "Tracking issue for mixed_integer_ops") · #### pub fn saturating\_add\_signed(self, rhs: i32) -> u32
🔬This is a nightly-only experimental API. (`mixed_integer_ops` [#87840](https://github.com/rust-lang/rust/issues/87840))
Saturating addition with a signed integer. Computes `self + rhs`, saturating at the numeric bounds instead of overflowing.
##### Examples
Basic usage:
```
assert_eq!(1u32.saturating_add_signed(2), 3);
assert_eq!(1u32.saturating_add_signed(-2), 0);
assert_eq!((u32::MAX - 2).saturating_add_signed(4), u32::MAX);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#858-859)const: 1.47.0 · #### pub const fn saturating\_sub(self, rhs: u32) -> u32
Saturating integer subtraction. Computes `self - rhs`, saturating at the numeric bounds instead of overflowing.
##### Examples
Basic usage:
```
assert_eq!(100u32.saturating_sub(27), 73);
assert_eq!(13u32.saturating_sub(127), 0);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#858-859)1.7.0 (const: 1.47.0) · #### pub const fn saturating\_mul(self, rhs: u32) -> u32
Saturating integer multiplication. Computes `self * rhs`, saturating at the numeric bounds instead of overflowing.
##### Examples
Basic usage:
```
assert_eq!(2u32.saturating_mul(10), 20);
assert_eq!((u32::MAX).saturating_mul(10), u32::MAX);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#858-859)1.58.0 (const: 1.58.0) · #### pub const fn saturating\_div(self, rhs: u32) -> u32
Saturating integer division. Computes `self / rhs`, saturating at the numeric bounds instead of overflowing.
##### Examples
Basic usage:
```
assert_eq!(5u32.saturating_div(2), 2);
```
ⓘ
```
let _ = 1u32.saturating_div(0);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#858-859)1.34.0 (const: 1.50.0) · #### pub const fn saturating\_pow(self, exp: u32) -> u32
Saturating integer exponentiation. Computes `self.pow(exp)`, saturating at the numeric bounds instead of overflowing.
##### Examples
Basic usage:
```
assert_eq!(4u32.saturating_pow(3), 64);
assert_eq!(u32::MAX.saturating_pow(2), u32::MAX);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#858-859)const: 1.32.0 · #### pub const fn wrapping\_add(self, rhs: u32) -> u32
Wrapping (modular) addition. Computes `self + rhs`, wrapping around at the boundary of the type.
##### Examples
Basic usage:
```
assert_eq!(200u32.wrapping_add(55), 255);
assert_eq!(200u32.wrapping_add(u32::MAX), 199);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#858-859)const: [unstable](https://github.com/rust-lang/rust/issues/87840 "Tracking issue for mixed_integer_ops") · #### pub fn wrapping\_add\_signed(self, rhs: i32) -> u32
🔬This is a nightly-only experimental API. (`mixed_integer_ops` [#87840](https://github.com/rust-lang/rust/issues/87840))
Wrapping (modular) addition with a signed integer. Computes `self + rhs`, wrapping around at the boundary of the type.
##### Examples
Basic usage:
```
assert_eq!(1u32.wrapping_add_signed(2), 3);
assert_eq!(1u32.wrapping_add_signed(-2), u32::MAX);
assert_eq!((u32::MAX - 2).wrapping_add_signed(4), 1);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#858-859)const: 1.32.0 · #### pub const fn wrapping\_sub(self, rhs: u32) -> u32
Wrapping (modular) subtraction. Computes `self - rhs`, wrapping around at the boundary of the type.
##### Examples
Basic usage:
```
assert_eq!(100u32.wrapping_sub(100), 0);
assert_eq!(100u32.wrapping_sub(u32::MAX), 101);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#858-859)const: 1.32.0 · #### pub const fn wrapping\_mul(self, rhs: u32) -> u32
Wrapping (modular) multiplication. Computes `self * rhs`, wrapping around at the boundary of the type.
##### Examples
Basic usage:
Please note that this example is shared between integer types. Which explains why `u8` is used here.
```
assert_eq!(10u8.wrapping_mul(12), 120);
assert_eq!(25u8.wrapping_mul(12), 44);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#858-859)1.2.0 (const: 1.52.0) · #### pub const fn wrapping\_div(self, rhs: u32) -> u32
Wrapping (modular) division. Computes `self / rhs`. Wrapped division on unsigned types is just normal division. There’s no way wrapping could ever happen. This function exists, so that all operations are accounted for in the wrapping operations.
##### Examples
Basic usage:
```
assert_eq!(100u32.wrapping_div(10), 10);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#858-859)1.38.0 (const: 1.52.0) · #### pub const fn wrapping\_div\_euclid(self, rhs: u32) -> u32
Wrapping Euclidean division. Computes `self.div_euclid(rhs)`. Wrapped division on unsigned types is just normal division. There’s no way wrapping could ever happen. This function exists, so that all operations are accounted for in the wrapping operations. Since, for the positive integers, all common definitions of division are equal, this is exactly equal to `self.wrapping_div(rhs)`.
##### Examples
Basic usage:
```
assert_eq!(100u32.wrapping_div_euclid(10), 10);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#858-859)1.2.0 (const: 1.52.0) · #### pub const fn wrapping\_rem(self, rhs: u32) -> u32
Wrapping (modular) remainder. Computes `self % rhs`. Wrapped remainder calculation on unsigned types is just the regular remainder calculation. There’s no way wrapping could ever happen. This function exists, so that all operations are accounted for in the wrapping operations.
##### Examples
Basic usage:
```
assert_eq!(100u32.wrapping_rem(10), 0);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#858-859)1.38.0 (const: 1.52.0) · #### pub const fn wrapping\_rem\_euclid(self, rhs: u32) -> u32
Wrapping Euclidean modulo. Computes `self.rem_euclid(rhs)`. Wrapped modulo calculation on unsigned types is just the regular remainder calculation. There’s no way wrapping could ever happen. This function exists, so that all operations are accounted for in the wrapping operations. Since, for the positive integers, all common definitions of division are equal, this is exactly equal to `self.wrapping_rem(rhs)`.
##### Examples
Basic usage:
```
assert_eq!(100u32.wrapping_rem_euclid(10), 0);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#858-859)1.2.0 (const: 1.32.0) · #### pub const fn wrapping\_neg(self) -> u32
Wrapping (modular) negation. Computes `-self`, wrapping around at the boundary of the type.
Since unsigned types do not have negative equivalents all applications of this function will wrap (except for `-0`). For values smaller than the corresponding signed type’s maximum the result is the same as casting the corresponding signed value. Any larger values are equivalent to `MAX + 1 - (val - MAX - 1)` where `MAX` is the corresponding signed type’s maximum.
##### Examples
Basic usage:
Please note that this example is shared between integer types. Which explains why `i8` is used here.
```
assert_eq!(100i8.wrapping_neg(), -100);
assert_eq!((-128i8).wrapping_neg(), -128);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#858-859)1.2.0 (const: 1.32.0) · #### pub const fn wrapping\_shl(self, rhs: u32) -> u32
Panic-free bitwise shift-left; yields `self << mask(rhs)`, where `mask` removes any high-order bits of `rhs` that would cause the shift to exceed the bitwidth of the type.
Note that this is *not* the same as a rotate-left; the RHS of a wrapping shift-left is restricted to the range of the type, rather than the bits shifted out of the LHS being returned to the other end. The primitive integer types all implement a [`rotate_left`](primitive.u32#method.rotate_left) function, which may be what you want instead.
##### Examples
Basic usage:
```
assert_eq!(1u32.wrapping_shl(7), 128);
assert_eq!(1u32.wrapping_shl(128), 1);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#858-859)1.2.0 (const: 1.32.0) · #### pub const fn wrapping\_shr(self, rhs: u32) -> u32
Panic-free bitwise shift-right; yields `self >> mask(rhs)`, where `mask` removes any high-order bits of `rhs` that would cause the shift to exceed the bitwidth of the type.
Note that this is *not* the same as a rotate-right; the RHS of a wrapping shift-right is restricted to the range of the type, rather than the bits shifted out of the LHS being returned to the other end. The primitive integer types all implement a [`rotate_right`](primitive.u32#method.rotate_right) function, which may be what you want instead.
##### Examples
Basic usage:
```
assert_eq!(128u32.wrapping_shr(7), 1);
assert_eq!(128u32.wrapping_shr(128), 128);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#858-859)1.34.0 (const: 1.50.0) · #### pub const fn wrapping\_pow(self, exp: u32) -> u32
Wrapping (modular) exponentiation. Computes `self.pow(exp)`, wrapping around at the boundary of the type.
##### Examples
Basic usage:
```
assert_eq!(3u32.wrapping_pow(5), 243);
assert_eq!(3u8.wrapping_pow(6), 217);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#858-859)1.7.0 (const: 1.32.0) · #### pub const fn overflowing\_add(self, rhs: u32) -> (u32, bool)
Calculates `self` + `rhs`
Returns a tuple of the addition along with a boolean indicating whether an arithmetic overflow would occur. If an overflow would have occurred then the wrapped value is returned.
##### Examples
Basic usage
```
assert_eq!(5u32.overflowing_add(2), (7, false));
assert_eq!(u32::MAX.overflowing_add(1), (0, true));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#858-859)const: [unstable](https://github.com/rust-lang/rust/issues/85532 "Tracking issue for const_bigint_helper_methods") · #### pub fn carrying\_add(self, rhs: u32, carry: bool) -> (u32, bool)
🔬This is a nightly-only experimental API. (`bigint_helper_methods` [#85532](https://github.com/rust-lang/rust/issues/85532))
Calculates `self + rhs + carry` without the ability to overflow.
Performs “ternary addition” which takes in an extra bit to add, and may return an additional bit of overflow. This allows for chaining together multiple additions to create “big integers” which represent larger values.
This can be thought of as a 32-bit “full adder”, in the electronics sense.
##### Examples
Basic usage
```
#![feature(bigint_helper_methods)]
assert_eq!(5u32.carrying_add(2, false), (7, false));
assert_eq!(5u32.carrying_add(2, true), (8, false));
assert_eq!(u32::MAX.carrying_add(1, false), (0, true));
assert_eq!(u32::MAX.carrying_add(0, true), (0, true));
assert_eq!(u32::MAX.carrying_add(1, true), (1, true));
assert_eq!(u32::MAX.carrying_add(u32::MAX, true), (u32::MAX, true));
```
If `carry` is false, this method is equivalent to [`overflowing_add`](primitive.u32#method.overflowing_add):
```
#![feature(bigint_helper_methods)]
assert_eq!(5_u32.carrying_add(2, false), 5_u32.overflowing_add(2));
assert_eq!(u32::MAX.carrying_add(1, false), u32::MAX.overflowing_add(1));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#858-859)const: [unstable](https://github.com/rust-lang/rust/issues/87840 "Tracking issue for mixed_integer_ops") · #### pub fn overflowing\_add\_signed(self, rhs: i32) -> (u32, bool)
🔬This is a nightly-only experimental API. (`mixed_integer_ops` [#87840](https://github.com/rust-lang/rust/issues/87840))
Calculates `self` + `rhs` with a signed `rhs`
Returns a tuple of the addition along with a boolean indicating whether an arithmetic overflow would occur. If an overflow would have occurred then the wrapped value is returned.
##### Examples
Basic usage:
```
assert_eq!(1u32.overflowing_add_signed(2), (3, false));
assert_eq!(1u32.overflowing_add_signed(-2), (u32::MAX, true));
assert_eq!((u32::MAX - 2).overflowing_add_signed(4), (1, true));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#858-859)1.7.0 (const: 1.32.0) · #### pub const fn overflowing\_sub(self, rhs: u32) -> (u32, bool)
Calculates `self` - `rhs`
Returns a tuple of the subtraction along with a boolean indicating whether an arithmetic overflow would occur. If an overflow would have occurred then the wrapped value is returned.
##### Examples
Basic usage
```
assert_eq!(5u32.overflowing_sub(2), (3, false));
assert_eq!(0u32.overflowing_sub(1), (u32::MAX, true));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#858-859)const: [unstable](https://github.com/rust-lang/rust/issues/85532 "Tracking issue for const_bigint_helper_methods") · #### pub fn borrowing\_sub(self, rhs: u32, borrow: bool) -> (u32, bool)
🔬This is a nightly-only experimental API. (`bigint_helper_methods` [#85532](https://github.com/rust-lang/rust/issues/85532))
Calculates `self - rhs - borrow` without the ability to overflow.
Performs “ternary subtraction” which takes in an extra bit to subtract, and may return an additional bit of overflow. This allows for chaining together multiple subtractions to create “big integers” which represent larger values.
##### Examples
Basic usage
```
#![feature(bigint_helper_methods)]
assert_eq!(5u32.borrowing_sub(2, false), (3, false));
assert_eq!(5u32.borrowing_sub(2, true), (2, false));
assert_eq!(0u32.borrowing_sub(1, false), (u32::MAX, true));
assert_eq!(0u32.borrowing_sub(1, true), (u32::MAX - 1, true));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#858-859)1.60.0 (const: 1.60.0) · #### pub const fn abs\_diff(self, other: u32) -> u32
Computes the absolute difference between `self` and `other`.
##### Examples
Basic usage:
```
assert_eq!(100u32.abs_diff(80), 20u32);
assert_eq!(100u32.abs_diff(110), 10u32);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#858-859)1.7.0 (const: 1.32.0) · #### pub const fn overflowing\_mul(self, rhs: u32) -> (u32, bool)
Calculates the multiplication of `self` and `rhs`.
Returns a tuple of the multiplication along with a boolean indicating whether an arithmetic overflow would occur. If an overflow would have occurred then the wrapped value is returned.
##### Examples
Basic usage:
Please note that this example is shared between integer types. Which explains why `u32` is used here.
```
assert_eq!(5u32.overflowing_mul(2), (10, false));
assert_eq!(1_000_000_000u32.overflowing_mul(10), (1410065408, true));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#858-859)1.7.0 (const: 1.52.0) · #### pub const fn overflowing\_div(self, rhs: u32) -> (u32, bool)
Calculates the divisor when `self` is divided by `rhs`.
Returns a tuple of the divisor along with a boolean indicating whether an arithmetic overflow would occur. Note that for unsigned integers overflow never occurs, so the second value is always `false`.
##### Panics
This function will panic if `rhs` is 0.
##### Examples
Basic usage
```
assert_eq!(5u32.overflowing_div(2), (2, false));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#858-859)1.38.0 (const: 1.52.0) · #### pub const fn overflowing\_div\_euclid(self, rhs: u32) -> (u32, bool)
Calculates the quotient of Euclidean division `self.div_euclid(rhs)`.
Returns a tuple of the divisor along with a boolean indicating whether an arithmetic overflow would occur. Note that for unsigned integers overflow never occurs, so the second value is always `false`. Since, for the positive integers, all common definitions of division are equal, this is exactly equal to `self.overflowing_div(rhs)`.
##### Panics
This function will panic if `rhs` is 0.
##### Examples
Basic usage
```
assert_eq!(5u32.overflowing_div_euclid(2), (2, false));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#858-859)1.7.0 (const: 1.52.0) · #### pub const fn overflowing\_rem(self, rhs: u32) -> (u32, bool)
Calculates the remainder when `self` is divided by `rhs`.
Returns a tuple of the remainder after dividing along with a boolean indicating whether an arithmetic overflow would occur. Note that for unsigned integers overflow never occurs, so the second value is always `false`.
##### Panics
This function will panic if `rhs` is 0.
##### Examples
Basic usage
```
assert_eq!(5u32.overflowing_rem(2), (1, false));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#858-859)1.38.0 (const: 1.52.0) · #### pub const fn overflowing\_rem\_euclid(self, rhs: u32) -> (u32, bool)
Calculates the remainder `self.rem_euclid(rhs)` as if by Euclidean division.
Returns a tuple of the modulo after dividing along with a boolean indicating whether an arithmetic overflow would occur. Note that for unsigned integers overflow never occurs, so the second value is always `false`. Since, for the positive integers, all common definitions of division are equal, this operation is exactly equal to `self.overflowing_rem(rhs)`.
##### Panics
This function will panic if `rhs` is 0.
##### Examples
Basic usage
```
assert_eq!(5u32.overflowing_rem_euclid(2), (1, false));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#858-859)1.7.0 (const: 1.32.0) · #### pub const fn overflowing\_neg(self) -> (u32, bool)
Negates self in an overflowing fashion.
Returns `!self + 1` using wrapping operations to return the value that represents the negation of this unsigned value. Note that for positive unsigned values overflow always occurs, but negating 0 does not overflow.
##### Examples
Basic usage
```
assert_eq!(0u32.overflowing_neg(), (0, false));
assert_eq!(2u32.overflowing_neg(), (-2i32 as u32, true));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#858-859)1.7.0 (const: 1.32.0) · #### pub const fn overflowing\_shl(self, rhs: u32) -> (u32, bool)
Shifts self left by `rhs` bits.
Returns a tuple of the shifted version of self along with a boolean indicating whether the shift value was larger than or equal to the number of bits. If the shift value is too large, then value is masked (N-1) where N is the number of bits, and this value is then used to perform the shift.
##### Examples
Basic usage
```
assert_eq!(0x1u32.overflowing_shl(4), (0x10, false));
assert_eq!(0x1u32.overflowing_shl(132), (0x10, true));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#858-859)1.7.0 (const: 1.32.0) · #### pub const fn overflowing\_shr(self, rhs: u32) -> (u32, bool)
Shifts self right by `rhs` bits.
Returns a tuple of the shifted version of self along with a boolean indicating whether the shift value was larger than or equal to the number of bits. If the shift value is too large, then value is masked (N-1) where N is the number of bits, and this value is then used to perform the shift.
##### Examples
Basic usage
```
assert_eq!(0x10u32.overflowing_shr(4), (0x1, false));
assert_eq!(0x10u32.overflowing_shr(132), (0x1, true));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#858-859)1.34.0 (const: 1.50.0) · #### pub const fn overflowing\_pow(self, exp: u32) -> (u32, bool)
Raises self to the power of `exp`, using exponentiation by squaring.
Returns a tuple of the exponentiation along with a bool indicating whether an overflow happened.
##### Examples
Basic usage:
```
assert_eq!(3u32.overflowing_pow(5), (243, false));
assert_eq!(3u8.overflowing_pow(6), (217, true));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#858-859)const: 1.50.0 · #### pub const fn pow(self, exp: u32) -> u32
Raises self to the power of `exp`, using exponentiation by squaring.
##### Examples
Basic usage:
```
assert_eq!(2u32.pow(5), 32);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#858-859)1.38.0 (const: 1.52.0) · #### pub const fn div\_euclid(self, rhs: u32) -> u32
Performs Euclidean division.
Since, for the positive integers, all common definitions of division are equal, this is exactly equal to `self / rhs`.
##### Panics
This function will panic if `rhs` is 0.
##### Examples
Basic usage:
```
assert_eq!(7u32.div_euclid(4), 1); // or any other integer type
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#858-859)1.38.0 (const: 1.52.0) · #### pub const fn rem\_euclid(self, rhs: u32) -> u32
Calculates the least remainder of `self (mod rhs)`.
Since, for the positive integers, all common definitions of division are equal, this is exactly equal to `self % rhs`.
##### Panics
This function will panic if `rhs` is 0.
##### Examples
Basic usage:
```
assert_eq!(7u32.rem_euclid(4), 3); // or any other integer type
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#858-859)#### pub const fn div\_floor(self, rhs: u32) -> u32
🔬This is a nightly-only experimental API. (`int_roundings` [#88581](https://github.com/rust-lang/rust/issues/88581))
Calculates the quotient of `self` and `rhs`, rounding the result towards negative infinity.
This is the same as performing `self / rhs` for all unsigned integers.
##### Panics
This function will panic if `rhs` is zero.
##### Examples
Basic usage:
```
#![feature(int_roundings)]
assert_eq!(7_u32.div_floor(4), 1);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#858-859)#### pub const fn div\_ceil(self, rhs: u32) -> u32
🔬This is a nightly-only experimental API. (`int_roundings` [#88581](https://github.com/rust-lang/rust/issues/88581))
Calculates the quotient of `self` and `rhs`, rounding the result towards positive infinity.
##### Panics
This function will panic if `rhs` is zero.
###### [Overflow behavior](#overflow-behavior)
On overflow, this function will panic if overflow checks are enabled (default in debug mode) and wrap if overflow checks are disabled (default in release mode).
##### Examples
Basic usage:
```
#![feature(int_roundings)]
assert_eq!(7_u32.div_ceil(4), 2);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#858-859)#### pub const fn next\_multiple\_of(self, rhs: u32) -> u32
🔬This is a nightly-only experimental API. (`int_roundings` [#88581](https://github.com/rust-lang/rust/issues/88581))
Calculates the smallest value greater than or equal to `self` that is a multiple of `rhs`.
##### Panics
This function will panic if `rhs` is zero.
###### [Overflow behavior](#overflow-behavior-1)
On overflow, this function will panic if overflow checks are enabled (default in debug mode) and wrap if overflow checks are disabled (default in release mode).
##### Examples
Basic usage:
```
#![feature(int_roundings)]
assert_eq!(16_u32.next_multiple_of(8), 16);
assert_eq!(23_u32.next_multiple_of(8), 24);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#858-859)#### pub const fn checked\_next\_multiple\_of(self, rhs: u32) -> Option<u32>
🔬This is a nightly-only experimental API. (`int_roundings` [#88581](https://github.com/rust-lang/rust/issues/88581))
Calculates the smallest value greater than or equal to `self` that is a multiple of `rhs`. Returns `None` if `rhs` is zero or the operation would result in overflow.
##### Examples
Basic usage:
```
#![feature(int_roundings)]
assert_eq!(16_u32.checked_next_multiple_of(8), Some(16));
assert_eq!(23_u32.checked_next_multiple_of(8), Some(24));
assert_eq!(1_u32.checked_next_multiple_of(0), None);
assert_eq!(u32::MAX.checked_next_multiple_of(2), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#858-859)const: 1.32.0 · #### pub const fn is\_power\_of\_two(self) -> bool
Returns `true` if and only if `self == 2^k` for some `k`.
##### Examples
Basic usage:
```
assert!(16u32.is_power_of_two());
assert!(!10u32.is_power_of_two());
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#858-859)const: 1.50.0 · #### pub const fn next\_power\_of\_two(self) -> u32
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`), it panics in debug mode and the return value is wrapped to 0 in release mode (the only situation in which method can return 0).
##### Examples
Basic usage:
```
assert_eq!(2u32.next_power_of_two(), 2);
assert_eq!(3u32.next_power_of_two(), 4);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#858-859)const: 1.50.0 · #### pub const fn checked\_next\_power\_of\_two(self) -> Option<u32>
Returns the smallest power of two greater than or equal to `n`. If the next power of two is greater than the type’s maximum value, `None` is returned, otherwise the power of two is wrapped in `Some`.
##### Examples
Basic usage:
```
assert_eq!(2u32.checked_next_power_of_two(), Some(2));
assert_eq!(3u32.checked_next_power_of_two(), Some(4));
assert_eq!(u32::MAX.checked_next_power_of_two(), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#858-859)const: [unstable](https://github.com/rust-lang/rust/issues/32463 "Tracking issue for wrapping_next_power_of_two") · #### pub fn wrapping\_next\_power\_of\_two(self) -> 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 `n`. If the next power of two is greater than the type’s maximum value, the return value is wrapped to `0`.
##### Examples
Basic usage:
```
#![feature(wrapping_next_power_of_two)]
assert_eq!(2u32.wrapping_next_power_of_two(), 2);
assert_eq!(3u32.wrapping_next_power_of_two(), 4);
assert_eq!(u32::MAX.wrapping_next_power_of_two(), 0);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#858-859)1.32.0 (const: 1.44.0) · #### pub const fn to\_be\_bytes(self) -> [u8; 4]
Return the memory representation of this integer as a byte array in big-endian (network) byte order.
##### Examples
```
let bytes = 0x12345678u32.to_be_bytes();
assert_eq!(bytes, [0x12, 0x34, 0x56, 0x78]);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#858-859)1.32.0 (const: 1.44.0) · #### pub const fn to\_le\_bytes(self) -> [u8; 4]
Return the memory representation of this integer as a byte array in little-endian byte order.
##### Examples
```
let bytes = 0x12345678u32.to_le_bytes();
assert_eq!(bytes, [0x78, 0x56, 0x34, 0x12]);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#858-859)1.32.0 (const: 1.44.0) · #### pub const fn to\_ne\_bytes(self) -> [u8; 4]
Return the memory representation of this integer as a byte array in native byte order.
As the target platform’s native endianness is used, portable code should use [`to_be_bytes`](primitive.u32#method.to_be_bytes) or [`to_le_bytes`](primitive.u32#method.to_le_bytes), as appropriate, instead.
##### Examples
```
let bytes = 0x12345678u32.to_ne_bytes();
assert_eq!(
bytes,
if cfg!(target_endian = "big") {
[0x12, 0x34, 0x56, 0x78]
} else {
[0x78, 0x56, 0x34, 0x12]
}
);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#858-859)1.32.0 (const: 1.44.0) · #### pub const fn from\_be\_bytes(bytes: [u8; 4]) -> u32
Create a native endian integer value from its representation as a byte array in big endian.
##### Examples
```
let value = u32::from_be_bytes([0x12, 0x34, 0x56, 0x78]);
assert_eq!(value, 0x12345678);
```
When starting from a slice rather than an array, fallible conversion APIs can be used:
```
fn read_be_u32(input: &mut &[u8]) -> u32 {
let (int_bytes, rest) = input.split_at(std::mem::size_of::<u32>());
*input = rest;
u32::from_be_bytes(int_bytes.try_into().unwrap())
}
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#858-859)1.32.0 (const: 1.44.0) · #### pub const fn from\_le\_bytes(bytes: [u8; 4]) -> u32
Create a native endian integer value from its representation as a byte array in little endian.
##### Examples
```
let value = u32::from_le_bytes([0x78, 0x56, 0x34, 0x12]);
assert_eq!(value, 0x12345678);
```
When starting from a slice rather than an array, fallible conversion APIs can be used:
```
fn read_le_u32(input: &mut &[u8]) -> u32 {
let (int_bytes, rest) = input.split_at(std::mem::size_of::<u32>());
*input = rest;
u32::from_le_bytes(int_bytes.try_into().unwrap())
}
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#858-859)1.32.0 (const: 1.44.0) · #### pub const fn from\_ne\_bytes(bytes: [u8; 4]) -> u32
Create a native endian integer value from its memory representation as a byte array in native endianness.
As the target platform’s native endianness is used, portable code likely wants to use [`from_be_bytes`](primitive.u32#method.from_be_bytes) or [`from_le_bytes`](primitive.u32#method.from_le_bytes), as appropriate instead.
##### Examples
```
let value = u32::from_ne_bytes(if cfg!(target_endian = "big") {
[0x12, 0x34, 0x56, 0x78]
} else {
[0x78, 0x56, 0x34, 0x12]
});
assert_eq!(value, 0x12345678);
```
When starting from a slice rather than an array, fallible conversion APIs can be used:
```
fn read_ne_u32(input: &mut &[u8]) -> u32 {
let (int_bytes, rest) = input.split_at(std::mem::size_of::<u32>());
*input = rest;
u32::from_ne_bytes(int_bytes.try_into().unwrap())
}
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#858-859)const: 1.32.0 · #### pub const fn min\_value() -> u32
👎Deprecating in a future Rust version: replaced by the `MIN` associated constant on this type
New code should prefer to use [`u32::MIN`](primitive.u32#associatedconstant.MIN "u32::MIN") instead.
Returns the smallest value that can be represented by this integer type.
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#858-859)const: 1.32.0 · #### pub const fn max\_value() -> u32
👎Deprecating in a future Rust version: replaced by the `MAX` associated constant on this type
New code should prefer to use [`u32::MAX`](primitive.u32#associatedconstant.MAX "u32::MAX") instead.
Returns the largest value that can be represented by this integer type.
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#860)const: [unstable](https://github.com/rust-lang/rust/issues/85532 "Tracking issue for const_bigint_helper_methods") · #### pub fn widening\_mul(self, rhs: u32) -> (u32, u32)
🔬This is a nightly-only experimental API. (`bigint_helper_methods` [#85532](https://github.com/rust-lang/rust/issues/85532))
Calculates the complete product `self * rhs` without the possibility to overflow.
This returns the low-order (wrapping) bits and the high-order (overflow) bits of the result as two separate values, in that order.
##### Examples
Basic usage:
Please note that this example is shared between integer types. Which explains why `u32` is used here.
```
#![feature(bigint_helper_methods)]
assert_eq!(5u32.widening_mul(2), (10, 0));
assert_eq!(1_000_000_000u32.widening_mul(10), (1410065408, 2));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#860)const: [unstable](https://github.com/rust-lang/rust/issues/85532 "Tracking issue for bigint_helper_methods") · #### pub fn carrying\_mul(self, rhs: u32, carry: u32) -> (u32, u32)
🔬This is a nightly-only experimental API. (`bigint_helper_methods` [#85532](https://github.com/rust-lang/rust/issues/85532))
Calculates the “full multiplication” `self * rhs + carry` without the possibility to overflow.
This returns the low-order (wrapping) bits and the high-order (overflow) bits of the result as two separate values, in that order.
Performs “long multiplication” which takes in an extra amount to add, and may return an additional amount of overflow. This allows for chaining together multiple multiplications to create “big integers” which represent larger values.
##### Examples
Basic usage:
Please note that this example is shared between integer types. Which explains why `u32` is used here.
```
#![feature(bigint_helper_methods)]
assert_eq!(5u32.carrying_mul(2, 0), (10, 0));
assert_eq!(5u32.carrying_mul(2, 10), (20, 0));
assert_eq!(1_000_000_000u32.carrying_mul(10, 0), (1410065408, 2));
assert_eq!(1_000_000_000u32.carrying_mul(10, 10), (1410065418, 2));
assert_eq!(u32::MAX.carrying_mul(u32::MAX, u32::MAX), (0, u32::MAX));
```
If `carry` is zero, this is similar to [`overflowing_mul`](primitive.u32#method.overflowing_mul), except that it gives the value of the overflow instead of just whether one happened:
```
#![feature(bigint_helper_methods)]
let r = u8::carrying_mul(7, 13, 0);
assert_eq!((r.0, r.1 != 0), u8::overflowing_mul(7, 13));
let r = u8::carrying_mul(13, 42, 0);
assert_eq!((r.0, r.1 != 0), u8::overflowing_mul(13, 42));
```
The value of the first field in the returned tuple matches what you’d get by combining the [`wrapping_mul`](primitive.u32#method.wrapping_mul) and [`wrapping_add`](primitive.u32#method.wrapping_add) methods:
```
#![feature(bigint_helper_methods)]
assert_eq!(
789_u16.carrying_mul(456, 123).0,
789_u16.wrapping_mul(456).wrapping_add(123),
);
```
Trait Implementations
---------------------
[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
The resulting type after applying the `+` operator.
[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") · #### fn add(self, other: &u32) -> <u32 as Add<u32>>::Output
Performs the `+` operation. [Read more](ops/trait.add#tymethod.add)
[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
The resulting type after applying the `+` operator.
[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") · #### fn add(self, other: &u32) -> <u32 as Add<u32>>::Output
Performs the `+` operation. [Read more](ops/trait.add#tymethod.add)
[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
The resulting type after applying the `+` operator.
[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") · #### fn add(self, other: u32) -> <u32 as Add<u32>>::Output
Performs the `+` operation. [Read more](ops/trait.add#tymethod.add)
[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
The resulting type after applying the `+` operator.
[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") · #### fn add(self, other: u32) -> u32
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<&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/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/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/ops/arith.rs.html#786)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/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/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/ops/arith.rs.html#786)1.8.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/ops/arith.rs.html#786)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/fmt/num.rs.html#177)### impl Binary for u32
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#177)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error>
Formats the value using the given formatter.
[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
The resulting type after applying the `&` operator.
[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") · #### fn bitand(self, other: &u32) -> <u32 as BitAnd<u32>>::Output
Performs the `&` operation. [Read more](ops/trait.bitand#tymethod.bitand)
[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
The resulting type after applying the `&` operator.
[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") · #### fn bitand(self, other: &u32) -> <u32 as BitAnd<u32>>::Output
Performs the `&` operation. [Read more](ops/trait.bitand#tymethod.bitand)
[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
The resulting type after applying the `&` operator.
[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") · #### fn bitand(self, other: u32) -> <u32 as BitAnd<u32>>::Output
Performs the `&` operation. [Read more](ops/trait.bitand#tymethod.bitand)
[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
The resulting type after applying the `&` operator.
[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") · #### fn bitand(self, rhs: u32) -> u32
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<&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/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/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/ops/bit.rs.html#734)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/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/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/ops/bit.rs.html#734)1.8.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/ops/bit.rs.html#734)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/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
The resulting type after applying the `|` operator.
[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") · #### fn bitor(self, other: &u32) -> <u32 as BitOr<u32>>::Output
Performs the `|` operation. [Read more](ops/trait.bitor#tymethod.bitor)
[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
The resulting type after applying the `|` operator.
[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") · #### fn bitor(self, other: &u32) -> <u32 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 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/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
The resulting type after applying the `|` operator.
[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") · #### fn bitor(self, other: u32) -> <u32 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 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/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
The resulting type after applying the `|` operator.
[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") · #### fn bitor(self, rhs: u32) -> u32
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<&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/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/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/ops/bit.rs.html#806)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/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/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/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/ops/bit.rs.html#806)1.8.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/ops/bit.rs.html#806)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/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
The resulting type after applying the `^` operator.
[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") · #### fn bitxor(self, other: &u32) -> <u32 as BitXor<u32>>::Output
Performs the `^` operation. [Read more](ops/trait.bitxor#tymethod.bitxor)
[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
The resulting type after applying the `^` operator.
[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") · #### fn bitxor(self, other: &u32) -> <u32 as BitXor<u32>>::Output
Performs the `^` operation. [Read more](ops/trait.bitxor#tymethod.bitxor)
[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
The resulting type after applying the `^` operator.
[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") · #### fn bitxor(self, other: u32) -> <u32 as BitXor<u32>>::Output
Performs the `^` operation. [Read more](ops/trait.bitxor#tymethod.bitxor)
[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
The resulting type after applying the `^` operator.
[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") · #### fn bitxor(self, other: u32) -> u32
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<&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/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/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/ops/bit.rs.html#878)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/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/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/ops/bit.rs.html#878)1.8.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/ops/bit.rs.html#878)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/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") · #### fn clone(&self) -> u32
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/num.rs.html#197-200)### impl Debug for u32
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#197-200)#### 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/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#210)const: [unstable](https://github.com/rust-lang/rust/issues/87864 "Tracking issue for const_default_impls") · #### fn default() -> u32
Returns the default value of `0`
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#461-464)### impl Display for u32
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#461-464)#### 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/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
The resulting type after applying the `/` operator.
[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") · #### fn div(self, other: &u32) -> <u32 as Div<u32>>::Output
Performs the `/` operation. [Read more](ops/trait.div#tymethod.div)
[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
The resulting type after applying the `/` operator.
[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") · #### fn div(self, other: &u32) -> <u32 as Div<u32>>::Output
Performs the `/` operation. [Read more](ops/trait.div#tymethod.div)
[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/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
The resulting type after applying the `/` operator.
[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") · #### fn div(self, other: u32) -> <u32 as Div<u32>>::Output
Performs the `/` operation. [Read more](ops/trait.div#tymethod.div)
[source](https://doc.rust-lang.org/src/core/time.rs.html#967)1.3.0 · ### 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/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
The resulting type after applying the `/` operator.
[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") · #### fn div(self, other: u32) -> u32
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<&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/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/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/ops/arith.rs.html#968)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/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/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/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/ops/arith.rs.html#968)1.8.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/ops/arith.rs.html#968)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/std/net/ip_addr.rs.html#1093-1108)1.1.0 · ### impl From<Ipv4Addr> for u32
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#1105-1107)#### fn from(ip: Ipv4Addr) -> u32
Converts an `Ipv4Addr` into a host byte order `u32`.
##### Examples
```
use std::net::Ipv4Addr;
let addr = Ipv4Addr::new(0x12, 0x34, 0x56, 0x78);
assert_eq!(0x12345678, u32::from(addr));
```
[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#88)1.28.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<bool> for u32
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#88)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: bool) -> u32
Converts a `bool` to a `u32`. The resulting value is `0` for `false` and `1` for `true` values.
##### Examples
```
assert_eq!(u32::from(true), 1);
assert_eq!(u32::from(false), 0);
```
[source](https://doc.rust-lang.org/src/core/char/convert.rs.html#31)1.13.0 (const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert")) · ### impl From<char> for u32
[source](https://doc.rust-lang.org/src/core/char/convert.rs.html#44)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn from(c: char) -> u32
Converts a [`char`](primitive.char "char") into a [`u32`](primitive.u32 "u32").
##### Examples
```
use std::mem;
let c = 'c';
let u = u32::from(c);
assert!(4 == mem::size_of_val(&u))
```
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#105)1.5.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<u16> for u32
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#105)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: u16) -> u32
Converts `u16` to `u32` losslessly.
[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/87852 "Tracking issue for const_num_from_num")) · ### impl From<u32> for AtomicU32
[source](https://doc.rust-lang.org/src/core/sync/atomic.rs.html#2775-2793)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(v: u32) -> AtomicU32
Converts an `u32` into an `AtomicU32`.
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#1111-1126)1.1.0 · ### impl From<u32> for Ipv4Addr
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#1123-1125)#### fn from(ip: u32) -> Ipv4Addr
Converts a host byte order `u32` into an `Ipv4Addr`.
##### Examples
```
use std::net::Ipv4Addr;
let addr = Ipv4Addr::from(0x12345678);
assert_eq!(Ipv4Addr::new(0x12, 0x34, 0x56, 0x78), addr);
```
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#166)1.6.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<u32> for f64
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#166)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: u32) -> f64
Converts `u32` to `f64` losslessly.
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#134)1.26.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<u32> for i128
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#134)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: u32) -> i128
Converts `u32` to `i128` losslessly.
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#133)1.5.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<u32> for i64
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#133)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: u32) -> i64
Converts `u32` to `i64` losslessly.
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#109)1.26.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<u32> for u128
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#109)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: u32) -> u128
Converts `u32` to `u128` losslessly.
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#108)1.5.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<u32> for u64
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#108)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: u32) -> u64
Converts `u32` to `u64` losslessly.
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#101)1.5.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<u8> for u32
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#101)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: u8) -> u32
Converts `u8` to `u32` losslessly.
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#1018)### impl FromStr for u32
#### type Err = ParseIntError
The associated error which can be returned from parsing.
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#1018)#### fn from\_str(src: &str) -> Result<u32, ParseIntError>
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/hash/mod.rs.html#829-842)### impl Hash for u32
[source](https://doc.rust-lang.org/src/core/hash/mod.rs.html#829-842)#### 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#829-842)#### fn hash\_slice<H>(data: &[u32], 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/fmt/num.rs.html#465-468)1.42.0 · ### impl LowerExp for u32
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#465-468)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error>
Formats the value using the given formatter.
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#177)### impl LowerHex for u32
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#177)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error>
Formats the value using the given formatter.
[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
The resulting type after applying the `*` operator.
[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") · #### fn mul(self, other: &u32) -> <u32 as Mul<u32>>::Output
Performs the `*` operation. [Read more](ops/trait.mul#tymethod.mul)
[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
The resulting type after applying the `*` operator.
[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") · #### fn mul(self, other: &u32) -> <u32 as Mul<u32>>::Output
Performs the `*` operation. [Read more](ops/trait.mul#tymethod.mul)
[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/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
The resulting type after applying the `*` operator.
[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") · #### fn mul(self, other: u32) -> <u32 as Mul<u32>>::Output
Performs the `*` operation. [Read more](ops/trait.mul#tymethod.mul)
[source](https://doc.rust-lang.org/src/core/time.rs.html#942)1.3.0 · ### 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/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
The resulting type after applying the `*` operator.
[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") · #### fn mul(self, other: u32) -> u32
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<&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/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/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/ops/arith.rs.html#911)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/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/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/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/ops/arith.rs.html#911)1.8.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/ops/arith.rs.html#911)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/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
The resulting type after applying the `!` operator.
[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") · #### fn not(self) -> <u32 as Not>::Output
Performs the unary `!` operation. [Read more](ops/trait.not#tymethod.not)
[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
The resulting type after applying the `!` operator.
[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") · #### fn not(self) -> u32
Performs the unary `!` operation. [Read more](ops/trait.not#tymethod.not)
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#177)### impl Octal for u32
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#177)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error>
Formats the value using the given formatter.
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1486)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · ### impl Ord for u32
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1486)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · #### fn cmp(&self, other: &u32) -> 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/cmp.rs.html#1366-1368)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · ### impl PartialEq<u32> for u32
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1366-1368)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · #### fn eq(&self, other: &u32) -> 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#1366-1368)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · #### fn ne(&self, other: &u32) -> 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/cmp.rs.html#1486)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · ### impl PartialOrd<u32> for u32
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1486)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · #### fn partial\_cmp(&self, other: &u32) -> 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#1486)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · #### fn lt(&self, other: &u32) -> 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#1486)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · #### fn le(&self, other: &u32) -> 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#1486)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · #### fn ge(&self, other: &u32) -> 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/cmp.rs.html#1486)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · #### fn gt(&self, other: &u32) -> 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/iter/traits/accum.rs.html#141)1.12.0 · ### impl<'a> Product<&'a u32> for u32
[source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)#### fn product<I>(iter: I) -> u32where I: [Iterator](iter/trait.iterator "trait std::iter::Iterator")<Item = &'a [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.12.0 · ### impl Product<u32> for u32
[source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)#### fn product<I>(iter: I) -> u32where I: [Iterator](iter/trait.iterator "trait std::iter::Iterator")<Item = [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/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
The resulting type after applying the `%` operator.
[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") · #### fn rem(self, other: &u32) -> <u32 as Rem<u32>>::Output
Performs the `%` operation. [Read more](ops/trait.rem#tymethod.rem)
[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
The resulting type after applying the `%` operator.
[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") · #### fn rem(self, other: &u32) -> <u32 as Rem<u32>>::Output
Performs the `%` operation. [Read more](ops/trait.rem#tymethod.rem)
[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/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
The resulting type after applying the `%` operator.
[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") · #### fn rem(self, other: u32) -> <u32 as Rem<u32>>::Output
Performs the `%` operation. [Read more](ops/trait.rem#tymethod.rem)
[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
The resulting type after applying the `%` operator.
[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") · #### fn rem(self, other: u32) -> u32
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<&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/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/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/ops/arith.rs.html#1029)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/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/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/ops/arith.rs.html#1029)1.8.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/ops/arith.rs.html#1029)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/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i128) -> <u32 as Shl<i128>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i128) -> <u32 as Shl<i128>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i16) -> <u32 as Shl<i16>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i16) -> <u32 as Shl<i16>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i32) -> <u32 as Shl<i32>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i32) -> <u32 as Shl<i32>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i64) -> <u32 as Shl<i64>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i64) -> <u32 as Shl<i64>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i8) -> <u32 as Shl<i8>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i8) -> <u32 as Shl<i8>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &isize) -> <u32 as Shl<isize>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &isize) -> <u32 as Shl<isize>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u128) -> <u32 as Shl<u128>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u128) -> <u32 as Shl<u128>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u16) -> <u32 as Shl<u16>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u16) -> <u32 as Shl<u16>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u32) -> <i128 as Shl<u32>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u32) -> <i16 as Shl<u32>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u32) -> <i32 as Shl<u32>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u32) -> <i64 as Shl<u32>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u32) -> <i8 as Shl<u32>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u32) -> <isize as Shl<u32>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u32) -> <u128 as Shl<u32>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u32) -> <u16 as Shl<u32>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u32) -> <u32 as Shl<u32>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u32) -> <u64 as Shl<u32>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u32) -> <u8 as Shl<u32>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u32) -> <usize as Shl<u32>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u32) -> <i128 as Shl<u32>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u32) -> <i16 as Shl<u32>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u32) -> <i32 as Shl<u32>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u32) -> <i64 as Shl<u32>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u32) -> <i8 as Shl<u32>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u32) -> <isize as Shl<u32>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u32) -> <u128 as Shl<u32>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u32) -> <u16 as Shl<u32>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u32) -> <u32 as Shl<u32>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u32) -> <u64 as Shl<u32>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u32) -> <u8 as Shl<u32>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u32) -> <usize as Shl<u32>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u64) -> <u32 as Shl<u64>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u64) -> <u32 as Shl<u64>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u8) -> <u32 as Shl<u8>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u8) -> <u32 as Shl<u8>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &usize) -> <u32 as Shl<usize>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &usize) -> <u32 as Shl<usize>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i128) -> <u32 as Shl<i128>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i128) -> u32
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i16) -> <u32 as Shl<i16>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i16) -> u32
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i32) -> <u32 as Shl<i32>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i32) -> u32
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i64) -> <u32 as Shl<i64>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i64) -> u32
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i8) -> <u32 as Shl<i8>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i8) -> u32
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: isize) -> <u32 as Shl<isize>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: isize) -> u32
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u128) -> <u32 as Shl<u128>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u128) -> u32
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u16) -> <u32 as Shl<u16>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u16) -> u32
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u32) -> <i128 as Shl<u32>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u32) -> <i16 as Shl<u32>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u32) -> <i32 as Shl<u32>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u32) -> <i64 as Shl<u32>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u32) -> <i8 as Shl<u32>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u32) -> <isize as Shl<u32>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u32) -> <u128 as Shl<u32>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u32) -> <u16 as Shl<u32>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u32) -> <u32 as Shl<u32>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u32) -> <u64 as Shl<u32>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u32) -> <u8 as Shl<u32>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u32) -> <usize as Shl<u32>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u32) -> i128
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u32) -> i16
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u32) -> i32
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u32) -> i64
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u32) -> i8
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u32) -> isize
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u32) -> u128
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u32) -> u16
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u32) -> u32
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u32) -> u64
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u32) -> u8
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u32) -> usize
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u64) -> <u32 as Shl<u64>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u64) -> u32
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u8) -> <u32 as Shl<u8>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u8) -> u32
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: usize) -> <u32 as Shl<usize>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: usize) -> u32
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &i128)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &i16)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &i32)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &i64)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &i8)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &isize)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &u128)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &u16)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &u32)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &u32)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &u32)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &u32)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &u32)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &u32)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &u32)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &u32)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &u32)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &u32)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &u32)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &u32)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &u64)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &u8)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)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/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: i128)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: i16)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: i32)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: i64)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: i8)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: isize)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: u128)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: u16)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: u32)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: u32)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: u32)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: u32)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: u32)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: u32)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: u32)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: u32)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: u32)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: u32)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: u32)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: u32)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: u64)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: u8)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)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/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i128) -> <u32 as Shr<i128>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i128) -> <u32 as Shr<i128>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i16) -> <u32 as Shr<i16>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i16) -> <u32 as Shr<i16>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i32) -> <u32 as Shr<i32>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i32) -> <u32 as Shr<i32>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i64) -> <u32 as Shr<i64>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i64) -> <u32 as Shr<i64>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i8) -> <u32 as Shr<i8>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i8) -> <u32 as Shr<i8>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &isize) -> <u32 as Shr<isize>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &isize) -> <u32 as Shr<isize>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u128) -> <u32 as Shr<u128>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u128) -> <u32 as Shr<u128>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u16) -> <u32 as Shr<u16>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u16) -> <u32 as Shr<u16>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u32) -> <i128 as Shr<u32>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u32) -> <i16 as Shr<u32>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u32) -> <i32 as Shr<u32>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u32) -> <i64 as Shr<u32>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u32) -> <i8 as Shr<u32>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u32) -> <isize as Shr<u32>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u32) -> <u128 as Shr<u32>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u32) -> <u16 as Shr<u32>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u32) -> <u32 as Shr<u32>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u32) -> <u64 as Shr<u32>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u32) -> <u8 as Shr<u32>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u32) -> <usize as Shr<u32>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u32) -> <i128 as Shr<u32>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u32) -> <i16 as Shr<u32>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u32) -> <i32 as Shr<u32>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u32) -> <i64 as Shr<u32>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u32) -> <i8 as Shr<u32>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u32) -> <isize as Shr<u32>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u32) -> <u128 as Shr<u32>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u32) -> <u16 as Shr<u32>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u32) -> <u32 as Shr<u32>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u32) -> <u64 as Shr<u32>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u32) -> <u8 as Shr<u32>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u32) -> <usize as Shr<u32>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u64) -> <u32 as Shr<u64>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u64) -> <u32 as Shr<u64>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u8) -> <u32 as Shr<u8>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u8) -> <u32 as Shr<u8>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &usize) -> <u32 as Shr<usize>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &usize) -> <u32 as Shr<usize>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i128) -> <u32 as Shr<i128>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i128) -> u32
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i16) -> <u32 as Shr<i16>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i16) -> u32
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i32) -> <u32 as Shr<i32>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i32) -> u32
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i64) -> <u32 as Shr<i64>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i64) -> u32
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i8) -> <u32 as Shr<i8>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i8) -> u32
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: isize) -> <u32 as Shr<isize>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: isize) -> u32
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u128) -> <u32 as Shr<u128>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u128) -> u32
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u16) -> <u32 as Shr<u16>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u16) -> u32
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u32) -> <i128 as Shr<u32>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u32) -> <i16 as Shr<u32>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u32) -> <i32 as Shr<u32>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u32) -> <i64 as Shr<u32>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u32) -> <i8 as Shr<u32>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u32) -> <isize as Shr<u32>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u32) -> <u128 as Shr<u32>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u32) -> <u16 as Shr<u32>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u32) -> <u32 as Shr<u32>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u32) -> <u64 as Shr<u32>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u32) -> <u8 as Shr<u32>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u32) -> <usize as Shr<u32>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u32) -> i128
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u32) -> i16
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u32) -> i32
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u32) -> i64
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u32) -> i8
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u32) -> isize
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u32) -> u128
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u32) -> u16
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u32) -> u32
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u32) -> u64
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u32) -> u8
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u32) -> usize
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u64) -> <u32 as Shr<u64>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u64) -> u32
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u8) -> <u32 as Shr<u8>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u8) -> u32
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: usize) -> <u32 as Shr<usize>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: usize) -> u32
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &i128)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &i16)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &i32)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &i64)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &i8)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &isize)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &u128)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &u16)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &u32)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &u32)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &u32)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &u32)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &u32)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &u32)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &u32)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &u32)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &u32)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &u32)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &u32)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &u32)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &u64)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &u8)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)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/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: i128)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: i16)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: i32)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: i64)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: i8)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: isize)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: u128)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: u16)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: u32)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: u32)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: u32)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: u32)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: u32)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: u32)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: u32)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: u32)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: u32)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: u32)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: u32)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: u32)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: u64)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: u8)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)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/up/up/portable-simd/crates/core_simd/src/vector.rs.html#677)### impl SimdElement for u32
#### type Mask = i32
🔬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.
[source](https://doc.rust-lang.org/src/core/iter/range.rs.html#391-394)### impl Step for u32
[source](https://doc.rust-lang.org/src/core/iter/range.rs.html#391-394)#### unsafe fn forward\_unchecked(start: u32, n: usize) -> u32
🔬This is a nightly-only experimental API. (`step_trait` [#42168](https://github.com/rust-lang/rust/issues/42168))
Returns the value that would be obtained by taking the *successor* of `self` `count` times. [Read more](iter/trait.step#method.forward_unchecked)
[source](https://doc.rust-lang.org/src/core/iter/range.rs.html#391-394)#### unsafe fn backward\_unchecked(start: u32, n: usize) -> u32
🔬This is a nightly-only experimental API. (`step_trait` [#42168](https://github.com/rust-lang/rust/issues/42168))
Returns the value that would be obtained by taking the *predecessor* of `self` `count` times. [Read more](iter/trait.step#method.backward_unchecked)
[source](https://doc.rust-lang.org/src/core/iter/range.rs.html#391-394)#### fn forward(start: u32, n: usize) -> u32
🔬This is a nightly-only experimental API. (`step_trait` [#42168](https://github.com/rust-lang/rust/issues/42168))
Returns the value that would be obtained by taking the *successor* of `self` `count` times. [Read more](iter/trait.step#method.forward)
[source](https://doc.rust-lang.org/src/core/iter/range.rs.html#391-394)#### fn backward(start: u32, n: usize) -> u32
🔬This is a nightly-only experimental API. (`step_trait` [#42168](https://github.com/rust-lang/rust/issues/42168))
Returns the value that would be obtained by taking the *predecessor* of `self` `count` times. [Read more](iter/trait.step#method.backward)
[source](https://doc.rust-lang.org/src/core/iter/range.rs.html#391-394)#### fn steps\_between(start: &u32, end: &u32) -> Option<usize>
🔬This is a nightly-only experimental API. (`step_trait` [#42168](https://github.com/rust-lang/rust/issues/42168))
Returns the number of *successor* steps required to get from `start` to `end`. [Read more](iter/trait.step#tymethod.steps_between)
[source](https://doc.rust-lang.org/src/core/iter/range.rs.html#391-394)#### fn forward\_checked(start: u32, n: usize) -> Option<u32>
🔬This is a nightly-only experimental API. (`step_trait` [#42168](https://github.com/rust-lang/rust/issues/42168))
Returns the value that would be obtained by taking the *successor* of `self` `count` times. [Read more](iter/trait.step#tymethod.forward_checked)
[source](https://doc.rust-lang.org/src/core/iter/range.rs.html#391-394)#### fn backward\_checked(start: u32, n: usize) -> Option<u32>
🔬This is a nightly-only experimental API. (`step_trait` [#42168](https://github.com/rust-lang/rust/issues/42168))
Returns the value that would be obtained by taking the *predecessor* of `self` `count` times. [Read more](iter/trait.step#tymethod.backward_checked)
[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
The resulting type after applying the `-` operator.
[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") · #### fn sub(self, other: &u32) -> <u32 as Sub<u32>>::Output
Performs the `-` operation. [Read more](ops/trait.sub#tymethod.sub)
[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
The resulting type after applying the `-` operator.
[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") · #### fn sub(self, other: &u32) -> <u32 as Sub<u32>>::Output
Performs the `-` operation. [Read more](ops/trait.sub#tymethod.sub)
[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
The resulting type after applying the `-` operator.
[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") · #### fn sub(self, other: u32) -> <u32 as Sub<u32>>::Output
Performs the `-` operation. [Read more](ops/trait.sub#tymethod.sub)
[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
The resulting type after applying the `-` operator.
[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") · #### fn sub(self, other: u32) -> u32
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<&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/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/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/ops/arith.rs.html#853)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/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/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/ops/arith.rs.html#853)1.8.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/ops/arith.rs.html#853)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/iter/traits/accum.rs.html#141)1.12.0 · ### impl<'a> Sum<&'a u32> for u32
[source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)#### fn sum<I>(iter: I) -> u32where I: [Iterator](iter/trait.iterator "trait std::iter::Iterator")<Item = &'a [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.12.0 · ### impl Sum<u32> for u32
[source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)#### fn sum<I>(iter: I) -> u32where I: [Iterator](iter/trait.iterator "trait std::iter::Iterator")<Item = [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/convert/num.rs.html#294)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<i128> for u32
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#294)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: i128) -> Result<u32, <u32 as TryFrom<i128>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#287)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<i16> for u32
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#287)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: i16) -> Result<u32, <u32 as TryFrom<i16>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#288)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<i32> for u32
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#288)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: i32) -> Result<u32, <u32 as TryFrom<i32>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#293)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<i64> for u32
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#293)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: i64) -> Result<u32, <u32 as TryFrom<i64>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#286)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<i8> for u32
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#286)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: i8) -> Result<u32, <u32 as TryFrom<i8>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#359)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<isize> for u32
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#359)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: isize) -> Result<u32, <u32 as TryFrom<isize>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#271)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<u128> for u32
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#271)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: u128) -> Result<u32, <u32 as TryFrom<u128>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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/char/convert.rs.html#221)1.34.0 · ### impl TryFrom<u32> for char
#### type Error = CharTryFromError
The type returned in the event of a conversion error.
[source](https://doc.rust-lang.org/src/core/char/convert.rs.html#225)#### fn try\_from(i: u32) -> Result<char, <char as TryFrom<u32>>::Error>
Performs the conversion.
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#281)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<u32> for i16
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#281)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: u32) -> Result<i16, <i16 as TryFrom<u32>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#281)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<u32> for i32
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#281)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: u32) -> Result<i32, <i32 as TryFrom<u32>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#281)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<u32> for i8
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#281)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: u32) -> Result<i8, <i8 as TryFrom<u32>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#369)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<u32> for isize
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#369)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(value: u32) -> Result<isize, <isize as TryFrom<u32>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#269)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<u32> for u16
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#269)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: u32) -> Result<u16, <u16 as TryFrom<u32>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#269)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<u32> for u8
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#269)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: u32) -> Result<u8, <u8 as TryFrom<u32>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#364)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<u32> for usize
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#364)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(value: u32) -> Result<usize, <usize as TryFrom<u32>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#270)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<u64> for u32
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#270)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: u64) -> Result<u32, <u32 as TryFrom<u64>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#354)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<usize> for u32
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#354)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: usize) -> Result<u32, <u32 as TryFrom<usize>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### type Error = TryFromIntError
The type returned in the event of a conversion error.
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#465-468)1.42.0 · ### impl UpperExp for u32
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#465-468)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error>
Formats the value using the given formatter.
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#177)### impl UpperHex for u32
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#177)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error>
Formats the value using the given formatter.
[source](https://doc.rust-lang.org/src/core/marker.rs.html#830-835)### impl Copy for u32
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1377)### impl Eq for u32
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#38)### impl FloatToInt<u32> for f32
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#39)### impl FloatToInt<u32> for f64
[source](https://doc.rust-lang.org/src/core/iter/range.rs.html#17)### impl TrustedStep for u32
Auto Trait Implementations
--------------------------
### impl RefUnwindSafe for u32
### impl Send for u32
### impl Sync for u32
### impl Unpin for u32
### impl UnwindSafe for u32
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 Macro std::concat_bytes Macro std::concat\_bytes
========================
```
macro_rules! concat_bytes {
($($e:literal),+ $(,)?) => { ... };
}
```
🔬This is a nightly-only experimental API. (`concat_bytes` [#87555](https://github.com/rust-lang/rust/issues/87555))
Concatenates literals into a byte slice.
This macro takes any number of comma-separated literals, and concatenates them all into one, yielding an expression of type `&[u8; _]`, which represents all of the literals concatenated left-to-right. The literals passed can be any combination of:
* byte literals (`b'r'`)
* byte strings (`b"Rust"`)
* arrays of bytes/numbers (`[b'A', 66, b'C']`)
Examples
--------
```
#![feature(concat_bytes)]
let s: &[u8; 6] = concat_bytes!(b'A', b"BC", [68, b'E', 70]);
assert_eq!(s, b"ABCDEF");
```
rust Macro std::include Macro std::include
==================
```
macro_rules! include {
($file:expr $(,)?) => { ... };
}
```
Parses a file as an expression or an item according to the context.
The file is located relative to the current file (similarly to how modules are found). The provided path is interpreted in a platform-specific way at compile time. So, for instance, an invocation with a Windows path containing backslashes `\` would not compile correctly on Unix.
Using this macro is often a bad idea, because if the file is parsed as an expression, it is going to be placed in the surrounding code unhygienically. This could result in variables or functions being different from what the file expected if there are variables or functions that have the same name in the current file.
Examples
--------
Assume there are two files in the same directory with the following contents:
File ‘monkeys.in’:
ⓘ
```
['🙈', '🙊', '🙉']
.iter()
.cycle()
.take(6)
.collect::<String>()
```
File ‘main.rs’:
ⓘ
```
fn main() {
let my_string = include!("monkeys.in");
assert_eq!("🙈🙊🙉🙈🙊🙉", my_string);
println!("{my_string}");
}
```
Compiling ‘main.rs’ and running the resulting binary will print “🙈🙊🙉🙈🙊🙉”.
rust Keyword where Keyword where
=============
Add constraints that must be upheld to use an item.
`where` allows specifying constraints on lifetime and generic parameters. The [RFC](https://github.com/rust-lang/rfcs/blob/master/text/0135-where.md) introducing `where` contains detailed information about the keyword.
Examples
--------
`where` can be used for constraints with traits:
```
fn new<T: Default>() -> T {
T::default()
}
fn new_where<T>() -> T
where
T: Default,
{
T::default()
}
assert_eq!(0.0, new());
assert_eq!(0.0, new_where());
assert_eq!(0, new());
assert_eq!(0, new_where());
```
`where` can also be used for lifetimes.
This compiles because `longer` outlives `shorter`, thus the constraint is respected:
```
fn select<'short, 'long>(s1: &'short str, s2: &'long str, second: bool) -> &'short str
where
'long: 'short,
{
if second { s2 } else { s1 }
}
let outer = String::from("Long living ref");
let longer = &outer;
{
let inner = String::from("Short living ref");
let shorter = &inner;
assert_eq!(select(shorter, longer, false), shorter);
assert_eq!(select(shorter, longer, true), longer);
}
```
On the other hand, this will not compile because the `where 'b: 'a` clause is missing: the `'b` lifetime is not known to live at least as long as `'a` which means this function cannot ensure it always returns a valid reference:
ⓘ
```
fn select<'a, 'b>(s1: &'a str, s2: &'b str, second: bool) -> &'a str
{
if second { s2 } else { s1 }
}
```
`where` can also be used to express more complicated constraints that cannot be written with the `<T: Trait>` syntax:
```
fn first_or_default<I>(mut i: I) -> I::Item
where
I: Iterator,
I::Item: Default,
{
i.next().unwrap_or_else(I::Item::default)
}
assert_eq!(first_or_default([1, 2, 3].into_iter()), 1);
assert_eq!(first_or_default(Vec::<i32>::new().into_iter()), 0);
```
`where` is available anywhere generic and lifetime parameters are available, as can be seen with the [`Cow`](borrow/enum.cow) type from the standard library:
```
pub enum Cow<'a, B>
where
B: 'a + ToOwned + ?Sized,
{
Borrowed(&'a B),
Owned(<B as ToOwned>::Owned),
}
```
rust Primitive Type u128 Primitive Type u128
===================
The 128-bit unsigned integer type.
Implementations
---------------
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#872)### impl u128
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#873-880)1.43.0 · #### pub const MIN: u128 = 0u128
The smallest value that can be represented by this integer type.
##### Examples
Basic usage:
```
assert_eq!(u128::MIN, 0);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#873-880)1.43.0 · #### pub const MAX: u128 = 340\_282\_366\_920\_938\_463\_463\_374\_607\_431\_768\_211\_455u128
The largest value that can be represented by this integer type (2128 − 1)
##### Examples
Basic usage:
```
assert_eq!(u128::MAX, 340282366920938463463374607431768211455);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#873-880)1.53.0 · #### pub const BITS: u32 = 128u32
The size of this integer type in bits.
##### Examples
```
assert_eq!(u128::BITS, 128);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#873-880)1.0.0 · #### pub fn from\_str\_radix(src: &str, radix: u32) -> Result<u128, ParseIntError>
Converts a string slice in a given base to an integer.
The string is expected to be an optional `+` sign followed by digits. Leading and trailing whitespace represent an error. Digits are a subset of these characters, depending on `radix`:
* `0-9`
* `a-z`
* `A-Z`
##### Panics
This function panics if `radix` is not in the range from 2 to 36.
##### Examples
Basic usage:
```
assert_eq!(u128::from_str_radix("A", 16), Ok(10));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#873-880)1.0.0 (const: 1.32.0) · #### pub const fn count\_ones(self) -> u32
Returns the number of ones in the binary representation of `self`.
##### Examples
Basic usage:
```
let n = 0b01001100u128;
assert_eq!(n.count_ones(), 3);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#873-880)1.0.0 (const: 1.32.0) · #### pub const fn count\_zeros(self) -> u32
Returns the number of zeros in the binary representation of `self`.
##### Examples
Basic usage:
```
assert_eq!(u128::MAX.count_zeros(), 0);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#873-880)1.0.0 (const: 1.32.0) · #### pub const fn leading\_zeros(self) -> u32
Returns the number of leading zeros in the binary representation of `self`.
##### Examples
Basic usage:
```
let n = u128::MAX >> 2;
assert_eq!(n.leading_zeros(), 2);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#873-880)1.0.0 (const: 1.32.0) · #### pub const fn trailing\_zeros(self) -> u32
Returns the number of trailing zeros in the binary representation of `self`.
##### Examples
Basic usage:
```
let n = 0b0101000u128;
assert_eq!(n.trailing_zeros(), 3);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#873-880)1.46.0 (const: 1.46.0) · #### pub const fn leading\_ones(self) -> u32
Returns the number of leading ones in the binary representation of `self`.
##### Examples
Basic usage:
```
let n = !(u128::MAX >> 2);
assert_eq!(n.leading_ones(), 2);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#873-880)1.46.0 (const: 1.46.0) · #### pub const fn trailing\_ones(self) -> u32
Returns the number of trailing ones in the binary representation of `self`.
##### Examples
Basic usage:
```
let n = 0b1010111u128;
assert_eq!(n.trailing_ones(), 3);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#873-880)1.0.0 (const: 1.32.0) · #### pub const fn rotate\_left(self, n: u32) -> u128
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:
```
let n = 0x13f40000000000000000000000004f76u128;
let m = 0x4f7613f4;
assert_eq!(n.rotate_left(16), m);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#873-880)1.0.0 (const: 1.32.0) · #### pub const fn rotate\_right(self, n: u32) -> u128
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:
```
let n = 0x4f7613f4u128;
let m = 0x13f40000000000000000000000004f76;
assert_eq!(n.rotate_right(16), m);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#873-880)1.0.0 (const: 1.32.0) · #### pub const fn swap\_bytes(self) -> u128
Reverses the byte order of the integer.
##### Examples
Basic usage:
```
let n = 0x12345678901234567890123456789012u128;
let m = n.swap_bytes();
assert_eq!(m, 0x12907856341290785634129078563412);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#873-880)1.37.0 (const: 1.37.0) · #### pub const fn reverse\_bits(self) -> u128
Reverses the order of bits in the integer. The least significant bit becomes the most significant bit, second least-significant bit becomes second most-significant bit, etc.
##### Examples
Basic usage:
```
let n = 0x12345678901234567890123456789012u128;
let m = n.reverse_bits();
assert_eq!(m, 0x48091e6a2c48091e6a2c48091e6a2c48);
assert_eq!(0, 0u128.reverse_bits());
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#873-880)1.0.0 (const: 1.32.0) · #### pub const fn from\_be(x: u128) -> u128
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:
```
let n = 0x1Au128;
if cfg!(target_endian = "big") {
assert_eq!(u128::from_be(n), n)
} else {
assert_eq!(u128::from_be(n), n.swap_bytes())
}
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#873-880)1.0.0 (const: 1.32.0) · #### pub const fn from\_le(x: u128) -> u128
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:
```
let n = 0x1Au128;
if cfg!(target_endian = "little") {
assert_eq!(u128::from_le(n), n)
} else {
assert_eq!(u128::from_le(n), n.swap_bytes())
}
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#873-880)1.0.0 (const: 1.32.0) · #### pub const fn to\_be(self) -> u128
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:
```
let n = 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/mod.rs.html#873-880)1.0.0 (const: 1.32.0) · #### pub const fn to\_le(self) -> u128
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:
```
let n = 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/mod.rs.html#873-880)1.0.0 (const: 1.47.0) · #### pub const fn checked\_add(self, rhs: u128) -> Option<u128>
Checked integer addition. Computes `self + rhs`, returning `None` if overflow occurred.
##### Examples
Basic usage:
```
assert_eq!((u128::MAX - 2).checked_add(1), Some(u128::MAX - 1));
assert_eq!((u128::MAX - 2).checked_add(3), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#873-880)const: [unstable](https://github.com/rust-lang/rust/issues/85122 "Tracking issue for const_inherent_unchecked_arith") · #### pub unsafe fn unchecked\_add(self, rhs: u128) -> u128
🔬This is a nightly-only experimental API. (`unchecked_math` [#85122](https://github.com/rust-lang/rust/issues/85122))
Unchecked integer addition. Computes `self + rhs`, assuming overflow cannot occur.
##### Safety
This results in undefined behavior when `self + rhs > u128::MAX` or `self + rhs < u128::MIN`, i.e. when [`checked_add`](primitive.u128#method.checked_add) would return `None`.
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#873-880)const: [unstable](https://github.com/rust-lang/rust/issues/87840 "Tracking issue for mixed_integer_ops") · #### pub fn checked\_add\_signed(self, rhs: i128) -> Option<u128>
🔬This is a nightly-only experimental API. (`mixed_integer_ops` [#87840](https://github.com/rust-lang/rust/issues/87840))
Checked addition with a signed integer. Computes `self + rhs`, returning `None` if overflow occurred.
##### Examples
Basic usage:
```
assert_eq!(1u128.checked_add_signed(2), Some(3));
assert_eq!(1u128.checked_add_signed(-2), None);
assert_eq!((u128::MAX - 2).checked_add_signed(3), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#873-880)1.0.0 (const: 1.47.0) · #### pub const fn checked\_sub(self, rhs: u128) -> Option<u128>
Checked integer subtraction. Computes `self - rhs`, returning `None` if overflow occurred.
##### Examples
Basic usage:
```
assert_eq!(1u128.checked_sub(1), Some(0));
assert_eq!(0u128.checked_sub(1), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#873-880)const: [unstable](https://github.com/rust-lang/rust/issues/85122 "Tracking issue for const_inherent_unchecked_arith") · #### pub unsafe fn unchecked\_sub(self, rhs: u128) -> u128
🔬This is a nightly-only experimental API. (`unchecked_math` [#85122](https://github.com/rust-lang/rust/issues/85122))
Unchecked integer subtraction. Computes `self - rhs`, assuming overflow cannot occur.
##### Safety
This results in undefined behavior when `self - rhs > u128::MAX` or `self - rhs < u128::MIN`, i.e. when [`checked_sub`](primitive.u128#method.checked_sub) would return `None`.
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#873-880)1.0.0 (const: 1.47.0) · #### pub const fn checked\_mul(self, rhs: u128) -> Option<u128>
Checked integer multiplication. Computes `self * rhs`, returning `None` if overflow occurred.
##### Examples
Basic usage:
```
assert_eq!(5u128.checked_mul(1), Some(5));
assert_eq!(u128::MAX.checked_mul(2), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#873-880)const: [unstable](https://github.com/rust-lang/rust/issues/85122 "Tracking issue for const_inherent_unchecked_arith") · #### pub unsafe fn unchecked\_mul(self, rhs: u128) -> u128
🔬This is a nightly-only experimental API. (`unchecked_math` [#85122](https://github.com/rust-lang/rust/issues/85122))
Unchecked integer multiplication. Computes `self * rhs`, assuming overflow cannot occur.
##### Safety
This results in undefined behavior when `self * rhs > u128::MAX` or `self * rhs < u128::MIN`, i.e. when [`checked_mul`](primitive.u128#method.checked_mul) would return `None`.
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#873-880)1.0.0 (const: 1.52.0) · #### pub const fn checked\_div(self, rhs: u128) -> Option<u128>
Checked integer division. Computes `self / rhs`, returning `None` if `rhs == 0`.
##### Examples
Basic usage:
```
assert_eq!(128u128.checked_div(2), Some(64));
assert_eq!(1u128.checked_div(0), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#873-880)1.38.0 (const: 1.52.0) · #### pub const fn checked\_div\_euclid(self, rhs: u128) -> Option<u128>
Checked Euclidean division. Computes `self.div_euclid(rhs)`, returning `None` if `rhs == 0`.
##### Examples
Basic usage:
```
assert_eq!(128u128.checked_div_euclid(2), Some(64));
assert_eq!(1u128.checked_div_euclid(0), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#873-880)1.7.0 (const: 1.52.0) · #### pub const fn checked\_rem(self, rhs: u128) -> Option<u128>
Checked integer remainder. Computes `self % rhs`, returning `None` if `rhs == 0`.
##### Examples
Basic usage:
```
assert_eq!(5u128.checked_rem(2), Some(1));
assert_eq!(5u128.checked_rem(0), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#873-880)1.38.0 (const: 1.52.0) · #### pub const fn checked\_rem\_euclid(self, rhs: u128) -> Option<u128>
Checked Euclidean modulo. Computes `self.rem_euclid(rhs)`, returning `None` if `rhs == 0`.
##### Examples
Basic usage:
```
assert_eq!(5u128.checked_rem_euclid(2), Some(1));
assert_eq!(5u128.checked_rem_euclid(0), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#873-880)#### pub const fn ilog(self, base: u128) -> u32
🔬This is a nightly-only experimental API. (`int_log` [#70887](https://github.com/rust-lang/rust/issues/70887))
Returns the logarithm of the number with respect to an arbitrary base, rounded down.
This method might not be optimized owing to implementation details; `ilog2` can produce results more efficiently for base 2, and `ilog10` can produce results more efficiently for base 10.
##### Panics
When the number is zero, or if the base is not at least 2; it panics in debug mode and the return value is 0 in release mode.
##### Examples
```
#![feature(int_log)]
assert_eq!(5u128.ilog(5), 1);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#873-880)#### 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.
##### Panics
When the number is zero it panics in debug mode and the return value is 0 in release mode.
##### Examples
```
#![feature(int_log)]
assert_eq!(2u128.ilog2(), 1);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#873-880)#### 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.
##### Panics
When the number is zero it panics in debug mode and the return value is 0 in release mode.
##### Example
```
#![feature(int_log)]
assert_eq!(10u128.ilog10(), 1);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#873-880)#### pub const fn checked\_ilog(self, base: u128) -> Option<u32>
🔬This is a nightly-only experimental API. (`int_log` [#70887](https://github.com/rust-lang/rust/issues/70887))
Returns the logarithm of the number with respect to an arbitrary base, rounded down.
Returns `None` if the number is zero, or if the base is not at least 2.
This method might not be optimized owing to implementation details; `checked_ilog2` can produce results more efficiently for base 2, and `checked_ilog10` can produce results more efficiently for base 10.
##### Examples
```
#![feature(int_log)]
assert_eq!(5u128.checked_ilog(5), Some(1));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#873-880)#### pub const fn checked\_ilog2(self) -> Option<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.
Returns `None` if the number is zero.
##### Examples
```
#![feature(int_log)]
assert_eq!(2u128.checked_ilog2(), Some(1));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#873-880)#### pub const fn checked\_ilog10(self) -> Option<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.
Returns `None` if the number is zero.
##### Examples
```
#![feature(int_log)]
assert_eq!(10u128.checked_ilog10(), Some(1));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#873-880)1.7.0 (const: 1.47.0) · #### pub const fn checked\_neg(self) -> Option<u128>
Checked negation. Computes `-self`, returning `None` unless `self == 0`.
Note that negating any positive integer will overflow.
##### Examples
Basic usage:
```
assert_eq!(0u128.checked_neg(), Some(0));
assert_eq!(1u128.checked_neg(), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#873-880)1.7.0 (const: 1.47.0) · #### pub const fn checked\_shl(self, rhs: u32) -> Option<u128>
Checked shift left. Computes `self << rhs`, returning `None` if `rhs` is larger than or equal to the number of bits in `self`.
##### Examples
Basic usage:
```
assert_eq!(0x1u128.checked_shl(4), Some(0x10));
assert_eq!(0x10u128.checked_shl(129), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#873-880)const: [unstable](https://github.com/rust-lang/rust/issues/85122 "Tracking issue for const_inherent_unchecked_arith") · #### pub unsafe fn unchecked\_shl(self, rhs: u128) -> u128
🔬This is a nightly-only experimental API. (`unchecked_math` [#85122](https://github.com/rust-lang/rust/issues/85122))
Unchecked shift left. Computes `self << rhs`, assuming that `rhs` is less than the number of bits in `self`.
##### Safety
This results in undefined behavior if `rhs` is larger than or equal to the number of bits in `self`, i.e. when [`checked_shl`](primitive.u128#method.checked_shl) would return `None`.
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#873-880)1.7.0 (const: 1.47.0) · #### pub const fn checked\_shr(self, rhs: u32) -> Option<u128>
Checked shift right. Computes `self >> rhs`, returning `None` if `rhs` is larger than or equal to the number of bits in `self`.
##### Examples
Basic usage:
```
assert_eq!(0x10u128.checked_shr(4), Some(0x1));
assert_eq!(0x10u128.checked_shr(129), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#873-880)const: [unstable](https://github.com/rust-lang/rust/issues/85122 "Tracking issue for const_inherent_unchecked_arith") · #### pub unsafe fn unchecked\_shr(self, rhs: u128) -> u128
🔬This is a nightly-only experimental API. (`unchecked_math` [#85122](https://github.com/rust-lang/rust/issues/85122))
Unchecked shift right. Computes `self >> rhs`, assuming that `rhs` is less than the number of bits in `self`.
##### Safety
This results in undefined behavior if `rhs` is larger than or equal to the number of bits in `self`, i.e. when [`checked_shr`](primitive.u128#method.checked_shr) would return `None`.
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#873-880)1.34.0 (const: 1.50.0) · #### pub const fn checked\_pow(self, exp: u32) -> Option<u128>
Checked exponentiation. Computes `self.pow(exp)`, returning `None` if overflow occurred.
##### Examples
Basic usage:
```
assert_eq!(2u128.checked_pow(5), Some(32));
assert_eq!(u128::MAX.checked_pow(2), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#873-880)1.0.0 (const: 1.47.0) · #### pub const fn saturating\_add(self, rhs: u128) -> u128
Saturating integer addition. Computes `self + rhs`, saturating at the numeric bounds instead of overflowing.
##### Examples
Basic usage:
```
assert_eq!(100u128.saturating_add(1), 101);
assert_eq!(u128::MAX.saturating_add(127), u128::MAX);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#873-880)const: [unstable](https://github.com/rust-lang/rust/issues/87840 "Tracking issue for mixed_integer_ops") · #### pub fn saturating\_add\_signed(self, rhs: i128) -> u128
🔬This is a nightly-only experimental API. (`mixed_integer_ops` [#87840](https://github.com/rust-lang/rust/issues/87840))
Saturating addition with a signed integer. Computes `self + rhs`, saturating at the numeric bounds instead of overflowing.
##### Examples
Basic usage:
```
assert_eq!(1u128.saturating_add_signed(2), 3);
assert_eq!(1u128.saturating_add_signed(-2), 0);
assert_eq!((u128::MAX - 2).saturating_add_signed(4), u128::MAX);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#873-880)1.0.0 (const: 1.47.0) · #### pub const fn saturating\_sub(self, rhs: u128) -> u128
Saturating integer subtraction. Computes `self - rhs`, saturating at the numeric bounds instead of overflowing.
##### Examples
Basic usage:
```
assert_eq!(100u128.saturating_sub(27), 73);
assert_eq!(13u128.saturating_sub(127), 0);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#873-880)1.7.0 (const: 1.47.0) · #### pub const fn saturating\_mul(self, rhs: u128) -> u128
Saturating integer multiplication. Computes `self * rhs`, saturating at the numeric bounds instead of overflowing.
##### Examples
Basic usage:
```
assert_eq!(2u128.saturating_mul(10), 20);
assert_eq!((u128::MAX).saturating_mul(10), u128::MAX);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#873-880)1.58.0 (const: 1.58.0) · #### pub const fn saturating\_div(self, rhs: u128) -> u128
Saturating integer division. Computes `self / rhs`, saturating at the numeric bounds instead of overflowing.
##### Examples
Basic usage:
```
assert_eq!(5u128.saturating_div(2), 2);
```
ⓘ
```
let _ = 1u128.saturating_div(0);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#873-880)1.34.0 (const: 1.50.0) · #### pub const fn saturating\_pow(self, exp: u32) -> u128
Saturating integer exponentiation. Computes `self.pow(exp)`, saturating at the numeric bounds instead of overflowing.
##### Examples
Basic usage:
```
assert_eq!(4u128.saturating_pow(3), 64);
assert_eq!(u128::MAX.saturating_pow(2), u128::MAX);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#873-880)1.0.0 (const: 1.32.0) · #### pub const fn wrapping\_add(self, rhs: u128) -> u128
Wrapping (modular) addition. Computes `self + rhs`, wrapping around at the boundary of the type.
##### Examples
Basic usage:
```
assert_eq!(200u128.wrapping_add(55), 255);
assert_eq!(200u128.wrapping_add(u128::MAX), 199);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#873-880)const: [unstable](https://github.com/rust-lang/rust/issues/87840 "Tracking issue for mixed_integer_ops") · #### pub fn wrapping\_add\_signed(self, rhs: i128) -> u128
🔬This is a nightly-only experimental API. (`mixed_integer_ops` [#87840](https://github.com/rust-lang/rust/issues/87840))
Wrapping (modular) addition with a signed integer. Computes `self + rhs`, wrapping around at the boundary of the type.
##### Examples
Basic usage:
```
assert_eq!(1u128.wrapping_add_signed(2), 3);
assert_eq!(1u128.wrapping_add_signed(-2), u128::MAX);
assert_eq!((u128::MAX - 2).wrapping_add_signed(4), 1);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#873-880)1.0.0 (const: 1.32.0) · #### pub const fn wrapping\_sub(self, rhs: u128) -> u128
Wrapping (modular) subtraction. Computes `self - rhs`, wrapping around at the boundary of the type.
##### Examples
Basic usage:
```
assert_eq!(100u128.wrapping_sub(100), 0);
assert_eq!(100u128.wrapping_sub(u128::MAX), 101);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#873-880)1.0.0 (const: 1.32.0) · #### pub const fn wrapping\_mul(self, rhs: u128) -> u128
Wrapping (modular) multiplication. Computes `self * rhs`, wrapping around at the boundary of the type.
##### Examples
Basic usage:
Please note that this example is shared between integer types. Which explains why `u8` is used here.
```
assert_eq!(10u8.wrapping_mul(12), 120);
assert_eq!(25u8.wrapping_mul(12), 44);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#873-880)1.2.0 (const: 1.52.0) · #### pub const fn wrapping\_div(self, rhs: u128) -> u128
Wrapping (modular) division. Computes `self / rhs`. Wrapped division on unsigned types is just normal division. There’s no way wrapping could ever happen. This function exists, so that all operations are accounted for in the wrapping operations.
##### Examples
Basic usage:
```
assert_eq!(100u128.wrapping_div(10), 10);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#873-880)1.38.0 (const: 1.52.0) · #### pub const fn wrapping\_div\_euclid(self, rhs: u128) -> u128
Wrapping Euclidean division. Computes `self.div_euclid(rhs)`. Wrapped division on unsigned types is just normal division. There’s no way wrapping could ever happen. This function exists, so that all operations are accounted for in the wrapping operations. Since, for the positive integers, all common definitions of division are equal, this is exactly equal to `self.wrapping_div(rhs)`.
##### Examples
Basic usage:
```
assert_eq!(100u128.wrapping_div_euclid(10), 10);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#873-880)1.2.0 (const: 1.52.0) · #### pub const fn wrapping\_rem(self, rhs: u128) -> u128
Wrapping (modular) remainder. Computes `self % rhs`. Wrapped remainder calculation on unsigned types is just the regular remainder calculation. There’s no way wrapping could ever happen. This function exists, so that all operations are accounted for in the wrapping operations.
##### Examples
Basic usage:
```
assert_eq!(100u128.wrapping_rem(10), 0);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#873-880)1.38.0 (const: 1.52.0) · #### pub const fn wrapping\_rem\_euclid(self, rhs: u128) -> u128
Wrapping Euclidean modulo. Computes `self.rem_euclid(rhs)`. Wrapped modulo calculation on unsigned types is just the regular remainder calculation. There’s no way wrapping could ever happen. This function exists, so that all operations are accounted for in the wrapping operations. Since, for the positive integers, all common definitions of division are equal, this is exactly equal to `self.wrapping_rem(rhs)`.
##### Examples
Basic usage:
```
assert_eq!(100u128.wrapping_rem_euclid(10), 0);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#873-880)1.2.0 (const: 1.32.0) · #### pub const fn wrapping\_neg(self) -> u128
Wrapping (modular) negation. Computes `-self`, wrapping around at the boundary of the type.
Since unsigned types do not have negative equivalents all applications of this function will wrap (except for `-0`). For values smaller than the corresponding signed type’s maximum the result is the same as casting the corresponding signed value. Any larger values are equivalent to `MAX + 1 - (val - MAX - 1)` where `MAX` is the corresponding signed type’s maximum.
##### Examples
Basic usage:
Please note that this example is shared between integer types. Which explains why `i8` is used here.
```
assert_eq!(100i8.wrapping_neg(), -100);
assert_eq!((-128i8).wrapping_neg(), -128);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#873-880)1.2.0 (const: 1.32.0) · #### pub const fn wrapping\_shl(self, rhs: u32) -> u128
Panic-free bitwise shift-left; yields `self << mask(rhs)`, where `mask` removes any high-order bits of `rhs` that would cause the shift to exceed the bitwidth of the type.
Note that this is *not* the same as a rotate-left; the RHS of a wrapping shift-left is restricted to the range of the type, rather than the bits shifted out of the LHS being returned to the other end. The primitive integer types all implement a [`rotate_left`](primitive.u128#method.rotate_left) function, which may be what you want instead.
##### Examples
Basic usage:
```
assert_eq!(1u128.wrapping_shl(7), 128);
assert_eq!(1u128.wrapping_shl(128), 1);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#873-880)1.2.0 (const: 1.32.0) · #### pub const fn wrapping\_shr(self, rhs: u32) -> u128
Panic-free bitwise shift-right; yields `self >> mask(rhs)`, where `mask` removes any high-order bits of `rhs` that would cause the shift to exceed the bitwidth of the type.
Note that this is *not* the same as a rotate-right; the RHS of a wrapping shift-right is restricted to the range of the type, rather than the bits shifted out of the LHS being returned to the other end. The primitive integer types all implement a [`rotate_right`](primitive.u128#method.rotate_right) function, which may be what you want instead.
##### Examples
Basic usage:
```
assert_eq!(128u128.wrapping_shr(7), 1);
assert_eq!(128u128.wrapping_shr(128), 128);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#873-880)1.34.0 (const: 1.50.0) · #### pub const fn wrapping\_pow(self, exp: u32) -> u128
Wrapping (modular) exponentiation. Computes `self.pow(exp)`, wrapping around at the boundary of the type.
##### Examples
Basic usage:
```
assert_eq!(3u128.wrapping_pow(5), 243);
assert_eq!(3u8.wrapping_pow(6), 217);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#873-880)1.7.0 (const: 1.32.0) · #### pub const fn overflowing\_add(self, rhs: u128) -> (u128, bool)
Calculates `self` + `rhs`
Returns a tuple of the addition along with a boolean indicating whether an arithmetic overflow would occur. If an overflow would have occurred then the wrapped value is returned.
##### Examples
Basic usage
```
assert_eq!(5u128.overflowing_add(2), (7, false));
assert_eq!(u128::MAX.overflowing_add(1), (0, true));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#873-880)const: [unstable](https://github.com/rust-lang/rust/issues/85532 "Tracking issue for const_bigint_helper_methods") · #### pub fn carrying\_add(self, rhs: u128, carry: bool) -> (u128, bool)
🔬This is a nightly-only experimental API. (`bigint_helper_methods` [#85532](https://github.com/rust-lang/rust/issues/85532))
Calculates `self + rhs + carry` without the ability to overflow.
Performs “ternary addition” which takes in an extra bit to add, and may return an additional bit of overflow. This allows for chaining together multiple additions to create “big integers” which represent larger values.
This can be thought of as a 128-bit “full adder”, in the electronics sense.
##### Examples
Basic usage
```
#![feature(bigint_helper_methods)]
assert_eq!(5u128.carrying_add(2, false), (7, false));
assert_eq!(5u128.carrying_add(2, true), (8, false));
assert_eq!(u128::MAX.carrying_add(1, false), (0, true));
assert_eq!(u128::MAX.carrying_add(0, true), (0, true));
assert_eq!(u128::MAX.carrying_add(1, true), (1, true));
assert_eq!(u128::MAX.carrying_add(u128::MAX, true), (u128::MAX, true));
```
If `carry` is false, this method is equivalent to [`overflowing_add`](primitive.u128#method.overflowing_add):
```
#![feature(bigint_helper_methods)]
assert_eq!(5_u128.carrying_add(2, false), 5_u128.overflowing_add(2));
assert_eq!(u128::MAX.carrying_add(1, false), u128::MAX.overflowing_add(1));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#873-880)const: [unstable](https://github.com/rust-lang/rust/issues/87840 "Tracking issue for mixed_integer_ops") · #### pub fn overflowing\_add\_signed(self, rhs: i128) -> (u128, bool)
🔬This is a nightly-only experimental API. (`mixed_integer_ops` [#87840](https://github.com/rust-lang/rust/issues/87840))
Calculates `self` + `rhs` with a signed `rhs`
Returns a tuple of the addition along with a boolean indicating whether an arithmetic overflow would occur. If an overflow would have occurred then the wrapped value is returned.
##### Examples
Basic usage:
```
assert_eq!(1u128.overflowing_add_signed(2), (3, false));
assert_eq!(1u128.overflowing_add_signed(-2), (u128::MAX, true));
assert_eq!((u128::MAX - 2).overflowing_add_signed(4), (1, true));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#873-880)1.7.0 (const: 1.32.0) · #### pub const fn overflowing\_sub(self, rhs: u128) -> (u128, bool)
Calculates `self` - `rhs`
Returns a tuple of the subtraction along with a boolean indicating whether an arithmetic overflow would occur. If an overflow would have occurred then the wrapped value is returned.
##### Examples
Basic usage
```
assert_eq!(5u128.overflowing_sub(2), (3, false));
assert_eq!(0u128.overflowing_sub(1), (u128::MAX, true));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#873-880)const: [unstable](https://github.com/rust-lang/rust/issues/85532 "Tracking issue for const_bigint_helper_methods") · #### pub fn borrowing\_sub(self, rhs: u128, borrow: bool) -> (u128, bool)
🔬This is a nightly-only experimental API. (`bigint_helper_methods` [#85532](https://github.com/rust-lang/rust/issues/85532))
Calculates `self - rhs - borrow` without the ability to overflow.
Performs “ternary subtraction” which takes in an extra bit to subtract, and may return an additional bit of overflow. This allows for chaining together multiple subtractions to create “big integers” which represent larger values.
##### Examples
Basic usage
```
#![feature(bigint_helper_methods)]
assert_eq!(5u128.borrowing_sub(2, false), (3, false));
assert_eq!(5u128.borrowing_sub(2, true), (2, false));
assert_eq!(0u128.borrowing_sub(1, false), (u128::MAX, true));
assert_eq!(0u128.borrowing_sub(1, true), (u128::MAX - 1, true));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#873-880)1.60.0 (const: 1.60.0) · #### pub const fn abs\_diff(self, other: u128) -> u128
Computes the absolute difference between `self` and `other`.
##### Examples
Basic usage:
```
assert_eq!(100u128.abs_diff(80), 20u128);
assert_eq!(100u128.abs_diff(110), 10u128);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#873-880)1.7.0 (const: 1.32.0) · #### pub const fn overflowing\_mul(self, rhs: u128) -> (u128, bool)
Calculates the multiplication of `self` and `rhs`.
Returns a tuple of the multiplication along with a boolean indicating whether an arithmetic overflow would occur. If an overflow would have occurred then the wrapped value is returned.
##### Examples
Basic usage:
Please note that this example is shared between integer types. Which explains why `u32` is used here.
```
assert_eq!(5u32.overflowing_mul(2), (10, false));
assert_eq!(1_000_000_000u32.overflowing_mul(10), (1410065408, true));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#873-880)1.7.0 (const: 1.52.0) · #### pub const fn overflowing\_div(self, rhs: u128) -> (u128, bool)
Calculates the divisor when `self` is divided by `rhs`.
Returns a tuple of the divisor along with a boolean indicating whether an arithmetic overflow would occur. Note that for unsigned integers overflow never occurs, so the second value is always `false`.
##### Panics
This function will panic if `rhs` is 0.
##### Examples
Basic usage
```
assert_eq!(5u128.overflowing_div(2), (2, false));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#873-880)1.38.0 (const: 1.52.0) · #### pub const fn overflowing\_div\_euclid(self, rhs: u128) -> (u128, bool)
Calculates the quotient of Euclidean division `self.div_euclid(rhs)`.
Returns a tuple of the divisor along with a boolean indicating whether an arithmetic overflow would occur. Note that for unsigned integers overflow never occurs, so the second value is always `false`. Since, for the positive integers, all common definitions of division are equal, this is exactly equal to `self.overflowing_div(rhs)`.
##### Panics
This function will panic if `rhs` is 0.
##### Examples
Basic usage
```
assert_eq!(5u128.overflowing_div_euclid(2), (2, false));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#873-880)1.7.0 (const: 1.52.0) · #### pub const fn overflowing\_rem(self, rhs: u128) -> (u128, bool)
Calculates the remainder when `self` is divided by `rhs`.
Returns a tuple of the remainder after dividing along with a boolean indicating whether an arithmetic overflow would occur. Note that for unsigned integers overflow never occurs, so the second value is always `false`.
##### Panics
This function will panic if `rhs` is 0.
##### Examples
Basic usage
```
assert_eq!(5u128.overflowing_rem(2), (1, false));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#873-880)1.38.0 (const: 1.52.0) · #### pub const fn overflowing\_rem\_euclid(self, rhs: u128) -> (u128, bool)
Calculates the remainder `self.rem_euclid(rhs)` as if by Euclidean division.
Returns a tuple of the modulo after dividing along with a boolean indicating whether an arithmetic overflow would occur. Note that for unsigned integers overflow never occurs, so the second value is always `false`. Since, for the positive integers, all common definitions of division are equal, this operation is exactly equal to `self.overflowing_rem(rhs)`.
##### Panics
This function will panic if `rhs` is 0.
##### Examples
Basic usage
```
assert_eq!(5u128.overflowing_rem_euclid(2), (1, false));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#873-880)1.7.0 (const: 1.32.0) · #### pub const fn overflowing\_neg(self) -> (u128, bool)
Negates self in an overflowing fashion.
Returns `!self + 1` using wrapping operations to return the value that represents the negation of this unsigned value. Note that for positive unsigned values overflow always occurs, but negating 0 does not overflow.
##### Examples
Basic usage
```
assert_eq!(0u128.overflowing_neg(), (0, false));
assert_eq!(2u128.overflowing_neg(), (-2i32 as u128, true));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#873-880)1.7.0 (const: 1.32.0) · #### pub const fn overflowing\_shl(self, rhs: u32) -> (u128, bool)
Shifts self left by `rhs` bits.
Returns a tuple of the shifted version of self along with a boolean indicating whether the shift value was larger than or equal to the number of bits. If the shift value is too large, then value is masked (N-1) where N is the number of bits, and this value is then used to perform the shift.
##### Examples
Basic usage
```
assert_eq!(0x1u128.overflowing_shl(4), (0x10, false));
assert_eq!(0x1u128.overflowing_shl(132), (0x10, true));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#873-880)1.7.0 (const: 1.32.0) · #### pub const fn overflowing\_shr(self, rhs: u32) -> (u128, bool)
Shifts self right by `rhs` bits.
Returns a tuple of the shifted version of self along with a boolean indicating whether the shift value was larger than or equal to the number of bits. If the shift value is too large, then value is masked (N-1) where N is the number of bits, and this value is then used to perform the shift.
##### Examples
Basic usage
```
assert_eq!(0x10u128.overflowing_shr(4), (0x1, false));
assert_eq!(0x10u128.overflowing_shr(132), (0x1, true));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#873-880)1.34.0 (const: 1.50.0) · #### pub const fn overflowing\_pow(self, exp: u32) -> (u128, bool)
Raises self to the power of `exp`, using exponentiation by squaring.
Returns a tuple of the exponentiation along with a bool indicating whether an overflow happened.
##### Examples
Basic usage:
```
assert_eq!(3u128.overflowing_pow(5), (243, false));
assert_eq!(3u8.overflowing_pow(6), (217, true));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#873-880)1.0.0 (const: 1.50.0) · #### pub const fn pow(self, exp: u32) -> u128
Raises self to the power of `exp`, using exponentiation by squaring.
##### Examples
Basic usage:
```
assert_eq!(2u128.pow(5), 32);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#873-880)1.38.0 (const: 1.52.0) · #### pub const fn div\_euclid(self, rhs: u128) -> u128
Performs Euclidean division.
Since, for the positive integers, all common definitions of division are equal, this is exactly equal to `self / rhs`.
##### Panics
This function will panic if `rhs` is 0.
##### Examples
Basic usage:
```
assert_eq!(7u128.div_euclid(4), 1); // or any other integer type
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#873-880)1.38.0 (const: 1.52.0) · #### pub const fn rem\_euclid(self, rhs: u128) -> u128
Calculates the least remainder of `self (mod rhs)`.
Since, for the positive integers, all common definitions of division are equal, this is exactly equal to `self % rhs`.
##### Panics
This function will panic if `rhs` is 0.
##### Examples
Basic usage:
```
assert_eq!(7u128.rem_euclid(4), 3); // or any other integer type
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#873-880)#### pub const fn div\_floor(self, rhs: u128) -> u128
🔬This is a nightly-only experimental API. (`int_roundings` [#88581](https://github.com/rust-lang/rust/issues/88581))
Calculates the quotient of `self` and `rhs`, rounding the result towards negative infinity.
This is the same as performing `self / rhs` for all unsigned integers.
##### Panics
This function will panic if `rhs` is zero.
##### Examples
Basic usage:
```
#![feature(int_roundings)]
assert_eq!(7_u128.div_floor(4), 1);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#873-880)#### pub const fn div\_ceil(self, rhs: u128) -> u128
🔬This is a nightly-only experimental API. (`int_roundings` [#88581](https://github.com/rust-lang/rust/issues/88581))
Calculates the quotient of `self` and `rhs`, rounding the result towards positive infinity.
##### Panics
This function will panic if `rhs` is zero.
###### [Overflow behavior](#overflow-behavior)
On overflow, this function will panic if overflow checks are enabled (default in debug mode) and wrap if overflow checks are disabled (default in release mode).
##### Examples
Basic usage:
```
#![feature(int_roundings)]
assert_eq!(7_u128.div_ceil(4), 2);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#873-880)#### pub const fn next\_multiple\_of(self, rhs: u128) -> u128
🔬This is a nightly-only experimental API. (`int_roundings` [#88581](https://github.com/rust-lang/rust/issues/88581))
Calculates the smallest value greater than or equal to `self` that is a multiple of `rhs`.
##### Panics
This function will panic if `rhs` is zero.
###### [Overflow behavior](#overflow-behavior-1)
On overflow, this function will panic if overflow checks are enabled (default in debug mode) and wrap if overflow checks are disabled (default in release mode).
##### Examples
Basic usage:
```
#![feature(int_roundings)]
assert_eq!(16_u128.next_multiple_of(8), 16);
assert_eq!(23_u128.next_multiple_of(8), 24);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#873-880)#### pub const fn checked\_next\_multiple\_of(self, rhs: u128) -> Option<u128>
🔬This is a nightly-only experimental API. (`int_roundings` [#88581](https://github.com/rust-lang/rust/issues/88581))
Calculates the smallest value greater than or equal to `self` that is a multiple of `rhs`. Returns `None` if `rhs` is zero or the operation would result in overflow.
##### Examples
Basic usage:
```
#![feature(int_roundings)]
assert_eq!(16_u128.checked_next_multiple_of(8), Some(16));
assert_eq!(23_u128.checked_next_multiple_of(8), Some(24));
assert_eq!(1_u128.checked_next_multiple_of(0), None);
assert_eq!(u128::MAX.checked_next_multiple_of(2), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#873-880)1.0.0 (const: 1.32.0) · #### pub const fn is\_power\_of\_two(self) -> bool
Returns `true` if and only if `self == 2^k` for some `k`.
##### Examples
Basic usage:
```
assert!(16u128.is_power_of_two());
assert!(!10u128.is_power_of_two());
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#873-880)1.0.0 (const: 1.50.0) · #### pub const fn next\_power\_of\_two(self) -> u128
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`), it panics in debug mode and the return value is wrapped to 0 in release mode (the only situation in which method can return 0).
##### Examples
Basic usage:
```
assert_eq!(2u128.next_power_of_two(), 2);
assert_eq!(3u128.next_power_of_two(), 4);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#873-880)1.0.0 (const: 1.50.0) · #### pub const fn checked\_next\_power\_of\_two(self) -> Option<u128>
Returns the smallest power of two greater than or equal to `n`. If the next power of two is greater than the type’s maximum value, `None` is returned, otherwise the power of two is wrapped in `Some`.
##### Examples
Basic usage:
```
assert_eq!(2u128.checked_next_power_of_two(), Some(2));
assert_eq!(3u128.checked_next_power_of_two(), Some(4));
assert_eq!(u128::MAX.checked_next_power_of_two(), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#873-880)const: [unstable](https://github.com/rust-lang/rust/issues/32463 "Tracking issue for wrapping_next_power_of_two") · #### pub fn wrapping\_next\_power\_of\_two(self) -> 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 `n`. If the next power of two is greater than the type’s maximum value, the return value is wrapped to `0`.
##### Examples
Basic usage:
```
#![feature(wrapping_next_power_of_two)]
assert_eq!(2u128.wrapping_next_power_of_two(), 2);
assert_eq!(3u128.wrapping_next_power_of_two(), 4);
assert_eq!(u128::MAX.wrapping_next_power_of_two(), 0);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#873-880)1.32.0 (const: 1.44.0) · #### pub const fn to\_be\_bytes(self) -> [u8; 16]
Return the memory representation of this integer as a byte array in big-endian (network) byte order.
##### Examples
```
let bytes = 0x12345678901234567890123456789012u128.to_be_bytes();
assert_eq!(bytes, [0x12, 0x34, 0x56, 0x78, 0x90, 0x12, 0x34, 0x56, 0x78, 0x90, 0x12, 0x34, 0x56, 0x78, 0x90, 0x12]);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#873-880)1.32.0 (const: 1.44.0) · #### pub const fn to\_le\_bytes(self) -> [u8; 16]
Return the memory representation of this integer as a byte array in little-endian byte order.
##### Examples
```
let bytes = 0x12345678901234567890123456789012u128.to_le_bytes();
assert_eq!(bytes, [0x12, 0x90, 0x78, 0x56, 0x34, 0x12, 0x90, 0x78, 0x56, 0x34, 0x12, 0x90, 0x78, 0x56, 0x34, 0x12]);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#873-880)1.32.0 (const: 1.44.0) · #### pub const fn to\_ne\_bytes(self) -> [u8; 16]
Return the memory representation of this integer as a byte array in native byte order.
As the target platform’s native endianness is used, portable code should use [`to_be_bytes`](primitive.u128#method.to_be_bytes) or [`to_le_bytes`](primitive.u128#method.to_le_bytes), as appropriate, instead.
##### Examples
```
let bytes = 0x12345678901234567890123456789012u128.to_ne_bytes();
assert_eq!(
bytes,
if cfg!(target_endian = "big") {
[0x12, 0x34, 0x56, 0x78, 0x90, 0x12, 0x34, 0x56, 0x78, 0x90, 0x12, 0x34, 0x56, 0x78, 0x90, 0x12]
} else {
[0x12, 0x90, 0x78, 0x56, 0x34, 0x12, 0x90, 0x78, 0x56, 0x34, 0x12, 0x90, 0x78, 0x56, 0x34, 0x12]
}
);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#873-880)1.32.0 (const: 1.44.0) · #### pub const fn from\_be\_bytes(bytes: [u8; 16]) -> u128
Create a native endian integer value from its representation as a byte array in big endian.
##### Examples
```
let value = u128::from_be_bytes([0x12, 0x34, 0x56, 0x78, 0x90, 0x12, 0x34, 0x56, 0x78, 0x90, 0x12, 0x34, 0x56, 0x78, 0x90, 0x12]);
assert_eq!(value, 0x12345678901234567890123456789012);
```
When starting from a slice rather than an array, fallible conversion APIs can be used:
```
fn read_be_u128(input: &mut &[u8]) -> u128 {
let (int_bytes, rest) = input.split_at(std::mem::size_of::<u128>());
*input = rest;
u128::from_be_bytes(int_bytes.try_into().unwrap())
}
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#873-880)1.32.0 (const: 1.44.0) · #### pub const fn from\_le\_bytes(bytes: [u8; 16]) -> u128
Create a native endian integer value from its representation as a byte array in little endian.
##### Examples
```
let value = u128::from_le_bytes([0x12, 0x90, 0x78, 0x56, 0x34, 0x12, 0x90, 0x78, 0x56, 0x34, 0x12, 0x90, 0x78, 0x56, 0x34, 0x12]);
assert_eq!(value, 0x12345678901234567890123456789012);
```
When starting from a slice rather than an array, fallible conversion APIs can be used:
```
fn read_le_u128(input: &mut &[u8]) -> u128 {
let (int_bytes, rest) = input.split_at(std::mem::size_of::<u128>());
*input = rest;
u128::from_le_bytes(int_bytes.try_into().unwrap())
}
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#873-880)1.32.0 (const: 1.44.0) · #### pub const fn from\_ne\_bytes(bytes: [u8; 16]) -> u128
Create a native endian integer value from its memory representation as a byte array in native endianness.
As the target platform’s native endianness is used, portable code likely wants to use [`from_be_bytes`](primitive.u128#method.from_be_bytes) or [`from_le_bytes`](primitive.u128#method.from_le_bytes), as appropriate instead.
##### Examples
```
let value = u128::from_ne_bytes(if cfg!(target_endian = "big") {
[0x12, 0x34, 0x56, 0x78, 0x90, 0x12, 0x34, 0x56, 0x78, 0x90, 0x12, 0x34, 0x56, 0x78, 0x90, 0x12]
} else {
[0x12, 0x90, 0x78, 0x56, 0x34, 0x12, 0x90, 0x78, 0x56, 0x34, 0x12, 0x90, 0x78, 0x56, 0x34, 0x12]
});
assert_eq!(value, 0x12345678901234567890123456789012);
```
When starting from a slice rather than an array, fallible conversion APIs can be used:
```
fn read_ne_u128(input: &mut &[u8]) -> u128 {
let (int_bytes, rest) = input.split_at(std::mem::size_of::<u128>());
*input = rest;
u128::from_ne_bytes(int_bytes.try_into().unwrap())
}
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#873-880)1.0.0 (const: 1.32.0) · #### pub const fn min\_value() -> u128
👎Deprecating in a future Rust version: replaced by the `MIN` associated constant on this type
New code should prefer to use [`u128::MIN`](primitive.u128#associatedconstant.MIN "u128::MIN") instead.
Returns the smallest value that can be represented by this integer type.
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#873-880)1.0.0 (const: 1.32.0) · #### pub const fn max\_value() -> u128
👎Deprecating in a future Rust version: replaced by the `MAX` associated constant on this type
New code should prefer to use [`u128::MAX`](primitive.u128#associatedconstant.MAX "u128::MAX") instead.
Returns the largest value that can be represented by this integer type.
Trait Implementations
---------------------
[source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#133)1.0.0 (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
The resulting type after applying the `+` operator.
[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") · #### fn add(self, other: &u128) -> <u128 as Add<u128>>::Output
Performs the `+` operation. [Read more](ops/trait.add#tymethod.add)
[source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#133)1.0.0 (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
The resulting type after applying the `+` operator.
[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") · #### fn add(self, other: &u128) -> <u128 as Add<u128>>::Output
Performs the `+` operation. [Read more](ops/trait.add#tymethod.add)
[source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#133)1.0.0 (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
The resulting type after applying the `+` operator.
[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") · #### fn add(self, other: u128) -> <u128 as Add<u128>>::Output
Performs the `+` operation. [Read more](ops/trait.add#tymethod.add)
[source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#133)1.0.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Add<u128> for u128
#### type Output = u128
The resulting type after applying the `+` operator.
[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") · #### fn add(self, other: u128) -> u128
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<&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/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/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/ops/arith.rs.html#786)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/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/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/ops/arith.rs.html#786)1.8.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/ops/arith.rs.html#786)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/fmt/num.rs.html#179)1.0.0 · ### impl Binary for u128
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#179)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error>
Formats the value using the given formatter.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#181)1.0.0 (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
The resulting type after applying the `&` operator.
[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") · #### fn bitand(self, other: &u128) -> <u128 as BitAnd<u128>>::Output
Performs the `&` operation. [Read more](ops/trait.bitand#tymethod.bitand)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#181)1.0.0 (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
The resulting type after applying the `&` operator.
[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") · #### fn bitand(self, other: &u128) -> <u128 as BitAnd<u128>>::Output
Performs the `&` operation. [Read more](ops/trait.bitand#tymethod.bitand)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#181)1.0.0 (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
The resulting type after applying the `&` operator.
[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") · #### fn bitand(self, other: u128) -> <u128 as BitAnd<u128>>::Output
Performs the `&` operation. [Read more](ops/trait.bitand#tymethod.bitand)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#181)1.0.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitAnd<u128> for u128
#### type Output = u128
The resulting type after applying the `&` operator.
[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") · #### fn bitand(self, rhs: u128) -> u128
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<&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/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/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/ops/bit.rs.html#734)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/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/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/ops/bit.rs.html#734)1.8.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/ops/bit.rs.html#734)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/ops/bit.rs.html#282)1.0.0 (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
The resulting type after applying the `|` operator.
[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") · #### fn bitor(self, other: &u128) -> <u128 as BitOr<u128>>::Output
Performs the `|` operation. [Read more](ops/trait.bitor#tymethod.bitor)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#282)1.0.0 (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
The resulting type after applying the `|` operator.
[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") · #### fn bitor(self, other: &u128) -> <u128 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 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/ops/bit.rs.html#282)1.0.0 (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
The resulting type after applying the `|` operator.
[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") · #### fn bitor(self, other: u128) -> <u128 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 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/ops/bit.rs.html#282)1.0.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitOr<u128> for u128
#### type Output = u128
The resulting type after applying the `|` operator.
[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") · #### fn bitor(self, rhs: u128) -> u128
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<&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/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/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/ops/bit.rs.html#806)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/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/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/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/ops/bit.rs.html#806)1.8.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/ops/bit.rs.html#806)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/ops/bit.rs.html#383)1.0.0 (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
The resulting type after applying the `^` operator.
[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") · #### fn bitxor(self, other: &u128) -> <u128 as BitXor<u128>>::Output
Performs the `^` operation. [Read more](ops/trait.bitxor#tymethod.bitxor)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#383)1.0.0 (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
The resulting type after applying the `^` operator.
[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") · #### fn bitxor(self, other: &u128) -> <u128 as BitXor<u128>>::Output
Performs the `^` operation. [Read more](ops/trait.bitxor#tymethod.bitxor)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#383)1.0.0 (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
The resulting type after applying the `^` operator.
[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") · #### fn bitxor(self, other: u128) -> <u128 as BitXor<u128>>::Output
Performs the `^` operation. [Read more](ops/trait.bitxor#tymethod.bitxor)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#383)1.0.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl BitXor<u128> for u128
#### type Output = u128
The resulting type after applying the `^` operator.
[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") · #### fn bitxor(self, other: u128) -> u128
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<&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/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/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/ops/bit.rs.html#878)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/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/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/ops/bit.rs.html#878)1.8.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/ops/bit.rs.html#878)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/clone.rs.html#197-202)1.0.0 (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/core/clone.rs.html#197-202)const: [unstable](https://github.com/rust-lang/rust/issues/91805 "Tracking issue for const_clone") · #### fn clone(&self) -> u128
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/fmt/num.rs.html#197-200)1.0.0 · ### impl Debug for u128
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#197-200)#### 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/default.rs.html#212)1.0.0 (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#212)const: [unstable](https://github.com/rust-lang/rust/issues/87864 "Tracking issue for const_default_impls") · #### fn default() -> u128
Returns the default value of `0`
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#569)1.0.0 · ### impl Display for u128
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#570)#### 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/ops/arith.rs.html#507-510)1.0.0 (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
The resulting type after applying the `/` operator.
[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") · #### fn div(self, other: &u128) -> <u128 as Div<u128>>::Output
Performs the `/` operation. [Read more](ops/trait.div#tymethod.div)
[source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#507-510)1.0.0 (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
The resulting type after applying the `/` operator.
[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") · #### fn div(self, other: &u128) -> <u128 as Div<u128>>::Output
Performs the `/` operation. [Read more](ops/trait.div#tymethod.div)
[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/ops/arith.rs.html#507-510)1.0.0 (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
The resulting type after applying the `/` operator.
[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") · #### fn div(self, other: u128) -> <u128 as Div<u128>>::Output
Performs the `/` operation. [Read more](ops/trait.div#tymethod.div)
[source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#507-510)1.0.0 (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
The resulting type after applying the `/` operator.
[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") · #### fn div(self, other: u128) -> u128
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<&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/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/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/ops/arith.rs.html#968)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/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/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/ops/arith.rs.html#968)1.8.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/ops/arith.rs.html#968)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/std/net/ip_addr.rs.html#1938-1956)### impl From<Ipv6Addr> for u128
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#1953-1955)#### fn from(ip: Ipv6Addr) -> u128
Convert an `Ipv6Addr` into a host byte order `u128`.
##### Examples
```
use std::net::Ipv6Addr;
let addr = Ipv6Addr::new(
0x1020, 0x3040, 0x5060, 0x7080,
0x90A0, 0xB0C0, 0xD0E0, 0xF00D,
);
assert_eq!(0x102030405060708090A0B0C0D0E0F00D_u128, u128::from(addr));
```
[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#90)1.28.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<bool> for u128
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#90)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: bool) -> u128
Converts a `bool` to a `u128`. The resulting value is `0` for `false` and `1` for `true` values.
##### Examples
```
assert_eq!(u128::from(true), 1);
assert_eq!(u128::from(false), 0);
```
[source](https://doc.rust-lang.org/src/core/char/convert.rs.html#73)1.51.0 (const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert")) · ### impl From<char> for u128
[source](https://doc.rust-lang.org/src/core/char/convert.rs.html#86)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn from(c: char) -> u128
Converts a [`char`](primitive.char "char") into a [`u128`](primitive.u128 "u128").
##### Examples
```
use std::mem;
let c = '⚙';
let u = u128::from(c);
assert!(16 == mem::size_of_val(&u))
```
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#1958-1978)### impl From<u128> for Ipv6Addr
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#1975-1977)#### fn from(ip: u128) -> Ipv6Addr
Convert a host byte order `u128` into an `Ipv6Addr`.
##### Examples
```
use std::net::Ipv6Addr;
let addr = Ipv6Addr::from(0x102030405060708090A0B0C0D0E0F00D_u128);
assert_eq!(
Ipv6Addr::new(
0x1020, 0x3040, 0x5060, 0x7080,
0x90A0, 0xB0C0, 0xD0E0, 0xF00D,
),
addr);
```
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#107)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · ### impl From<u16> for u128
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#107)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: u16) -> u128
Converts `u16` to `u128` losslessly.
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#109)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · ### impl From<u32> for u128
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#109)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: u32) -> u128
Converts `u32` to `u128` losslessly.
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#110)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · ### impl From<u64> for u128
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#110)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: u64) -> u128
Converts `u64` to `u128` losslessly.
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#103)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · ### impl From<u8> for u128
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#103)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: u8) -> u128
Converts `u8` to `u128` losslessly.
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#1018)1.0.0 · ### impl FromStr for u128
#### type Err = ParseIntError
The associated error which can be returned from parsing.
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#1018)#### fn from\_str(src: &str) -> Result<u128, ParseIntError>
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/hash/mod.rs.html#829-842)1.0.0 · ### impl Hash for u128
[source](https://doc.rust-lang.org/src/core/hash/mod.rs.html#829-842)#### 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#829-842)#### fn hash\_slice<H>(data: &[u128], 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/fmt/num.rs.html#479)1.42.0 · ### impl LowerExp for u128
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#479)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error>
Formats the value using the given formatter.
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#179)1.0.0 · ### impl LowerHex for u128
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#179)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error>
Formats the value using the given formatter.
[source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#369)1.0.0 (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
The resulting type after applying the `*` operator.
[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") · #### fn mul(self, other: &u128) -> <u128 as Mul<u128>>::Output
Performs the `*` operation. [Read more](ops/trait.mul#tymethod.mul)
[source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#369)1.0.0 (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
The resulting type after applying the `*` operator.
[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") · #### fn mul(self, other: &u128) -> <u128 as Mul<u128>>::Output
Performs the `*` operation. [Read more](ops/trait.mul#tymethod.mul)
[source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#369)1.0.0 (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
The resulting type after applying the `*` operator.
[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") · #### fn mul(self, other: u128) -> <u128 as Mul<u128>>::Output
Performs the `*` operation. [Read more](ops/trait.mul#tymethod.mul)
[source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#369)1.0.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Mul<u128> for u128
#### type Output = u128
The resulting type after applying the `*` operator.
[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") · #### fn mul(self, other: u128) -> u128
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<&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/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/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/ops/arith.rs.html#911)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/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/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/ops/arith.rs.html#911)1.8.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/ops/arith.rs.html#911)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/ops/bit.rs.html#69)1.0.0 (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
The resulting type after applying the `!` operator.
[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") · #### fn not(self) -> <u128 as Not>::Output
Performs the unary `!` operation. [Read more](ops/trait.not#tymethod.not)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#69)1.0.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Not for u128
#### type Output = u128
The resulting type after applying the `!` operator.
[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") · #### fn not(self) -> u128
Performs the unary `!` operation. [Read more](ops/trait.not#tymethod.not)
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#179)1.0.0 · ### impl Octal for u128
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#179)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error>
Formats the value using the given formatter.
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1486)1.0.0 (const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp")) · ### impl Ord for u128
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1486)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · #### fn cmp(&self, other: &u128) -> 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/cmp.rs.html#1366-1368)1.0.0 (const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp")) · ### impl PartialEq<u128> for u128
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1366-1368)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · #### fn eq(&self, other: &u128) -> 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#1366-1368)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · #### fn ne(&self, other: &u128) -> 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/cmp.rs.html#1486)1.0.0 (const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp")) · ### impl PartialOrd<u128> for u128
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1486)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · #### fn partial\_cmp(&self, other: &u128) -> 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#1486)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · #### fn lt(&self, other: &u128) -> 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#1486)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · #### fn le(&self, other: &u128) -> 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#1486)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · #### fn ge(&self, other: &u128) -> 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/cmp.rs.html#1486)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · #### fn gt(&self, other: &u128) -> 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/iter/traits/accum.rs.html#141)1.12.0 · ### impl<'a> Product<&'a u128> for u128
[source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)#### fn product<I>(iter: I) -> u128where I: [Iterator](iter/trait.iterator "trait std::iter::Iterator")<Item = &'a [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.12.0 · ### impl Product<u128> for u128
[source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)#### fn product<I>(iter: I) -> u128where I: [Iterator](iter/trait.iterator "trait std::iter::Iterator")<Item = [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/ops/arith.rs.html#609-612)1.0.0 (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
The resulting type after applying the `%` operator.
[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") · #### fn rem(self, other: &u128) -> <u128 as Rem<u128>>::Output
Performs the `%` operation. [Read more](ops/trait.rem#tymethod.rem)
[source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#609-612)1.0.0 (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
The resulting type after applying the `%` operator.
[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") · #### fn rem(self, other: &u128) -> <u128 as Rem<u128>>::Output
Performs the `%` operation. [Read more](ops/trait.rem#tymethod.rem)
[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/ops/arith.rs.html#609-612)1.0.0 (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
The resulting type after applying the `%` operator.
[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") · #### fn rem(self, other: u128) -> <u128 as Rem<u128>>::Output
Performs the `%` operation. [Read more](ops/trait.rem#tymethod.rem)
[source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#609-612)1.0.0 (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
The resulting type after applying the `%` operator.
[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") · #### fn rem(self, other: u128) -> u128
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<&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/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/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/ops/arith.rs.html#1029)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/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/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/ops/arith.rs.html#1029)1.8.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/ops/arith.rs.html#1029)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/ops/bit.rs.html#502)1.0.0 (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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i128) -> <u128 as Shl<i128>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i128) -> <u128 as Shl<i128>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i16) -> <u128 as Shl<i16>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i16) -> <u128 as Shl<i16>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i32) -> <u128 as Shl<i32>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i32) -> <u128 as Shl<i32>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i64) -> <u128 as Shl<i64>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i64) -> <u128 as Shl<i64>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i8) -> <u128 as Shl<i8>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i8) -> <u128 as Shl<i8>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &isize) -> <u128 as Shl<isize>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &isize) -> <u128 as Shl<isize>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u128) -> <i128 as Shl<u128>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u128) -> <i16 as Shl<u128>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u128) -> <i32 as Shl<u128>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u128) -> <i64 as Shl<u128>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u128) -> <i8 as Shl<u128>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u128) -> <isize as Shl<u128>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u128) -> <u128 as Shl<u128>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u128) -> <u16 as Shl<u128>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u128) -> <u32 as Shl<u128>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u128) -> <u64 as Shl<u128>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u128) -> <u8 as Shl<u128>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u128) -> <usize as Shl<u128>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u128) -> <i128 as Shl<u128>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u128) -> <i16 as Shl<u128>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u128) -> <i32 as Shl<u128>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u128) -> <i64 as Shl<u128>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u128) -> <i8 as Shl<u128>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u128) -> <isize as Shl<u128>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u128) -> <u128 as Shl<u128>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u128) -> <u16 as Shl<u128>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u128) -> <u32 as Shl<u128>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u128) -> <u64 as Shl<u128>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u128) -> <u8 as Shl<u128>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u128) -> <usize as Shl<u128>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u16) -> <u128 as Shl<u16>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u16) -> <u128 as Shl<u16>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u32) -> <u128 as Shl<u32>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u32) -> <u128 as Shl<u32>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u64) -> <u128 as Shl<u64>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u64) -> <u128 as Shl<u64>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u8) -> <u128 as Shl<u8>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u8) -> <u128 as Shl<u8>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &usize) -> <u128 as Shl<usize>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &usize) -> <u128 as Shl<usize>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i128) -> <u128 as Shl<i128>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shl<i128> for u128
#### type Output = u128
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i128) -> u128
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i16) -> <u128 as Shl<i16>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shl<i16> for u128
#### type Output = u128
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i16) -> u128
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i32) -> <u128 as Shl<i32>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shl<i32> for u128
#### type Output = u128
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i32) -> u128
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i64) -> <u128 as Shl<i64>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shl<i64> for u128
#### type Output = u128
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i64) -> u128
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i8) -> <u128 as Shl<i8>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shl<i8> for u128
#### type Output = u128
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i8) -> u128
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: isize) -> <u128 as Shl<isize>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shl<isize> for u128
#### type Output = u128
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: isize) -> u128
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u128) -> <i128 as Shl<u128>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u128) -> <i16 as Shl<u128>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u128) -> <i32 as Shl<u128>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u128) -> <i64 as Shl<u128>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u128) -> <i8 as Shl<u128>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u128) -> <isize as Shl<u128>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u128) -> <u128 as Shl<u128>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u128) -> <u16 as Shl<u128>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u128) -> <u32 as Shl<u128>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u128) -> <u64 as Shl<u128>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u128) -> <u8 as Shl<u128>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u128) -> <usize as Shl<u128>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shl<u128> for i128
#### type Output = i128
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u128) -> i128
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shl<u128> for i16
#### type Output = i16
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u128) -> i16
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shl<u128> for i32
#### type Output = i32
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u128) -> i32
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shl<u128> for i64
#### type Output = i64
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u128) -> i64
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shl<u128> for i8
#### type Output = i8
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u128) -> i8
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shl<u128> for isize
#### type Output = isize
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u128) -> isize
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shl<u128> for u128
#### type Output = u128
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u128) -> u128
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shl<u128> for u16
#### type Output = u16
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u128) -> u16
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shl<u128> for u32
#### type Output = u32
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u128) -> u32
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shl<u128> for u64
#### type Output = u64
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u128) -> u64
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shl<u128> for u8
#### type Output = u8
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u128) -> u8
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shl<u128> for usize
#### type Output = usize
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u128) -> usize
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u16) -> <u128 as Shl<u16>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shl<u16> for u128
#### type Output = u128
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u16) -> u128
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u32) -> <u128 as Shl<u32>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shl<u32> for u128
#### type Output = u128
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u32) -> u128
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u64) -> <u128 as Shl<u64>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shl<u64> for u128
#### type Output = u128
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u64) -> u128
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u8) -> <u128 as Shl<u8>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shl<u8> for u128
#### type Output = u128
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u8) -> u128
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: usize) -> <u128 as Shl<usize>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)1.0.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shl<usize> for u128
#### type Output = u128
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: usize) -> u128
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &i128)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &i16)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &i32)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &i64)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &i8)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &isize)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &u128)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &u128)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &u128)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &u128)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &u128)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &u128)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &u128)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &u128)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &u128)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &u128)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &u128)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &u128)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &u16)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &u32)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &u64)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &u8)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)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/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: i128)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: i16)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: i32)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: i64)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: i8)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: isize)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: u128)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: u128)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: u128)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: u128)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: u128)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: u128)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: u128)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: u128)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: u128)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: u128)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: u128)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: u128)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: u16)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: u32)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: u64)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: u8)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)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/ops/bit.rs.html#621)1.0.0 (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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i128) -> <u128 as Shr<i128>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i128) -> <u128 as Shr<i128>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i16) -> <u128 as Shr<i16>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i16) -> <u128 as Shr<i16>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i32) -> <u128 as Shr<i32>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i32) -> <u128 as Shr<i32>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i64) -> <u128 as Shr<i64>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i64) -> <u128 as Shr<i64>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i8) -> <u128 as Shr<i8>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i8) -> <u128 as Shr<i8>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &isize) -> <u128 as Shr<isize>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &isize) -> <u128 as Shr<isize>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u128) -> <i128 as Shr<u128>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u128) -> <i16 as Shr<u128>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u128) -> <i32 as Shr<u128>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u128) -> <i64 as Shr<u128>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u128) -> <i8 as Shr<u128>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u128) -> <isize as Shr<u128>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u128) -> <u128 as Shr<u128>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u128) -> <u16 as Shr<u128>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u128) -> <u32 as Shr<u128>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u128) -> <u64 as Shr<u128>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u128) -> <u8 as Shr<u128>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u128) -> <usize as Shr<u128>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u128) -> <i128 as Shr<u128>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u128) -> <i16 as Shr<u128>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u128) -> <i32 as Shr<u128>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u128) -> <i64 as Shr<u128>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u128) -> <i8 as Shr<u128>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u128) -> <isize as Shr<u128>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u128) -> <u128 as Shr<u128>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u128) -> <u16 as Shr<u128>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u128) -> <u32 as Shr<u128>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u128) -> <u64 as Shr<u128>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u128) -> <u8 as Shr<u128>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u128) -> <usize as Shr<u128>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u16) -> <u128 as Shr<u16>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u16) -> <u128 as Shr<u16>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u32) -> <u128 as Shr<u32>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u32) -> <u128 as Shr<u32>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u64) -> <u128 as Shr<u64>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u64) -> <u128 as Shr<u64>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u8) -> <u128 as Shr<u8>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u8) -> <u128 as Shr<u8>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &usize) -> <u128 as Shr<usize>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &usize) -> <u128 as Shr<usize>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i128) -> <u128 as Shr<i128>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shr<i128> for u128
#### type Output = u128
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i128) -> u128
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i16) -> <u128 as Shr<i16>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shr<i16> for u128
#### type Output = u128
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i16) -> u128
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i32) -> <u128 as Shr<i32>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shr<i32> for u128
#### type Output = u128
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i32) -> u128
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i64) -> <u128 as Shr<i64>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shr<i64> for u128
#### type Output = u128
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i64) -> u128
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i8) -> <u128 as Shr<i8>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shr<i8> for u128
#### type Output = u128
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i8) -> u128
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: isize) -> <u128 as Shr<isize>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shr<isize> for u128
#### type Output = u128
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: isize) -> u128
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u128) -> <i128 as Shr<u128>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u128) -> <i16 as Shr<u128>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u128) -> <i32 as Shr<u128>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u128) -> <i64 as Shr<u128>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u128) -> <i8 as Shr<u128>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u128) -> <isize as Shr<u128>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u128) -> <u128 as Shr<u128>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u128) -> <u16 as Shr<u128>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u128) -> <u32 as Shr<u128>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u128) -> <u64 as Shr<u128>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u128) -> <u8 as Shr<u128>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u128) -> <usize as Shr<u128>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shr<u128> for i128
#### type Output = i128
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u128) -> i128
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shr<u128> for i16
#### type Output = i16
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u128) -> i16
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shr<u128> for i32
#### type Output = i32
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u128) -> i32
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shr<u128> for i64
#### type Output = i64
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u128) -> i64
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shr<u128> for i8
#### type Output = i8
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u128) -> i8
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shr<u128> for isize
#### type Output = isize
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u128) -> isize
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shr<u128> for u128
#### type Output = u128
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u128) -> u128
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shr<u128> for u16
#### type Output = u16
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u128) -> u16
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shr<u128> for u32
#### type Output = u32
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u128) -> u32
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shr<u128> for u64
#### type Output = u64
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u128) -> u64
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shr<u128> for u8
#### type Output = u8
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u128) -> u8
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shr<u128> for usize
#### type Output = usize
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u128) -> usize
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u16) -> <u128 as Shr<u16>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shr<u16> for u128
#### type Output = u128
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u16) -> u128
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u32) -> <u128 as Shr<u32>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shr<u32> for u128
#### type Output = u128
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u32) -> u128
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u64) -> <u128 as Shr<u64>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shr<u64> for u128
#### type Output = u128
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u64) -> u128
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u8) -> <u128 as Shr<u8>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shr<u8> for u128
#### type Output = u128
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u8) -> u128
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: usize) -> <u128 as Shr<usize>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)1.0.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Shr<usize> for u128
#### type Output = u128
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: usize) -> u128
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &i128)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &i16)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &i32)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &i64)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &i8)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &isize)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &u128)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &u128)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &u128)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &u128)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &u128)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &u128)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &u128)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &u128)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &u128)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &u128)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &u128)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &u128)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &u16)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &u32)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &u64)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &u8)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)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/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: i128)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: i16)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: i32)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: i64)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: i8)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: isize)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: u128)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: u128)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: u128)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: u128)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: u128)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: u128)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: u128)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: u128)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: u128)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: u128)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: u128)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: u128)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: u16)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: u32)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: u64)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: u8)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)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/iter/range.rs.html#391-394)### impl Step for u128
[source](https://doc.rust-lang.org/src/core/iter/range.rs.html#391-394)#### unsafe fn forward\_unchecked(start: u128, n: usize) -> u128
🔬This is a nightly-only experimental API. (`step_trait` [#42168](https://github.com/rust-lang/rust/issues/42168))
Returns the value that would be obtained by taking the *successor* of `self` `count` times. [Read more](iter/trait.step#method.forward_unchecked)
[source](https://doc.rust-lang.org/src/core/iter/range.rs.html#391-394)#### unsafe fn backward\_unchecked(start: u128, n: usize) -> u128
🔬This is a nightly-only experimental API. (`step_trait` [#42168](https://github.com/rust-lang/rust/issues/42168))
Returns the value that would be obtained by taking the *predecessor* of `self` `count` times. [Read more](iter/trait.step#method.backward_unchecked)
[source](https://doc.rust-lang.org/src/core/iter/range.rs.html#391-394)#### fn forward(start: u128, n: usize) -> u128
🔬This is a nightly-only experimental API. (`step_trait` [#42168](https://github.com/rust-lang/rust/issues/42168))
Returns the value that would be obtained by taking the *successor* of `self` `count` times. [Read more](iter/trait.step#method.forward)
[source](https://doc.rust-lang.org/src/core/iter/range.rs.html#391-394)#### fn backward(start: u128, n: usize) -> u128
🔬This is a nightly-only experimental API. (`step_trait` [#42168](https://github.com/rust-lang/rust/issues/42168))
Returns the value that would be obtained by taking the *predecessor* of `self` `count` times. [Read more](iter/trait.step#method.backward)
[source](https://doc.rust-lang.org/src/core/iter/range.rs.html#391-394)#### fn steps\_between(start: &u128, end: &u128) -> Option<usize>
🔬This is a nightly-only experimental API. (`step_trait` [#42168](https://github.com/rust-lang/rust/issues/42168))
Returns the number of *successor* steps required to get from `start` to `end`. [Read more](iter/trait.step#tymethod.steps_between)
[source](https://doc.rust-lang.org/src/core/iter/range.rs.html#391-394)#### fn forward\_checked(start: u128, n: usize) -> Option<u128>
🔬This is a nightly-only experimental API. (`step_trait` [#42168](https://github.com/rust-lang/rust/issues/42168))
Returns the value that would be obtained by taking the *successor* of `self` `count` times. [Read more](iter/trait.step#tymethod.forward_checked)
[source](https://doc.rust-lang.org/src/core/iter/range.rs.html#391-394)#### fn backward\_checked(start: u128, n: usize) -> Option<u128>
🔬This is a nightly-only experimental API. (`step_trait` [#42168](https://github.com/rust-lang/rust/issues/42168))
Returns the value that would be obtained by taking the *predecessor* of `self` `count` times. [Read more](iter/trait.step#tymethod.backward_checked)
[source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#240)1.0.0 (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
The resulting type after applying the `-` operator.
[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") · #### fn sub(self, other: &u128) -> <u128 as Sub<u128>>::Output
Performs the `-` operation. [Read more](ops/trait.sub#tymethod.sub)
[source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#240)1.0.0 (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
The resulting type after applying the `-` operator.
[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") · #### fn sub(self, other: &u128) -> <u128 as Sub<u128>>::Output
Performs the `-` operation. [Read more](ops/trait.sub#tymethod.sub)
[source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#240)1.0.0 (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
The resulting type after applying the `-` operator.
[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") · #### fn sub(self, other: u128) -> <u128 as Sub<u128>>::Output
Performs the `-` operation. [Read more](ops/trait.sub#tymethod.sub)
[source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#240)1.0.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops")) · ### impl Sub<u128> for u128
#### type Output = u128
The resulting type after applying the `-` operator.
[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") · #### fn sub(self, other: u128) -> u128
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<&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/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/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/ops/arith.rs.html#853)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/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/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/ops/arith.rs.html#853)1.8.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/ops/arith.rs.html#853)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/iter/traits/accum.rs.html#141)1.12.0 · ### impl<'a> Sum<&'a u128> for u128
[source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)#### fn sum<I>(iter: I) -> u128where I: [Iterator](iter/trait.iterator "trait std::iter::Iterator")<Item = &'a [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.12.0 · ### impl Sum<u128> for u128
[source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)#### fn sum<I>(iter: I) -> u128where I: [Iterator](iter/trait.iterator "trait std::iter::Iterator")<Item = [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/convert/num.rs.html#290)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<i128> for u128
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#290)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: i128) -> Result<u128, <u128 as TryFrom<i128>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#287)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<i16> for u128
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#287)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: i16) -> Result<u128, <u128 as TryFrom<i16>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#288)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<i32> for u128
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#288)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: i32) -> Result<u128, <u128 as TryFrom<i32>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#289)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<i64> for u128
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#289)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: i64) -> Result<u128, <u128 as TryFrom<i64>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#286)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<i8> for u128
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#286)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: i8) -> Result<u128, <u128 as TryFrom<i8>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#360)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<isize> for u128
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#360)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: isize) -> Result<u128, <u128 as TryFrom<isize>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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/convert/num.rs.html#283)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<u128> for i128
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#283)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: u128) -> Result<i128, <i128 as TryFrom<u128>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#283)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<u128> for i16
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#283)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: u128) -> Result<i16, <i16 as TryFrom<u128>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#283)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<u128> for i32
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#283)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: u128) -> Result<i32, <i32 as TryFrom<u128>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#283)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<u128> for i64
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#283)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: u128) -> Result<i64, <i64 as TryFrom<u128>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#283)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<u128> for i8
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#283)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: u128) -> Result<i8, <i8 as TryFrom<u128>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#370)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<u128> for isize
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#370)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: u128) -> Result<isize, <isize as TryFrom<u128>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#271)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<u128> for u16
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#271)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: u128) -> Result<u16, <u16 as TryFrom<u128>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#271)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<u128> for u32
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#271)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: u128) -> Result<u32, <u32 as TryFrom<u128>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#271)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<u128> for u64
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#271)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: u128) -> Result<u64, <u64 as TryFrom<u128>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#271)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<u128> for u8
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#271)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: u128) -> Result<u8, <u8 as TryFrom<u128>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#365)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<u128> for usize
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#365)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: u128) -> Result<usize, <usize as TryFrom<u128>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#355)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<usize> for u128
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#355)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(value: usize) -> Result<u128, <u128 as TryFrom<usize>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### type Error = TryFromIntError
The type returned in the event of a conversion error.
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#479)1.42.0 · ### impl UpperExp for u128
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#479)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error>
Formats the value using the given formatter.
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#179)1.0.0 · ### impl UpperHex for u128
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#179)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error>
Formats the value using the given formatter.
[source](https://doc.rust-lang.org/src/core/marker.rs.html#830-835)1.0.0 · ### impl Copy for u128
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1377)1.0.0 · ### impl Eq for u128
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#38)### impl FloatToInt<u128> for f32
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#39)### impl FloatToInt<u128> for f64
[source](https://doc.rust-lang.org/src/core/iter/range.rs.html#17)### impl TrustedStep for u128
Auto Trait Implementations
--------------------------
### impl RefUnwindSafe for u128
### impl Send for u128
### impl Sync for u128
### impl Unpin for u128
### impl UnwindSafe for u128
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 Primitive Type u8 Primitive Type u8
=================
The 8-bit unsigned integer type.
Implementations
---------------
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#273)### impl u8
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#274-275)1.43.0 · #### pub const MIN: u8 = 0u8
The smallest value that can be represented by this integer type.
##### Examples
Basic usage:
```
assert_eq!(u8::MIN, 0);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#274-275)1.43.0 · #### pub const MAX: u8 = 255u8
The largest value that can be represented by this integer type (28 − 1)
##### Examples
Basic usage:
```
assert_eq!(u8::MAX, 255);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#274-275)1.53.0 · #### pub const BITS: u32 = 8u32
The size of this integer type in bits.
##### Examples
```
assert_eq!(u8::BITS, 8);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#274-275)#### pub fn from\_str\_radix(src: &str, radix: u32) -> Result<u8, ParseIntError>
Converts a string slice in a given base to an integer.
The string is expected to be an optional `+` sign followed by digits. Leading and trailing whitespace represent an error. Digits are a subset of these characters, depending on `radix`:
* `0-9`
* `a-z`
* `A-Z`
##### Panics
This function panics if `radix` is not in the range from 2 to 36.
##### Examples
Basic usage:
```
assert_eq!(u8::from_str_radix("A", 16), Ok(10));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#274-275)const: 1.32.0 · #### pub const fn count\_ones(self) -> u32
Returns the number of ones in the binary representation of `self`.
##### Examples
Basic usage:
```
let n = 0b01001100u8;
assert_eq!(n.count_ones(), 3);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#274-275)const: 1.32.0 · #### pub const fn count\_zeros(self) -> u32
Returns the number of zeros in the binary representation of `self`.
##### Examples
Basic usage:
```
assert_eq!(u8::MAX.count_zeros(), 0);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#274-275)const: 1.32.0 · #### pub const fn leading\_zeros(self) -> u32
Returns the number of leading zeros in the binary representation of `self`.
##### Examples
Basic usage:
```
let n = u8::MAX >> 2;
assert_eq!(n.leading_zeros(), 2);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#274-275)const: 1.32.0 · #### pub const fn trailing\_zeros(self) -> u32
Returns the number of trailing zeros in the binary representation of `self`.
##### Examples
Basic usage:
```
let n = 0b0101000u8;
assert_eq!(n.trailing_zeros(), 3);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#274-275)1.46.0 (const: 1.46.0) · #### pub const fn leading\_ones(self) -> u32
Returns the number of leading ones in the binary representation of `self`.
##### Examples
Basic usage:
```
let n = !(u8::MAX >> 2);
assert_eq!(n.leading_ones(), 2);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#274-275)1.46.0 (const: 1.46.0) · #### pub const fn trailing\_ones(self) -> u32
Returns the number of trailing ones in the binary representation of `self`.
##### Examples
Basic usage:
```
let n = 0b1010111u8;
assert_eq!(n.trailing_ones(), 3);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#274-275)const: 1.32.0 · #### pub const fn rotate\_left(self, n: u32) -> u8
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:
```
let n = 0x82u8;
let m = 0xa;
assert_eq!(n.rotate_left(2), m);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#274-275)const: 1.32.0 · #### pub const fn rotate\_right(self, n: u32) -> u8
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:
```
let n = 0xau8;
let m = 0x82;
assert_eq!(n.rotate_right(2), m);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#274-275)const: 1.32.0 · #### pub const fn swap\_bytes(self) -> u8
Reverses the byte order of the integer.
##### Examples
Basic usage:
```
let n = 0x12u8;
let m = n.swap_bytes();
assert_eq!(m, 0x12);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#274-275)1.37.0 (const: 1.37.0) · #### pub const fn reverse\_bits(self) -> u8
Reverses the order of bits in the integer. The least significant bit becomes the most significant bit, second least-significant bit becomes second most-significant bit, etc.
##### Examples
Basic usage:
```
let n = 0x12u8;
let m = n.reverse_bits();
assert_eq!(m, 0x48);
assert_eq!(0, 0u8.reverse_bits());
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#274-275)const: 1.32.0 · #### pub const fn from\_be(x: u8) -> u8
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:
```
let n = 0x1Au8;
if cfg!(target_endian = "big") {
assert_eq!(u8::from_be(n), n)
} else {
assert_eq!(u8::from_be(n), n.swap_bytes())
}
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#274-275)const: 1.32.0 · #### pub const fn from\_le(x: u8) -> u8
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:
```
let n = 0x1Au8;
if cfg!(target_endian = "little") {
assert_eq!(u8::from_le(n), n)
} else {
assert_eq!(u8::from_le(n), n.swap_bytes())
}
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#274-275)const: 1.32.0 · #### pub const fn to\_be(self) -> u8
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:
```
let n = 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/mod.rs.html#274-275)const: 1.32.0 · #### pub const fn to\_le(self) -> u8
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:
```
let n = 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/mod.rs.html#274-275)const: 1.47.0 · #### pub const fn checked\_add(self, rhs: u8) -> Option<u8>
Checked integer addition. Computes `self + rhs`, returning `None` if overflow occurred.
##### Examples
Basic usage:
```
assert_eq!((u8::MAX - 2).checked_add(1), Some(u8::MAX - 1));
assert_eq!((u8::MAX - 2).checked_add(3), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#274-275)const: [unstable](https://github.com/rust-lang/rust/issues/85122 "Tracking issue for const_inherent_unchecked_arith") · #### pub unsafe fn unchecked\_add(self, rhs: u8) -> u8
🔬This is a nightly-only experimental API. (`unchecked_math` [#85122](https://github.com/rust-lang/rust/issues/85122))
Unchecked integer addition. Computes `self + rhs`, assuming overflow cannot occur.
##### Safety
This results in undefined behavior when `self + rhs > u8::MAX` or `self + rhs < u8::MIN`, i.e. when [`checked_add`](primitive.u8#method.checked_add) would return `None`.
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#274-275)const: [unstable](https://github.com/rust-lang/rust/issues/87840 "Tracking issue for mixed_integer_ops") · #### pub fn checked\_add\_signed(self, rhs: i8) -> Option<u8>
🔬This is a nightly-only experimental API. (`mixed_integer_ops` [#87840](https://github.com/rust-lang/rust/issues/87840))
Checked addition with a signed integer. Computes `self + rhs`, returning `None` if overflow occurred.
##### Examples
Basic usage:
```
assert_eq!(1u8.checked_add_signed(2), Some(3));
assert_eq!(1u8.checked_add_signed(-2), None);
assert_eq!((u8::MAX - 2).checked_add_signed(3), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#274-275)const: 1.47.0 · #### pub const fn checked\_sub(self, rhs: u8) -> Option<u8>
Checked integer subtraction. Computes `self - rhs`, returning `None` if overflow occurred.
##### Examples
Basic usage:
```
assert_eq!(1u8.checked_sub(1), Some(0));
assert_eq!(0u8.checked_sub(1), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#274-275)const: [unstable](https://github.com/rust-lang/rust/issues/85122 "Tracking issue for const_inherent_unchecked_arith") · #### pub unsafe fn unchecked\_sub(self, rhs: u8) -> u8
🔬This is a nightly-only experimental API. (`unchecked_math` [#85122](https://github.com/rust-lang/rust/issues/85122))
Unchecked integer subtraction. Computes `self - rhs`, assuming overflow cannot occur.
##### Safety
This results in undefined behavior when `self - rhs > u8::MAX` or `self - rhs < u8::MIN`, i.e. when [`checked_sub`](primitive.u8#method.checked_sub) would return `None`.
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#274-275)const: 1.47.0 · #### pub const fn checked\_mul(self, rhs: u8) -> Option<u8>
Checked integer multiplication. Computes `self * rhs`, returning `None` if overflow occurred.
##### Examples
Basic usage:
```
assert_eq!(5u8.checked_mul(1), Some(5));
assert_eq!(u8::MAX.checked_mul(2), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#274-275)const: [unstable](https://github.com/rust-lang/rust/issues/85122 "Tracking issue for const_inherent_unchecked_arith") · #### pub unsafe fn unchecked\_mul(self, rhs: u8) -> u8
🔬This is a nightly-only experimental API. (`unchecked_math` [#85122](https://github.com/rust-lang/rust/issues/85122))
Unchecked integer multiplication. Computes `self * rhs`, assuming overflow cannot occur.
##### Safety
This results in undefined behavior when `self * rhs > u8::MAX` or `self * rhs < u8::MIN`, i.e. when [`checked_mul`](primitive.u8#method.checked_mul) would return `None`.
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#274-275)const: 1.52.0 · #### pub const fn checked\_div(self, rhs: u8) -> Option<u8>
Checked integer division. Computes `self / rhs`, returning `None` if `rhs == 0`.
##### Examples
Basic usage:
```
assert_eq!(128u8.checked_div(2), Some(64));
assert_eq!(1u8.checked_div(0), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#274-275)1.38.0 (const: 1.52.0) · #### pub const fn checked\_div\_euclid(self, rhs: u8) -> Option<u8>
Checked Euclidean division. Computes `self.div_euclid(rhs)`, returning `None` if `rhs == 0`.
##### Examples
Basic usage:
```
assert_eq!(128u8.checked_div_euclid(2), Some(64));
assert_eq!(1u8.checked_div_euclid(0), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#274-275)1.7.0 (const: 1.52.0) · #### pub const fn checked\_rem(self, rhs: u8) -> Option<u8>
Checked integer remainder. Computes `self % rhs`, returning `None` if `rhs == 0`.
##### Examples
Basic usage:
```
assert_eq!(5u8.checked_rem(2), Some(1));
assert_eq!(5u8.checked_rem(0), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#274-275)1.38.0 (const: 1.52.0) · #### pub const fn checked\_rem\_euclid(self, rhs: u8) -> Option<u8>
Checked Euclidean modulo. Computes `self.rem_euclid(rhs)`, returning `None` if `rhs == 0`.
##### Examples
Basic usage:
```
assert_eq!(5u8.checked_rem_euclid(2), Some(1));
assert_eq!(5u8.checked_rem_euclid(0), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#274-275)#### pub const fn ilog(self, base: u8) -> u32
🔬This is a nightly-only experimental API. (`int_log` [#70887](https://github.com/rust-lang/rust/issues/70887))
Returns the logarithm of the number with respect to an arbitrary base, rounded down.
This method might not be optimized owing to implementation details; `ilog2` can produce results more efficiently for base 2, and `ilog10` can produce results more efficiently for base 10.
##### Panics
When the number is zero, or if the base is not at least 2; it panics in debug mode and the return value is 0 in release mode.
##### Examples
```
#![feature(int_log)]
assert_eq!(5u8.ilog(5), 1);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#274-275)#### 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.
##### Panics
When the number is zero it panics in debug mode and the return value is 0 in release mode.
##### Examples
```
#![feature(int_log)]
assert_eq!(2u8.ilog2(), 1);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#274-275)#### 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.
##### Panics
When the number is zero it panics in debug mode and the return value is 0 in release mode.
##### Example
```
#![feature(int_log)]
assert_eq!(10u8.ilog10(), 1);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#274-275)#### pub const fn checked\_ilog(self, base: u8) -> Option<u32>
🔬This is a nightly-only experimental API. (`int_log` [#70887](https://github.com/rust-lang/rust/issues/70887))
Returns the logarithm of the number with respect to an arbitrary base, rounded down.
Returns `None` if the number is zero, or if the base is not at least 2.
This method might not be optimized owing to implementation details; `checked_ilog2` can produce results more efficiently for base 2, and `checked_ilog10` can produce results more efficiently for base 10.
##### Examples
```
#![feature(int_log)]
assert_eq!(5u8.checked_ilog(5), Some(1));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#274-275)#### pub const fn checked\_ilog2(self) -> Option<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.
Returns `None` if the number is zero.
##### Examples
```
#![feature(int_log)]
assert_eq!(2u8.checked_ilog2(), Some(1));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#274-275)#### pub const fn checked\_ilog10(self) -> Option<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.
Returns `None` if the number is zero.
##### Examples
```
#![feature(int_log)]
assert_eq!(10u8.checked_ilog10(), Some(1));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#274-275)1.7.0 (const: 1.47.0) · #### pub const fn checked\_neg(self) -> Option<u8>
Checked negation. Computes `-self`, returning `None` unless `self == 0`.
Note that negating any positive integer will overflow.
##### Examples
Basic usage:
```
assert_eq!(0u8.checked_neg(), Some(0));
assert_eq!(1u8.checked_neg(), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#274-275)1.7.0 (const: 1.47.0) · #### pub const fn checked\_shl(self, rhs: u32) -> Option<u8>
Checked shift left. Computes `self << rhs`, returning `None` if `rhs` is larger than or equal to the number of bits in `self`.
##### Examples
Basic usage:
```
assert_eq!(0x1u8.checked_shl(4), Some(0x10));
assert_eq!(0x10u8.checked_shl(129), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#274-275)const: [unstable](https://github.com/rust-lang/rust/issues/85122 "Tracking issue for const_inherent_unchecked_arith") · #### pub unsafe fn unchecked\_shl(self, rhs: u8) -> u8
🔬This is a nightly-only experimental API. (`unchecked_math` [#85122](https://github.com/rust-lang/rust/issues/85122))
Unchecked shift left. Computes `self << rhs`, assuming that `rhs` is less than the number of bits in `self`.
##### Safety
This results in undefined behavior if `rhs` is larger than or equal to the number of bits in `self`, i.e. when [`checked_shl`](primitive.u8#method.checked_shl) would return `None`.
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#274-275)1.7.0 (const: 1.47.0) · #### pub const fn checked\_shr(self, rhs: u32) -> Option<u8>
Checked shift right. Computes `self >> rhs`, returning `None` if `rhs` is larger than or equal to the number of bits in `self`.
##### Examples
Basic usage:
```
assert_eq!(0x10u8.checked_shr(4), Some(0x1));
assert_eq!(0x10u8.checked_shr(129), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#274-275)const: [unstable](https://github.com/rust-lang/rust/issues/85122 "Tracking issue for const_inherent_unchecked_arith") · #### pub unsafe fn unchecked\_shr(self, rhs: u8) -> u8
🔬This is a nightly-only experimental API. (`unchecked_math` [#85122](https://github.com/rust-lang/rust/issues/85122))
Unchecked shift right. Computes `self >> rhs`, assuming that `rhs` is less than the number of bits in `self`.
##### Safety
This results in undefined behavior if `rhs` is larger than or equal to the number of bits in `self`, i.e. when [`checked_shr`](primitive.u8#method.checked_shr) would return `None`.
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#274-275)1.34.0 (const: 1.50.0) · #### pub const fn checked\_pow(self, exp: u32) -> Option<u8>
Checked exponentiation. Computes `self.pow(exp)`, returning `None` if overflow occurred.
##### Examples
Basic usage:
```
assert_eq!(2u8.checked_pow(5), Some(32));
assert_eq!(u8::MAX.checked_pow(2), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#274-275)const: 1.47.0 · #### pub const fn saturating\_add(self, rhs: u8) -> u8
Saturating integer addition. Computes `self + rhs`, saturating at the numeric bounds instead of overflowing.
##### Examples
Basic usage:
```
assert_eq!(100u8.saturating_add(1), 101);
assert_eq!(u8::MAX.saturating_add(127), u8::MAX);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#274-275)const: [unstable](https://github.com/rust-lang/rust/issues/87840 "Tracking issue for mixed_integer_ops") · #### pub fn saturating\_add\_signed(self, rhs: i8) -> u8
🔬This is a nightly-only experimental API. (`mixed_integer_ops` [#87840](https://github.com/rust-lang/rust/issues/87840))
Saturating addition with a signed integer. Computes `self + rhs`, saturating at the numeric bounds instead of overflowing.
##### Examples
Basic usage:
```
assert_eq!(1u8.saturating_add_signed(2), 3);
assert_eq!(1u8.saturating_add_signed(-2), 0);
assert_eq!((u8::MAX - 2).saturating_add_signed(4), u8::MAX);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#274-275)const: 1.47.0 · #### pub const fn saturating\_sub(self, rhs: u8) -> u8
Saturating integer subtraction. Computes `self - rhs`, saturating at the numeric bounds instead of overflowing.
##### Examples
Basic usage:
```
assert_eq!(100u8.saturating_sub(27), 73);
assert_eq!(13u8.saturating_sub(127), 0);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#274-275)1.7.0 (const: 1.47.0) · #### pub const fn saturating\_mul(self, rhs: u8) -> u8
Saturating integer multiplication. Computes `self * rhs`, saturating at the numeric bounds instead of overflowing.
##### Examples
Basic usage:
```
assert_eq!(2u8.saturating_mul(10), 20);
assert_eq!((u8::MAX).saturating_mul(10), u8::MAX);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#274-275)1.58.0 (const: 1.58.0) · #### pub const fn saturating\_div(self, rhs: u8) -> u8
Saturating integer division. Computes `self / rhs`, saturating at the numeric bounds instead of overflowing.
##### Examples
Basic usage:
```
assert_eq!(5u8.saturating_div(2), 2);
```
ⓘ
```
let _ = 1u8.saturating_div(0);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#274-275)1.34.0 (const: 1.50.0) · #### pub const fn saturating\_pow(self, exp: u32) -> u8
Saturating integer exponentiation. Computes `self.pow(exp)`, saturating at the numeric bounds instead of overflowing.
##### Examples
Basic usage:
```
assert_eq!(4u8.saturating_pow(3), 64);
assert_eq!(u8::MAX.saturating_pow(2), u8::MAX);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#274-275)const: 1.32.0 · #### pub const fn wrapping\_add(self, rhs: u8) -> u8
Wrapping (modular) addition. Computes `self + rhs`, wrapping around at the boundary of the type.
##### Examples
Basic usage:
```
assert_eq!(200u8.wrapping_add(55), 255);
assert_eq!(200u8.wrapping_add(u8::MAX), 199);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#274-275)const: [unstable](https://github.com/rust-lang/rust/issues/87840 "Tracking issue for mixed_integer_ops") · #### pub fn wrapping\_add\_signed(self, rhs: i8) -> u8
🔬This is a nightly-only experimental API. (`mixed_integer_ops` [#87840](https://github.com/rust-lang/rust/issues/87840))
Wrapping (modular) addition with a signed integer. Computes `self + rhs`, wrapping around at the boundary of the type.
##### Examples
Basic usage:
```
assert_eq!(1u8.wrapping_add_signed(2), 3);
assert_eq!(1u8.wrapping_add_signed(-2), u8::MAX);
assert_eq!((u8::MAX - 2).wrapping_add_signed(4), 1);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#274-275)const: 1.32.0 · #### pub const fn wrapping\_sub(self, rhs: u8) -> u8
Wrapping (modular) subtraction. Computes `self - rhs`, wrapping around at the boundary of the type.
##### Examples
Basic usage:
```
assert_eq!(100u8.wrapping_sub(100), 0);
assert_eq!(100u8.wrapping_sub(u8::MAX), 101);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#274-275)const: 1.32.0 · #### pub const fn wrapping\_mul(self, rhs: u8) -> u8
Wrapping (modular) multiplication. Computes `self * rhs`, wrapping around at the boundary of the type.
##### Examples
Basic usage:
Please note that this example is shared between integer types. Which explains why `u8` is used here.
```
assert_eq!(10u8.wrapping_mul(12), 120);
assert_eq!(25u8.wrapping_mul(12), 44);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#274-275)1.2.0 (const: 1.52.0) · #### pub const fn wrapping\_div(self, rhs: u8) -> u8
Wrapping (modular) division. Computes `self / rhs`. Wrapped division on unsigned types is just normal division. There’s no way wrapping could ever happen. This function exists, so that all operations are accounted for in the wrapping operations.
##### Examples
Basic usage:
```
assert_eq!(100u8.wrapping_div(10), 10);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#274-275)1.38.0 (const: 1.52.0) · #### pub const fn wrapping\_div\_euclid(self, rhs: u8) -> u8
Wrapping Euclidean division. Computes `self.div_euclid(rhs)`. Wrapped division on unsigned types is just normal division. There’s no way wrapping could ever happen. This function exists, so that all operations are accounted for in the wrapping operations. Since, for the positive integers, all common definitions of division are equal, this is exactly equal to `self.wrapping_div(rhs)`.
##### Examples
Basic usage:
```
assert_eq!(100u8.wrapping_div_euclid(10), 10);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#274-275)1.2.0 (const: 1.52.0) · #### pub const fn wrapping\_rem(self, rhs: u8) -> u8
Wrapping (modular) remainder. Computes `self % rhs`. Wrapped remainder calculation on unsigned types is just the regular remainder calculation. There’s no way wrapping could ever happen. This function exists, so that all operations are accounted for in the wrapping operations.
##### Examples
Basic usage:
```
assert_eq!(100u8.wrapping_rem(10), 0);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#274-275)1.38.0 (const: 1.52.0) · #### pub const fn wrapping\_rem\_euclid(self, rhs: u8) -> u8
Wrapping Euclidean modulo. Computes `self.rem_euclid(rhs)`. Wrapped modulo calculation on unsigned types is just the regular remainder calculation. There’s no way wrapping could ever happen. This function exists, so that all operations are accounted for in the wrapping operations. Since, for the positive integers, all common definitions of division are equal, this is exactly equal to `self.wrapping_rem(rhs)`.
##### Examples
Basic usage:
```
assert_eq!(100u8.wrapping_rem_euclid(10), 0);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#274-275)1.2.0 (const: 1.32.0) · #### pub const fn wrapping\_neg(self) -> u8
Wrapping (modular) negation. Computes `-self`, wrapping around at the boundary of the type.
Since unsigned types do not have negative equivalents all applications of this function will wrap (except for `-0`). For values smaller than the corresponding signed type’s maximum the result is the same as casting the corresponding signed value. Any larger values are equivalent to `MAX + 1 - (val - MAX - 1)` where `MAX` is the corresponding signed type’s maximum.
##### Examples
Basic usage:
Please note that this example is shared between integer types. Which explains why `i8` is used here.
```
assert_eq!(100i8.wrapping_neg(), -100);
assert_eq!((-128i8).wrapping_neg(), -128);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#274-275)1.2.0 (const: 1.32.0) · #### pub const fn wrapping\_shl(self, rhs: u32) -> u8
Panic-free bitwise shift-left; yields `self << mask(rhs)`, where `mask` removes any high-order bits of `rhs` that would cause the shift to exceed the bitwidth of the type.
Note that this is *not* the same as a rotate-left; the RHS of a wrapping shift-left is restricted to the range of the type, rather than the bits shifted out of the LHS being returned to the other end. The primitive integer types all implement a [`rotate_left`](primitive.u8#method.rotate_left) function, which may be what you want instead.
##### Examples
Basic usage:
```
assert_eq!(1u8.wrapping_shl(7), 128);
assert_eq!(1u8.wrapping_shl(128), 1);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#274-275)1.2.0 (const: 1.32.0) · #### pub const fn wrapping\_shr(self, rhs: u32) -> u8
Panic-free bitwise shift-right; yields `self >> mask(rhs)`, where `mask` removes any high-order bits of `rhs` that would cause the shift to exceed the bitwidth of the type.
Note that this is *not* the same as a rotate-right; the RHS of a wrapping shift-right is restricted to the range of the type, rather than the bits shifted out of the LHS being returned to the other end. The primitive integer types all implement a [`rotate_right`](primitive.u8#method.rotate_right) function, which may be what you want instead.
##### Examples
Basic usage:
```
assert_eq!(128u8.wrapping_shr(7), 1);
assert_eq!(128u8.wrapping_shr(128), 128);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#274-275)1.34.0 (const: 1.50.0) · #### pub const fn wrapping\_pow(self, exp: u32) -> u8
Wrapping (modular) exponentiation. Computes `self.pow(exp)`, wrapping around at the boundary of the type.
##### Examples
Basic usage:
```
assert_eq!(3u8.wrapping_pow(5), 243);
assert_eq!(3u8.wrapping_pow(6), 217);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#274-275)1.7.0 (const: 1.32.0) · #### pub const fn overflowing\_add(self, rhs: u8) -> (u8, bool)
Calculates `self` + `rhs`
Returns a tuple of the addition along with a boolean indicating whether an arithmetic overflow would occur. If an overflow would have occurred then the wrapped value is returned.
##### Examples
Basic usage
```
assert_eq!(5u8.overflowing_add(2), (7, false));
assert_eq!(u8::MAX.overflowing_add(1), (0, true));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#274-275)const: [unstable](https://github.com/rust-lang/rust/issues/85532 "Tracking issue for const_bigint_helper_methods") · #### pub fn carrying\_add(self, rhs: u8, carry: bool) -> (u8, bool)
🔬This is a nightly-only experimental API. (`bigint_helper_methods` [#85532](https://github.com/rust-lang/rust/issues/85532))
Calculates `self + rhs + carry` without the ability to overflow.
Performs “ternary addition” which takes in an extra bit to add, and may return an additional bit of overflow. This allows for chaining together multiple additions to create “big integers” which represent larger values.
This can be thought of as a 8-bit “full adder”, in the electronics sense.
##### Examples
Basic usage
```
#![feature(bigint_helper_methods)]
assert_eq!(5u8.carrying_add(2, false), (7, false));
assert_eq!(5u8.carrying_add(2, true), (8, false));
assert_eq!(u8::MAX.carrying_add(1, false), (0, true));
assert_eq!(u8::MAX.carrying_add(0, true), (0, true));
assert_eq!(u8::MAX.carrying_add(1, true), (1, true));
assert_eq!(u8::MAX.carrying_add(u8::MAX, true), (u8::MAX, true));
```
If `carry` is false, this method is equivalent to [`overflowing_add`](primitive.u8#method.overflowing_add):
```
#![feature(bigint_helper_methods)]
assert_eq!(5_u8.carrying_add(2, false), 5_u8.overflowing_add(2));
assert_eq!(u8::MAX.carrying_add(1, false), u8::MAX.overflowing_add(1));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#274-275)const: [unstable](https://github.com/rust-lang/rust/issues/87840 "Tracking issue for mixed_integer_ops") · #### pub fn overflowing\_add\_signed(self, rhs: i8) -> (u8, bool)
🔬This is a nightly-only experimental API. (`mixed_integer_ops` [#87840](https://github.com/rust-lang/rust/issues/87840))
Calculates `self` + `rhs` with a signed `rhs`
Returns a tuple of the addition along with a boolean indicating whether an arithmetic overflow would occur. If an overflow would have occurred then the wrapped value is returned.
##### Examples
Basic usage:
```
assert_eq!(1u8.overflowing_add_signed(2), (3, false));
assert_eq!(1u8.overflowing_add_signed(-2), (u8::MAX, true));
assert_eq!((u8::MAX - 2).overflowing_add_signed(4), (1, true));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#274-275)1.7.0 (const: 1.32.0) · #### pub const fn overflowing\_sub(self, rhs: u8) -> (u8, bool)
Calculates `self` - `rhs`
Returns a tuple of the subtraction along with a boolean indicating whether an arithmetic overflow would occur. If an overflow would have occurred then the wrapped value is returned.
##### Examples
Basic usage
```
assert_eq!(5u8.overflowing_sub(2), (3, false));
assert_eq!(0u8.overflowing_sub(1), (u8::MAX, true));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#274-275)const: [unstable](https://github.com/rust-lang/rust/issues/85532 "Tracking issue for const_bigint_helper_methods") · #### pub fn borrowing\_sub(self, rhs: u8, borrow: bool) -> (u8, bool)
🔬This is a nightly-only experimental API. (`bigint_helper_methods` [#85532](https://github.com/rust-lang/rust/issues/85532))
Calculates `self - rhs - borrow` without the ability to overflow.
Performs “ternary subtraction” which takes in an extra bit to subtract, and may return an additional bit of overflow. This allows for chaining together multiple subtractions to create “big integers” which represent larger values.
##### Examples
Basic usage
```
#![feature(bigint_helper_methods)]
assert_eq!(5u8.borrowing_sub(2, false), (3, false));
assert_eq!(5u8.borrowing_sub(2, true), (2, false));
assert_eq!(0u8.borrowing_sub(1, false), (u8::MAX, true));
assert_eq!(0u8.borrowing_sub(1, true), (u8::MAX - 1, true));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#274-275)1.60.0 (const: 1.60.0) · #### pub const fn abs\_diff(self, other: u8) -> u8
Computes the absolute difference between `self` and `other`.
##### Examples
Basic usage:
```
assert_eq!(100u8.abs_diff(80), 20u8);
assert_eq!(100u8.abs_diff(110), 10u8);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#274-275)1.7.0 (const: 1.32.0) · #### pub const fn overflowing\_mul(self, rhs: u8) -> (u8, bool)
Calculates the multiplication of `self` and `rhs`.
Returns a tuple of the multiplication along with a boolean indicating whether an arithmetic overflow would occur. If an overflow would have occurred then the wrapped value is returned.
##### Examples
Basic usage:
Please note that this example is shared between integer types. Which explains why `u32` is used here.
```
assert_eq!(5u32.overflowing_mul(2), (10, false));
assert_eq!(1_000_000_000u32.overflowing_mul(10), (1410065408, true));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#274-275)1.7.0 (const: 1.52.0) · #### pub const fn overflowing\_div(self, rhs: u8) -> (u8, bool)
Calculates the divisor when `self` is divided by `rhs`.
Returns a tuple of the divisor along with a boolean indicating whether an arithmetic overflow would occur. Note that for unsigned integers overflow never occurs, so the second value is always `false`.
##### Panics
This function will panic if `rhs` is 0.
##### Examples
Basic usage
```
assert_eq!(5u8.overflowing_div(2), (2, false));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#274-275)1.38.0 (const: 1.52.0) · #### pub const fn overflowing\_div\_euclid(self, rhs: u8) -> (u8, bool)
Calculates the quotient of Euclidean division `self.div_euclid(rhs)`.
Returns a tuple of the divisor along with a boolean indicating whether an arithmetic overflow would occur. Note that for unsigned integers overflow never occurs, so the second value is always `false`. Since, for the positive integers, all common definitions of division are equal, this is exactly equal to `self.overflowing_div(rhs)`.
##### Panics
This function will panic if `rhs` is 0.
##### Examples
Basic usage
```
assert_eq!(5u8.overflowing_div_euclid(2), (2, false));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#274-275)1.7.0 (const: 1.52.0) · #### pub const fn overflowing\_rem(self, rhs: u8) -> (u8, bool)
Calculates the remainder when `self` is divided by `rhs`.
Returns a tuple of the remainder after dividing along with a boolean indicating whether an arithmetic overflow would occur. Note that for unsigned integers overflow never occurs, so the second value is always `false`.
##### Panics
This function will panic if `rhs` is 0.
##### Examples
Basic usage
```
assert_eq!(5u8.overflowing_rem(2), (1, false));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#274-275)1.38.0 (const: 1.52.0) · #### pub const fn overflowing\_rem\_euclid(self, rhs: u8) -> (u8, bool)
Calculates the remainder `self.rem_euclid(rhs)` as if by Euclidean division.
Returns a tuple of the modulo after dividing along with a boolean indicating whether an arithmetic overflow would occur. Note that for unsigned integers overflow never occurs, so the second value is always `false`. Since, for the positive integers, all common definitions of division are equal, this operation is exactly equal to `self.overflowing_rem(rhs)`.
##### Panics
This function will panic if `rhs` is 0.
##### Examples
Basic usage
```
assert_eq!(5u8.overflowing_rem_euclid(2), (1, false));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#274-275)1.7.0 (const: 1.32.0) · #### pub const fn overflowing\_neg(self) -> (u8, bool)
Negates self in an overflowing fashion.
Returns `!self + 1` using wrapping operations to return the value that represents the negation of this unsigned value. Note that for positive unsigned values overflow always occurs, but negating 0 does not overflow.
##### Examples
Basic usage
```
assert_eq!(0u8.overflowing_neg(), (0, false));
assert_eq!(2u8.overflowing_neg(), (-2i32 as u8, true));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#274-275)1.7.0 (const: 1.32.0) · #### pub const fn overflowing\_shl(self, rhs: u32) -> (u8, bool)
Shifts self left by `rhs` bits.
Returns a tuple of the shifted version of self along with a boolean indicating whether the shift value was larger than or equal to the number of bits. If the shift value is too large, then value is masked (N-1) where N is the number of bits, and this value is then used to perform the shift.
##### Examples
Basic usage
```
assert_eq!(0x1u8.overflowing_shl(4), (0x10, false));
assert_eq!(0x1u8.overflowing_shl(132), (0x10, true));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#274-275)1.7.0 (const: 1.32.0) · #### pub const fn overflowing\_shr(self, rhs: u32) -> (u8, bool)
Shifts self right by `rhs` bits.
Returns a tuple of the shifted version of self along with a boolean indicating whether the shift value was larger than or equal to the number of bits. If the shift value is too large, then value is masked (N-1) where N is the number of bits, and this value is then used to perform the shift.
##### Examples
Basic usage
```
assert_eq!(0x10u8.overflowing_shr(4), (0x1, false));
assert_eq!(0x10u8.overflowing_shr(132), (0x1, true));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#274-275)1.34.0 (const: 1.50.0) · #### pub const fn overflowing\_pow(self, exp: u32) -> (u8, bool)
Raises self to the power of `exp`, using exponentiation by squaring.
Returns a tuple of the exponentiation along with a bool indicating whether an overflow happened.
##### Examples
Basic usage:
```
assert_eq!(3u8.overflowing_pow(5), (243, false));
assert_eq!(3u8.overflowing_pow(6), (217, true));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#274-275)const: 1.50.0 · #### pub const fn pow(self, exp: u32) -> u8
Raises self to the power of `exp`, using exponentiation by squaring.
##### Examples
Basic usage:
```
assert_eq!(2u8.pow(5), 32);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#274-275)1.38.0 (const: 1.52.0) · #### pub const fn div\_euclid(self, rhs: u8) -> u8
Performs Euclidean division.
Since, for the positive integers, all common definitions of division are equal, this is exactly equal to `self / rhs`.
##### Panics
This function will panic if `rhs` is 0.
##### Examples
Basic usage:
```
assert_eq!(7u8.div_euclid(4), 1); // or any other integer type
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#274-275)1.38.0 (const: 1.52.0) · #### pub const fn rem\_euclid(self, rhs: u8) -> u8
Calculates the least remainder of `self (mod rhs)`.
Since, for the positive integers, all common definitions of division are equal, this is exactly equal to `self % rhs`.
##### Panics
This function will panic if `rhs` is 0.
##### Examples
Basic usage:
```
assert_eq!(7u8.rem_euclid(4), 3); // or any other integer type
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#274-275)#### pub const fn div\_floor(self, rhs: u8) -> u8
🔬This is a nightly-only experimental API. (`int_roundings` [#88581](https://github.com/rust-lang/rust/issues/88581))
Calculates the quotient of `self` and `rhs`, rounding the result towards negative infinity.
This is the same as performing `self / rhs` for all unsigned integers.
##### Panics
This function will panic if `rhs` is zero.
##### Examples
Basic usage:
```
#![feature(int_roundings)]
assert_eq!(7_u8.div_floor(4), 1);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#274-275)#### pub const fn div\_ceil(self, rhs: u8) -> u8
🔬This is a nightly-only experimental API. (`int_roundings` [#88581](https://github.com/rust-lang/rust/issues/88581))
Calculates the quotient of `self` and `rhs`, rounding the result towards positive infinity.
##### Panics
This function will panic if `rhs` is zero.
###### [Overflow behavior](#overflow-behavior)
On overflow, this function will panic if overflow checks are enabled (default in debug mode) and wrap if overflow checks are disabled (default in release mode).
##### Examples
Basic usage:
```
#![feature(int_roundings)]
assert_eq!(7_u8.div_ceil(4), 2);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#274-275)#### pub const fn next\_multiple\_of(self, rhs: u8) -> u8
🔬This is a nightly-only experimental API. (`int_roundings` [#88581](https://github.com/rust-lang/rust/issues/88581))
Calculates the smallest value greater than or equal to `self` that is a multiple of `rhs`.
##### Panics
This function will panic if `rhs` is zero.
###### [Overflow behavior](#overflow-behavior-1)
On overflow, this function will panic if overflow checks are enabled (default in debug mode) and wrap if overflow checks are disabled (default in release mode).
##### Examples
Basic usage:
```
#![feature(int_roundings)]
assert_eq!(16_u8.next_multiple_of(8), 16);
assert_eq!(23_u8.next_multiple_of(8), 24);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#274-275)#### pub const fn checked\_next\_multiple\_of(self, rhs: u8) -> Option<u8>
🔬This is a nightly-only experimental API. (`int_roundings` [#88581](https://github.com/rust-lang/rust/issues/88581))
Calculates the smallest value greater than or equal to `self` that is a multiple of `rhs`. Returns `None` if `rhs` is zero or the operation would result in overflow.
##### Examples
Basic usage:
```
#![feature(int_roundings)]
assert_eq!(16_u8.checked_next_multiple_of(8), Some(16));
assert_eq!(23_u8.checked_next_multiple_of(8), Some(24));
assert_eq!(1_u8.checked_next_multiple_of(0), None);
assert_eq!(u8::MAX.checked_next_multiple_of(2), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#274-275)const: 1.32.0 · #### pub const fn is\_power\_of\_two(self) -> bool
Returns `true` if and only if `self == 2^k` for some `k`.
##### Examples
Basic usage:
```
assert!(16u8.is_power_of_two());
assert!(!10u8.is_power_of_two());
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#274-275)const: 1.50.0 · #### pub const fn next\_power\_of\_two(self) -> u8
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`), it panics in debug mode and the return value is wrapped to 0 in release mode (the only situation in which method can return 0).
##### Examples
Basic usage:
```
assert_eq!(2u8.next_power_of_two(), 2);
assert_eq!(3u8.next_power_of_two(), 4);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#274-275)const: 1.50.0 · #### pub const fn checked\_next\_power\_of\_two(self) -> Option<u8>
Returns the smallest power of two greater than or equal to `n`. If the next power of two is greater than the type’s maximum value, `None` is returned, otherwise the power of two is wrapped in `Some`.
##### Examples
Basic usage:
```
assert_eq!(2u8.checked_next_power_of_two(), Some(2));
assert_eq!(3u8.checked_next_power_of_two(), Some(4));
assert_eq!(u8::MAX.checked_next_power_of_two(), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#274-275)const: [unstable](https://github.com/rust-lang/rust/issues/32463 "Tracking issue for wrapping_next_power_of_two") · #### pub fn wrapping\_next\_power\_of\_two(self) -> 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 `n`. If the next power of two is greater than the type’s maximum value, the return value is wrapped to `0`.
##### Examples
Basic usage:
```
#![feature(wrapping_next_power_of_two)]
assert_eq!(2u8.wrapping_next_power_of_two(), 2);
assert_eq!(3u8.wrapping_next_power_of_two(), 4);
assert_eq!(u8::MAX.wrapping_next_power_of_two(), 0);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#274-275)1.32.0 (const: 1.44.0) · #### pub const fn to\_be\_bytes(self) -> [u8; 1]
Return the memory representation of this integer as a byte array in big-endian (network) byte order.
##### Examples
```
let bytes = 0x12u8.to_be_bytes();
assert_eq!(bytes, [0x12]);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#274-275)1.32.0 (const: 1.44.0) · #### pub const fn to\_le\_bytes(self) -> [u8; 1]
Return the memory representation of this integer as a byte array in little-endian byte order.
##### Examples
```
let bytes = 0x12u8.to_le_bytes();
assert_eq!(bytes, [0x12]);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#274-275)1.32.0 (const: 1.44.0) · #### pub const fn to\_ne\_bytes(self) -> [u8; 1]
Return the memory representation of this integer as a byte array in native byte order.
As the target platform’s native endianness is used, portable code should use [`to_be_bytes`](primitive.u8#method.to_be_bytes) or [`to_le_bytes`](primitive.u8#method.to_le_bytes), as appropriate, instead.
##### Examples
```
let bytes = 0x12u8.to_ne_bytes();
assert_eq!(
bytes,
if cfg!(target_endian = "big") {
[0x12]
} else {
[0x12]
}
);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#274-275)1.32.0 (const: 1.44.0) · #### pub const fn from\_be\_bytes(bytes: [u8; 1]) -> u8
Create a native endian integer value from its representation as a byte array in big endian.
##### Examples
```
let value = u8::from_be_bytes([0x12]);
assert_eq!(value, 0x12);
```
When starting from a slice rather than an array, fallible conversion APIs can be used:
```
fn read_be_u8(input: &mut &[u8]) -> u8 {
let (int_bytes, rest) = input.split_at(std::mem::size_of::<u8>());
*input = rest;
u8::from_be_bytes(int_bytes.try_into().unwrap())
}
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#274-275)1.32.0 (const: 1.44.0) · #### pub const fn from\_le\_bytes(bytes: [u8; 1]) -> u8
Create a native endian integer value from its representation as a byte array in little endian.
##### Examples
```
let value = u8::from_le_bytes([0x12]);
assert_eq!(value, 0x12);
```
When starting from a slice rather than an array, fallible conversion APIs can be used:
```
fn read_le_u8(input: &mut &[u8]) -> u8 {
let (int_bytes, rest) = input.split_at(std::mem::size_of::<u8>());
*input = rest;
u8::from_le_bytes(int_bytes.try_into().unwrap())
}
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#274-275)1.32.0 (const: 1.44.0) · #### pub const fn from\_ne\_bytes(bytes: [u8; 1]) -> u8
Create a native endian integer value from its memory representation as a byte array in native endianness.
As the target platform’s native endianness is used, portable code likely wants to use [`from_be_bytes`](primitive.u8#method.from_be_bytes) or [`from_le_bytes`](primitive.u8#method.from_le_bytes), as appropriate instead.
##### Examples
```
let value = u8::from_ne_bytes(if cfg!(target_endian = "big") {
[0x12]
} else {
[0x12]
});
assert_eq!(value, 0x12);
```
When starting from a slice rather than an array, fallible conversion APIs can be used:
```
fn read_ne_u8(input: &mut &[u8]) -> u8 {
let (int_bytes, rest) = input.split_at(std::mem::size_of::<u8>());
*input = rest;
u8::from_ne_bytes(int_bytes.try_into().unwrap())
}
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#274-275)const: 1.32.0 · #### pub const fn min\_value() -> u8
👎Deprecating in a future Rust version: replaced by the `MIN` associated constant on this type
New code should prefer to use [`u8::MIN`](primitive.u8#associatedconstant.MIN "u8::MIN") instead.
Returns the smallest value that can be represented by this integer type.
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#274-275)const: 1.32.0 · #### pub const fn max\_value() -> u8
👎Deprecating in a future Rust version: replaced by the `MAX` associated constant on this type
New code should prefer to use [`u8::MAX`](primitive.u8#associatedconstant.MAX "u8::MAX") instead.
Returns the largest value that can be represented by this integer type.
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#276)const: [unstable](https://github.com/rust-lang/rust/issues/85532 "Tracking issue for const_bigint_helper_methods") · #### pub fn widening\_mul(self, rhs: u8) -> (u8, u8)
🔬This is a nightly-only experimental API. (`bigint_helper_methods` [#85532](https://github.com/rust-lang/rust/issues/85532))
Calculates the complete product `self * rhs` without the possibility to overflow.
This returns the low-order (wrapping) bits and the high-order (overflow) bits of the result as two separate values, in that order.
##### Examples
Basic usage:
Please note that this example is shared between integer types. Which explains why `u32` is used here.
```
#![feature(bigint_helper_methods)]
assert_eq!(5u32.widening_mul(2), (10, 0));
assert_eq!(1_000_000_000u32.widening_mul(10), (1410065408, 2));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#276)const: [unstable](https://github.com/rust-lang/rust/issues/85532 "Tracking issue for bigint_helper_methods") · #### pub fn carrying\_mul(self, rhs: u8, carry: u8) -> (u8, u8)
🔬This is a nightly-only experimental API. (`bigint_helper_methods` [#85532](https://github.com/rust-lang/rust/issues/85532))
Calculates the “full multiplication” `self * rhs + carry` without the possibility to overflow.
This returns the low-order (wrapping) bits and the high-order (overflow) bits of the result as two separate values, in that order.
Performs “long multiplication” which takes in an extra amount to add, and may return an additional amount of overflow. This allows for chaining together multiple multiplications to create “big integers” which represent larger values.
##### Examples
Basic usage:
Please note that this example is shared between integer types. Which explains why `u32` is used here.
```
#![feature(bigint_helper_methods)]
assert_eq!(5u32.carrying_mul(2, 0), (10, 0));
assert_eq!(5u32.carrying_mul(2, 10), (20, 0));
assert_eq!(1_000_000_000u32.carrying_mul(10, 0), (1410065408, 2));
assert_eq!(1_000_000_000u32.carrying_mul(10, 10), (1410065418, 2));
assert_eq!(u8::MAX.carrying_mul(u8::MAX, u8::MAX), (0, u8::MAX));
```
If `carry` is zero, this is similar to [`overflowing_mul`](primitive.u8#method.overflowing_mul), except that it gives the value of the overflow instead of just whether one happened:
```
#![feature(bigint_helper_methods)]
let r = u8::carrying_mul(7, 13, 0);
assert_eq!((r.0, r.1 != 0), u8::overflowing_mul(7, 13));
let r = u8::carrying_mul(13, 42, 0);
assert_eq!((r.0, r.1 != 0), u8::overflowing_mul(13, 42));
```
The value of the first field in the returned tuple matches what you’d get by combining the [`wrapping_mul`](primitive.u8#method.wrapping_mul) and [`wrapping_add`](primitive.u8#method.wrapping_add) methods:
```
#![feature(bigint_helper_methods)]
assert_eq!(
789_u16.carrying_mul(456, 123).0,
789_u16.wrapping_mul(456).wrapping_add(123),
);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#293)1.23.0 (const: 1.43.0) · #### pub const fn is\_ascii(&self) -> bool
Checks if the value is within the ASCII range.
##### Examples
```
let ascii = 97u8;
let non_ascii = 150u8;
assert!(ascii.is_ascii());
assert!(!non_ascii.is_ascii());
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#317)1.23.0 (const: 1.52.0) · #### pub const fn to\_ascii\_uppercase(&self) -> u8
Makes a copy of the value in 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.u8#method.make_ascii_uppercase).
##### Examples
```
let lowercase_a = 97u8;
assert_eq!(65, lowercase_a.to_ascii_uppercase());
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#342)1.23.0 (const: 1.52.0) · #### pub const fn to\_ascii\_lowercase(&self) -> u8
Makes a copy of the value in 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.u8#method.make_ascii_lowercase).
##### Examples
```
let uppercase_a = 65u8;
assert_eq!(97, uppercase_a.to_ascii_lowercase());
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#368)1.23.0 (const: 1.52.0) · #### pub const fn eq\_ignore\_ascii\_case(&self, other: &u8) -> bool
Checks that two values are an ASCII case-insensitive match.
This is equivalent to `to_ascii_lowercase(a) == to_ascii_lowercase(b)`.
##### Examples
```
let lowercase_a = 97u8;
let uppercase_a = 65u8;
assert!(lowercase_a.eq_ignore_ascii_case(&uppercase_a));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#393)1.23.0 · #### pub fn make\_ascii\_uppercase(&mut self)
Converts this value 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`](primitive.u8#method.to_ascii_uppercase).
##### Examples
```
let mut byte = b'a';
byte.make_ascii_uppercase();
assert_eq!(b'A', byte);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#418)1.23.0 · #### pub fn make\_ascii\_lowercase(&mut self)
Converts this value 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`](primitive.u8#method.to_ascii_lowercase).
##### Examples
```
let mut byte = b'A';
byte.make_ascii_lowercase();
assert_eq!(b'a', byte);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#454)1.24.0 (const: 1.47.0) · #### pub const fn is\_ascii\_alphabetic(&self) -> bool
Checks if the value is an ASCII alphabetic character:
* U+0041 ‘A’ ..= U+005A ‘Z’, or
* U+0061 ‘a’ ..= U+007A ‘z’.
##### Examples
```
let uppercase_a = b'A';
let uppercase_g = b'G';
let a = b'a';
let g = b'g';
let zero = b'0';
let percent = b'%';
let space = b' ';
let lf = b'\n';
let esc = b'\x1b';
assert!(uppercase_a.is_ascii_alphabetic());
assert!(uppercase_g.is_ascii_alphabetic());
assert!(a.is_ascii_alphabetic());
assert!(g.is_ascii_alphabetic());
assert!(!zero.is_ascii_alphabetic());
assert!(!percent.is_ascii_alphabetic());
assert!(!space.is_ascii_alphabetic());
assert!(!lf.is_ascii_alphabetic());
assert!(!esc.is_ascii_alphabetic());
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#488)1.24.0 (const: 1.47.0) · #### pub const fn is\_ascii\_uppercase(&self) -> bool
Checks if the value is an ASCII uppercase character: U+0041 ‘A’ ..= U+005A ‘Z’.
##### Examples
```
let uppercase_a = b'A';
let uppercase_g = b'G';
let a = b'a';
let g = b'g';
let zero = b'0';
let percent = b'%';
let space = b' ';
let lf = b'\n';
let esc = b'\x1b';
assert!(uppercase_a.is_ascii_uppercase());
assert!(uppercase_g.is_ascii_uppercase());
assert!(!a.is_ascii_uppercase());
assert!(!g.is_ascii_uppercase());
assert!(!zero.is_ascii_uppercase());
assert!(!percent.is_ascii_uppercase());
assert!(!space.is_ascii_uppercase());
assert!(!lf.is_ascii_uppercase());
assert!(!esc.is_ascii_uppercase());
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#522)1.24.0 (const: 1.47.0) · #### pub const fn is\_ascii\_lowercase(&self) -> bool
Checks if the value is an ASCII lowercase character: U+0061 ‘a’ ..= U+007A ‘z’.
##### Examples
```
let uppercase_a = b'A';
let uppercase_g = b'G';
let a = b'a';
let g = b'g';
let zero = b'0';
let percent = b'%';
let space = b' ';
let lf = b'\n';
let esc = b'\x1b';
assert!(!uppercase_a.is_ascii_lowercase());
assert!(!uppercase_g.is_ascii_lowercase());
assert!(a.is_ascii_lowercase());
assert!(g.is_ascii_lowercase());
assert!(!zero.is_ascii_lowercase());
assert!(!percent.is_ascii_lowercase());
assert!(!space.is_ascii_lowercase());
assert!(!lf.is_ascii_lowercase());
assert!(!esc.is_ascii_lowercase());
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#559)1.24.0 (const: 1.47.0) · #### pub const fn is\_ascii\_alphanumeric(&self) -> bool
Checks if the value is an ASCII alphanumeric character:
* U+0041 ‘A’ ..= U+005A ‘Z’, or
* U+0061 ‘a’ ..= U+007A ‘z’, or
* U+0030 ‘0’ ..= U+0039 ‘9’.
##### Examples
```
let uppercase_a = b'A';
let uppercase_g = b'G';
let a = b'a';
let g = b'g';
let zero = b'0';
let percent = b'%';
let space = b' ';
let lf = b'\n';
let esc = b'\x1b';
assert!(uppercase_a.is_ascii_alphanumeric());
assert!(uppercase_g.is_ascii_alphanumeric());
assert!(a.is_ascii_alphanumeric());
assert!(g.is_ascii_alphanumeric());
assert!(zero.is_ascii_alphanumeric());
assert!(!percent.is_ascii_alphanumeric());
assert!(!space.is_ascii_alphanumeric());
assert!(!lf.is_ascii_alphanumeric());
assert!(!esc.is_ascii_alphanumeric());
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#593)1.24.0 (const: 1.47.0) · #### pub const fn is\_ascii\_digit(&self) -> bool
Checks if the value is an ASCII decimal digit: U+0030 ‘0’ ..= U+0039 ‘9’.
##### Examples
```
let uppercase_a = b'A';
let uppercase_g = b'G';
let a = b'a';
let g = b'g';
let zero = b'0';
let percent = b'%';
let space = b' ';
let lf = b'\n';
let esc = b'\x1b';
assert!(!uppercase_a.is_ascii_digit());
assert!(!uppercase_g.is_ascii_digit());
assert!(!a.is_ascii_digit());
assert!(!g.is_ascii_digit());
assert!(zero.is_ascii_digit());
assert!(!percent.is_ascii_digit());
assert!(!space.is_ascii_digit());
assert!(!lf.is_ascii_digit());
assert!(!esc.is_ascii_digit());
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#630)1.24.0 (const: 1.47.0) · #### pub const fn is\_ascii\_hexdigit(&self) -> bool
Checks if the value is an ASCII hexadecimal digit:
* U+0030 ‘0’ ..= U+0039 ‘9’, or
* U+0041 ‘A’ ..= U+0046 ‘F’, or
* U+0061 ‘a’ ..= U+0066 ‘f’.
##### Examples
```
let uppercase_a = b'A';
let uppercase_g = b'G';
let a = b'a';
let g = b'g';
let zero = b'0';
let percent = b'%';
let space = b' ';
let lf = b'\n';
let esc = b'\x1b';
assert!(uppercase_a.is_ascii_hexdigit());
assert!(!uppercase_g.is_ascii_hexdigit());
assert!(a.is_ascii_hexdigit());
assert!(!g.is_ascii_hexdigit());
assert!(zero.is_ascii_hexdigit());
assert!(!percent.is_ascii_hexdigit());
assert!(!space.is_ascii_hexdigit());
assert!(!lf.is_ascii_hexdigit());
assert!(!esc.is_ascii_hexdigit());
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#668)1.24.0 (const: 1.47.0) · #### pub const fn is\_ascii\_punctuation(&self) -> bool
Checks if the value is an ASCII punctuation character:
* U+0021 ..= U+002F `! " # $ % & ' ( ) * + , - . /`, or
* U+003A ..= U+0040 `: ; < = > ? @`, or
* U+005B ..= U+0060 `[ \ ] ^ _ ``, or
* U+007B ..= U+007E `{ | } ~`
##### Examples
```
let uppercase_a = b'A';
let uppercase_g = b'G';
let a = b'a';
let g = b'g';
let zero = b'0';
let percent = b'%';
let space = b' ';
let lf = b'\n';
let esc = b'\x1b';
assert!(!uppercase_a.is_ascii_punctuation());
assert!(!uppercase_g.is_ascii_punctuation());
assert!(!a.is_ascii_punctuation());
assert!(!g.is_ascii_punctuation());
assert!(!zero.is_ascii_punctuation());
assert!(percent.is_ascii_punctuation());
assert!(!space.is_ascii_punctuation());
assert!(!lf.is_ascii_punctuation());
assert!(!esc.is_ascii_punctuation());
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#702)1.24.0 (const: 1.47.0) · #### pub const fn is\_ascii\_graphic(&self) -> bool
Checks if the value is an ASCII graphic character: U+0021 ‘!’ ..= U+007E ‘~’.
##### Examples
```
let uppercase_a = b'A';
let uppercase_g = b'G';
let a = b'a';
let g = b'g';
let zero = b'0';
let percent = b'%';
let space = b' ';
let lf = b'\n';
let esc = b'\x1b';
assert!(uppercase_a.is_ascii_graphic());
assert!(uppercase_g.is_ascii_graphic());
assert!(a.is_ascii_graphic());
assert!(g.is_ascii_graphic());
assert!(zero.is_ascii_graphic());
assert!(percent.is_ascii_graphic());
assert!(!space.is_ascii_graphic());
assert!(!lf.is_ascii_graphic());
assert!(!esc.is_ascii_graphic());
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#753)1.24.0 (const: 1.47.0) · #### pub const fn is\_ascii\_whitespace(&self) -> bool
Checks if the value is an ASCII whitespace character: U+0020 SPACE, U+0009 HORIZONTAL TAB, U+000A LINE FEED, U+000C FORM FEED, or U+000D CARRIAGE RETURN.
Rust uses the WhatWG Infra Standard’s [definition of ASCII whitespace](https://infra.spec.whatwg.org/#ascii-whitespace). There are several other definitions in wide use. For instance, [the POSIX locale](https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap07.html#tag_07_03_01) includes U+000B VERTICAL TAB as well as all the above characters, but—from the very same specification—[the default rule for “field splitting” in the Bourne shell](https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_06_05) considers *only* SPACE, HORIZONTAL TAB, and LINE FEED as whitespace.
If you are writing a program that will process an existing file format, check what that format’s definition of whitespace is before using this function.
##### Examples
```
let uppercase_a = b'A';
let uppercase_g = b'G';
let a = b'a';
let g = b'g';
let zero = b'0';
let percent = b'%';
let space = b' ';
let lf = b'\n';
let esc = b'\x1b';
assert!(!uppercase_a.is_ascii_whitespace());
assert!(!uppercase_g.is_ascii_whitespace());
assert!(!a.is_ascii_whitespace());
assert!(!g.is_ascii_whitespace());
assert!(!zero.is_ascii_whitespace());
assert!(!percent.is_ascii_whitespace());
assert!(space.is_ascii_whitespace());
assert!(lf.is_ascii_whitespace());
assert!(!esc.is_ascii_whitespace());
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#789)1.24.0 (const: 1.47.0) · #### pub const fn is\_ascii\_control(&self) -> bool
Checks if the value is an ASCII control character: U+0000 NUL ..= U+001F UNIT SEPARATOR, or U+007F DELETE. Note that most ASCII whitespace characters are control characters, but SPACE is not.
##### Examples
```
let uppercase_a = b'A';
let uppercase_g = b'G';
let a = b'a';
let g = b'g';
let zero = b'0';
let percent = b'%';
let space = b' ';
let lf = b'\n';
let esc = b'\x1b';
assert!(!uppercase_a.is_ascii_control());
assert!(!uppercase_g.is_ascii_control());
assert!(!a.is_ascii_control());
assert!(!g.is_ascii_control());
assert!(!zero.is_ascii_control());
assert!(!percent.is_ascii_control());
assert!(!space.is_ascii_control());
assert!(lf.is_ascii_control());
assert!(esc.is_ascii_control());
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#815)1.60.0 · #### pub fn escape\_ascii(self) -> EscapeDefault
Notable traits for [EscapeDefault](ascii/struct.escapedefault "struct std::ascii::EscapeDefault")
```
impl Iterator for EscapeDefault
type Item = u8;
```
Returns an iterator that produces an escaped version of a `u8`, treating it as an ASCII character.
The behavior is identical to [`ascii::escape_default`](ascii/fn.escape_default "ascii::escape_default").
##### Examples
```
assert_eq!("0", b'0'.escape_ascii().to_string());
assert_eq!("\\t", b'\t'.escape_ascii().to_string());
assert_eq!("\\r", b'\r'.escape_ascii().to_string());
assert_eq!("\\n", b'\n'.escape_ascii().to_string());
assert_eq!("\\'", b'\''.escape_ascii().to_string());
assert_eq!("\\\"", b'"'.escape_ascii().to_string());
assert_eq!("\\\\", b'\\'.escape_ascii().to_string());
assert_eq!("\\x9d", b'\x9d'.escape_ascii().to_string());
```
Trait Implementations
---------------------
[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
The resulting type after applying the `+` operator.
[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") · #### fn add(self, other: &u8) -> <u8 as Add<u8>>::Output
Performs the `+` operation. [Read more](ops/trait.add#tymethod.add)
[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
The resulting type after applying the `+` operator.
[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") · #### fn add(self, other: &u8) -> <u8 as Add<u8>>::Output
Performs the `+` operation. [Read more](ops/trait.add#tymethod.add)
[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
The resulting type after applying the `+` operator.
[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") · #### fn add(self, other: u8) -> <u8 as Add<u8>>::Output
Performs the `+` operation. [Read more](ops/trait.add#tymethod.add)
[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
The resulting type after applying the `+` operator.
[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") · #### fn add(self, other: u8) -> u8
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<&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/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/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/ops/arith.rs.html#786)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/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/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/ops/arith.rs.html#786)1.8.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/ops/arith.rs.html#786)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/std/ascii.rs.html#180-184)### impl AsciiExt for u8
#### type Owned = u8
👎Deprecated since 1.26.0: use inherent methods instead
Container type for copied ASCII characters.
[source](https://doc.rust-lang.org/src/std/ascii.rs.html#183)#### fn is\_ascii(&self) -> bool
👎Deprecated since 1.26.0: use inherent methods instead
Checks if the value is within the ASCII range. [Read more](ascii/trait.asciiext#tymethod.is_ascii)
[source](https://doc.rust-lang.org/src/std/ascii.rs.html#183)#### fn to\_ascii\_uppercase(&self) -> Self::Owned
👎Deprecated since 1.26.0: use inherent methods instead
Makes a copy of the value in its ASCII upper case equivalent. [Read more](ascii/trait.asciiext#tymethod.to_ascii_uppercase)
[source](https://doc.rust-lang.org/src/std/ascii.rs.html#183)#### fn to\_ascii\_lowercase(&self) -> Self::Owned
👎Deprecated since 1.26.0: use inherent methods instead
Makes a copy of the value in its ASCII lower case equivalent. [Read more](ascii/trait.asciiext#tymethod.to_ascii_lowercase)
[source](https://doc.rust-lang.org/src/std/ascii.rs.html#183)#### fn eq\_ignore\_ascii\_case(&self, o: &Self) -> bool
👎Deprecated since 1.26.0: use inherent methods instead
Checks that two values are an ASCII case-insensitive match. [Read more](ascii/trait.asciiext#tymethod.eq_ignore_ascii_case)
[source](https://doc.rust-lang.org/src/std/ascii.rs.html#183)#### fn make\_ascii\_uppercase(&mut self)
👎Deprecated since 1.26.0: use inherent methods instead
Converts this type to its ASCII upper case equivalent in-place. [Read more](ascii/trait.asciiext#tymethod.make_ascii_uppercase)
[source](https://doc.rust-lang.org/src/std/ascii.rs.html#183)#### fn make\_ascii\_lowercase(&mut self)
👎Deprecated since 1.26.0: use inherent methods instead
Converts this type to its ASCII lower case equivalent in-place. [Read more](ascii/trait.asciiext#tymethod.make_ascii_lowercase)
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#175)### impl Binary for u8
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#175)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error>
Formats the value using the given formatter.
[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
The resulting type after applying the `&` operator.
[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") · #### fn bitand(self, other: &u8) -> <u8 as BitAnd<u8>>::Output
Performs the `&` operation. [Read more](ops/trait.bitand#tymethod.bitand)
[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
The resulting type after applying the `&` operator.
[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") · #### fn bitand(self, other: &u8) -> <u8 as BitAnd<u8>>::Output
Performs the `&` operation. [Read more](ops/trait.bitand#tymethod.bitand)
[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
The resulting type after applying the `&` operator.
[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") · #### fn bitand(self, other: u8) -> <u8 as BitAnd<u8>>::Output
Performs the `&` operation. [Read more](ops/trait.bitand#tymethod.bitand)
[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
The resulting type after applying the `&` operator.
[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") · #### fn bitand(self, rhs: u8) -> u8
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<&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/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/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/ops/bit.rs.html#734)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/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/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/ops/bit.rs.html#734)1.8.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/ops/bit.rs.html#734)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/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
The resulting type after applying the `|` operator.
[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") · #### fn bitor(self, other: &u8) -> <u8 as BitOr<u8>>::Output
Performs the `|` operation. [Read more](ops/trait.bitor#tymethod.bitor)
[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
The resulting type after applying the `|` operator.
[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") · #### fn bitor(self, other: &u8) -> <u8 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 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/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
The resulting type after applying the `|` operator.
[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") · #### fn bitor(self, other: u8) -> <u8 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 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/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
The resulting type after applying the `|` operator.
[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") · #### fn bitor(self, rhs: u8) -> u8
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<&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/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/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/ops/bit.rs.html#806)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/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/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/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/ops/bit.rs.html#806)1.8.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/ops/bit.rs.html#806)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/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
The resulting type after applying the `^` operator.
[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") · #### fn bitxor(self, other: &u8) -> <u8 as BitXor<u8>>::Output
Performs the `^` operation. [Read more](ops/trait.bitxor#tymethod.bitxor)
[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
The resulting type after applying the `^` operator.
[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") · #### fn bitxor(self, other: &u8) -> <u8 as BitXor<u8>>::Output
Performs the `^` operation. [Read more](ops/trait.bitxor#tymethod.bitxor)
[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
The resulting type after applying the `^` operator.
[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") · #### fn bitxor(self, other: u8) -> <u8 as BitXor<u8>>::Output
Performs the `^` operation. [Read more](ops/trait.bitxor#tymethod.bitxor)
[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
The resulting type after applying the `^` operator.
[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") · #### fn bitxor(self, other: u8) -> u8
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<&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/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/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/ops/bit.rs.html#878)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/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/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/ops/bit.rs.html#878)1.8.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/ops/bit.rs.html#878)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/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") · #### fn clone(&self) -> u8
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/num.rs.html#197-200)### impl Debug for u8
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#197-200)#### 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/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#208)const: [unstable](https://github.com/rust-lang/rust/issues/87864 "Tracking issue for const_default_impls") · #### fn default() -> u8
Returns the default value of `0`
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#461-464)### impl Display for u8
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#461-464)#### 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/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
The resulting type after applying the `/` operator.
[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") · #### fn div(self, other: &u8) -> <u8 as Div<u8>>::Output
Performs the `/` operation. [Read more](ops/trait.div#tymethod.div)
[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
The resulting type after applying the `/` operator.
[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") · #### fn div(self, other: &u8) -> <u8 as Div<u8>>::Output
Performs the `/` operation. [Read more](ops/trait.div#tymethod.div)
[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/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
The resulting type after applying the `/` operator.
[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") · #### fn div(self, other: u8) -> <u8 as Div<u8>>::Output
Performs the `/` operation. [Read more](ops/trait.div#tymethod.div)
[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
The resulting type after applying the `/` operator.
[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") · #### fn div(self, other: u8) -> u8
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<&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/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/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/ops/arith.rs.html#968)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/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/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/ops/arith.rs.html#968)1.8.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/ops/arith.rs.html#968)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/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/convert/num.rs.html#86)1.28.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<bool> for u8
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#86)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: bool) -> u8
Converts a `bool` to a `u8`. The resulting value is `0` for `false` and `1` for `true` values.
##### Examples
```
assert_eq!(u8::from(true), 1);
assert_eq!(u8::from(false), 0);
```
[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/87852 "Tracking issue for const_num_from_num")) · ### impl From<u8> for AtomicU8
[source](https://doc.rust-lang.org/src/core/sync/atomic.rs.html#2695-2713)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(v: u8) -> AtomicU8
Converts an `u8` into an `AtomicU8`.
[source](https://doc.rust-lang.org/src/std/process.rs.html#1814-1819)1.61.0 · ### impl From<u8> for ExitCode
[source](https://doc.rust-lang.org/src/std/process.rs.html#1816-1818)#### fn from(code: u8) -> Self
Construct an `ExitCode` from an arbitrary u8 value.
[source](https://doc.rust-lang.org/src/core/char/convert.rs.html#127)1.13.0 (const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert")) · ### impl From<u8> for char
Maps a byte in 0x00..=0xFF to a `char` whose code point has the same value, in U+0000..=U+00FF.
Unicode is designed such that this effectively decodes bytes with the character encoding that IANA calls ISO-8859-1. This encoding is compatible with ASCII.
Note that this is different from ISO/IEC 8859-1 a.k.a. ISO 8859-1 (with one less hyphen), which leaves some “blanks”, byte values that are not assigned to any character. ISO-8859-1 (the IANA one) assigns them to the C0 and C1 control codes.
Note that this is *also* different from Windows-1252 a.k.a. code page 1252, which is a superset ISO/IEC 8859-1 that assigns some (not all!) blanks to punctuation and various Latin characters.
To confuse things further, [on the Web](https://encoding.spec.whatwg.org/) `ascii`, `iso-8859-1`, and `windows-1252` are all aliases for a superset of Windows-1252 that fills the remaining blanks with corresponding C0 and C1 control codes.
[source](https://doc.rust-lang.org/src/core/char/convert.rs.html#140)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn from(i: u8) -> char
Converts a [`u8`](primitive.u8 "u8") into a [`char`](primitive.char "char").
##### Examples
```
use std::mem;
let u = 32 as u8;
let c = char::from(u);
assert!(4 == mem::size_of_val(&c))
```
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#162)1.6.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<u8> for f32
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#162)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: u8) -> f32
Converts `u8` to `f32` losslessly.
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#163)1.6.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<u8> for f64
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#163)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: u8) -> f64
Converts `u8` to `f64` losslessly.
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#129)1.26.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<u8> for i128
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#129)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: u8) -> i128
Converts `u8` to `i128` losslessly.
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#126)1.5.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<u8> for i16
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#126)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: u8) -> i16
Converts `u8` to `i16` losslessly.
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#127)1.5.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<u8> for i32
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#127)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: u8) -> i32
Converts `u8` to `i32` losslessly.
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#128)1.5.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<u8> for i64
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#128)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: u8) -> i64
Converts `u8` to `i64` losslessly.
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#141)1.26.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<u8> for isize
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#141)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: u8) -> isize
Converts `u8` to `isize` losslessly.
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#103)1.26.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<u8> for u128
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#103)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: u8) -> u128
Converts `u8` to `u128` losslessly.
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#100)1.5.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<u8> for u16
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#100)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: u8) -> u16
Converts `u8` to `u16` losslessly.
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#101)1.5.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<u8> for u32
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#101)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: u8) -> u32
Converts `u8` to `u32` losslessly.
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#102)1.5.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<u8> for u64
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#102)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: u8) -> u64
Converts `u8` to `u64` losslessly.
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#104)1.5.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<u8> for usize
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#104)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: u8) -> usize
Converts `u8` to `usize` losslessly.
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#1018)### impl FromStr for u8
#### type Err = ParseIntError
The associated error which can be returned from parsing.
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#1018)#### fn from\_str(src: &str) -> Result<u8, ParseIntError>
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/hash/mod.rs.html#829-842)### impl Hash for u8
[source](https://doc.rust-lang.org/src/core/hash/mod.rs.html#829-842)#### 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#829-842)#### fn hash\_slice<H>(data: &[u8], 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/fmt/num.rs.html#465-468)1.42.0 · ### impl LowerExp for u8
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#465-468)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error>
Formats the value using the given formatter.
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#175)### impl LowerHex for u8
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#175)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error>
Formats the value using the given formatter.
[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
The resulting type after applying the `*` operator.
[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") · #### fn mul(self, other: &u8) -> <u8 as Mul<u8>>::Output
Performs the `*` operation. [Read more](ops/trait.mul#tymethod.mul)
[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
The resulting type after applying the `*` operator.
[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") · #### fn mul(self, other: &u8) -> <u8 as Mul<u8>>::Output
Performs the `*` operation. [Read more](ops/trait.mul#tymethod.mul)
[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
The resulting type after applying the `*` operator.
[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") · #### fn mul(self, other: u8) -> <u8 as Mul<u8>>::Output
Performs the `*` operation. [Read more](ops/trait.mul#tymethod.mul)
[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
The resulting type after applying the `*` operator.
[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") · #### fn mul(self, other: u8) -> u8
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<&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/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/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/ops/arith.rs.html#911)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/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/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/ops/arith.rs.html#911)1.8.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/ops/arith.rs.html#911)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/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
The resulting type after applying the `!` operator.
[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") · #### fn not(self) -> <u8 as Not>::Output
Performs the unary `!` operation. [Read more](ops/trait.not#tymethod.not)
[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
The resulting type after applying the `!` operator.
[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") · #### fn not(self) -> u8
Performs the unary `!` operation. [Read more](ops/trait.not#tymethod.not)
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#175)### impl Octal for u8
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#175)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error>
Formats the value using the given formatter.
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1486)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · ### impl Ord for u8
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1486)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · #### fn cmp(&self, other: &u8) -> 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/cmp.rs.html#1366-1368)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · ### impl PartialEq<u8> for u8
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1366-1368)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · #### fn eq(&self, other: &u8) -> 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#1366-1368)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · #### fn ne(&self, other: &u8) -> 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/cmp.rs.html#1486)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · ### impl PartialOrd<u8> for u8
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1486)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · #### fn partial\_cmp(&self, other: &u8) -> 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#1486)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · #### fn lt(&self, other: &u8) -> 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#1486)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · #### fn le(&self, other: &u8) -> 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#1486)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · #### fn ge(&self, other: &u8) -> 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/cmp.rs.html#1486)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · #### fn gt(&self, other: &u8) -> 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/iter/traits/accum.rs.html#141)1.12.0 · ### impl<'a> Product<&'a u8> for u8
[source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)#### fn product<I>(iter: I) -> u8where I: [Iterator](iter/trait.iterator "trait std::iter::Iterator")<Item = &'a [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.12.0 · ### impl Product<u8> for u8
[source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)#### fn product<I>(iter: I) -> u8where I: [Iterator](iter/trait.iterator "trait std::iter::Iterator")<Item = [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/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
The resulting type after applying the `%` operator.
[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") · #### fn rem(self, other: &u8) -> <u8 as Rem<u8>>::Output
Performs the `%` operation. [Read more](ops/trait.rem#tymethod.rem)
[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
The resulting type after applying the `%` operator.
[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") · #### fn rem(self, other: &u8) -> <u8 as Rem<u8>>::Output
Performs the `%` operation. [Read more](ops/trait.rem#tymethod.rem)
[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/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
The resulting type after applying the `%` operator.
[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") · #### fn rem(self, other: u8) -> <u8 as Rem<u8>>::Output
Performs the `%` operation. [Read more](ops/trait.rem#tymethod.rem)
[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
The resulting type after applying the `%` operator.
[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") · #### fn rem(self, other: u8) -> u8
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<&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/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/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/ops/arith.rs.html#1029)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/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/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/ops/arith.rs.html#1029)1.8.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/ops/arith.rs.html#1029)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/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i128) -> <u8 as Shl<i128>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i128) -> <u8 as Shl<i128>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i16) -> <u8 as Shl<i16>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i16) -> <u8 as Shl<i16>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i32) -> <u8 as Shl<i32>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i32) -> <u8 as Shl<i32>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i64) -> <u8 as Shl<i64>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i64) -> <u8 as Shl<i64>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i8) -> <u8 as Shl<i8>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i8) -> <u8 as Shl<i8>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &isize) -> <u8 as Shl<isize>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &isize) -> <u8 as Shl<isize>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u128) -> <u8 as Shl<u128>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u128) -> <u8 as Shl<u128>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u16) -> <u8 as Shl<u16>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u16) -> <u8 as Shl<u16>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u32) -> <u8 as Shl<u32>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u32) -> <u8 as Shl<u32>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u64) -> <u8 as Shl<u64>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u64) -> <u8 as Shl<u64>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u8) -> <i128 as Shl<u8>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u8) -> <i16 as Shl<u8>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u8) -> <i32 as Shl<u8>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u8) -> <i64 as Shl<u8>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u8) -> <i8 as Shl<u8>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u8) -> <isize as Shl<u8>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u8) -> <u128 as Shl<u8>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u8) -> <u16 as Shl<u8>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u8) -> <u32 as Shl<u8>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u8) -> <u64 as Shl<u8>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u8) -> <u8 as Shl<u8>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u8) -> <usize as Shl<u8>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u8) -> <i128 as Shl<u8>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u8) -> <i16 as Shl<u8>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u8) -> <i32 as Shl<u8>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u8) -> <i64 as Shl<u8>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u8) -> <i8 as Shl<u8>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u8) -> <isize as Shl<u8>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u8) -> <u128 as Shl<u8>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u8) -> <u16 as Shl<u8>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u8) -> <u32 as Shl<u8>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u8) -> <u64 as Shl<u8>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u8) -> <u8 as Shl<u8>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u8) -> <usize as Shl<u8>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &usize) -> <u8 as Shl<usize>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &usize) -> <u8 as Shl<usize>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i128) -> <u8 as Shl<i128>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i128) -> u8
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i16) -> <u8 as Shl<i16>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i16) -> u8
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i32) -> <u8 as Shl<i32>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i32) -> u8
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i64) -> <u8 as Shl<i64>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i64) -> u8
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i8) -> <u8 as Shl<i8>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i8) -> u8
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: isize) -> <u8 as Shl<isize>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: isize) -> u8
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u128) -> <u8 as Shl<u128>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u128) -> u8
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u16) -> <u8 as Shl<u16>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u16) -> u8
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u32) -> <u8 as Shl<u32>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u32) -> u8
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u64) -> <u8 as Shl<u64>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u64) -> u8
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u8) -> <i128 as Shl<u8>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u8) -> <i16 as Shl<u8>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u8) -> <i32 as Shl<u8>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u8) -> <i64 as Shl<u8>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u8) -> <i8 as Shl<u8>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u8) -> <isize as Shl<u8>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u8) -> <u128 as Shl<u8>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u8) -> <u16 as Shl<u8>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u8) -> <u32 as Shl<u8>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u8) -> <u64 as Shl<u8>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u8) -> <u8 as Shl<u8>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u8) -> <usize as Shl<u8>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u8) -> i128
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u8) -> i16
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u8) -> i32
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u8) -> i64
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u8) -> i8
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u8) -> isize
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u8) -> u128
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u8) -> u16
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u8) -> u32
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u8) -> u64
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u8) -> u8
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u8) -> usize
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: usize) -> <u8 as Shl<usize>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: usize) -> u8
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &i128)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &i16)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &i32)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &i64)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &i8)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &isize)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &u128)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &u16)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &u32)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &u64)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &u8)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &u8)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &u8)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &u8)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &u8)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &u8)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &u8)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &u8)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &u8)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &u8)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &u8)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &u8)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)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/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: i128)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: i16)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: i32)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: i64)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: i8)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: isize)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: u128)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: u16)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: u32)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: u64)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: u8)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: u8)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: u8)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: u8)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: u8)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: u8)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: u8)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: u8)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: u8)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: u8)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: u8)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: u8)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)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/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i128) -> <u8 as Shr<i128>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i128) -> <u8 as Shr<i128>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i16) -> <u8 as Shr<i16>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i16) -> <u8 as Shr<i16>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i32) -> <u8 as Shr<i32>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i32) -> <u8 as Shr<i32>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i64) -> <u8 as Shr<i64>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i64) -> <u8 as Shr<i64>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i8) -> <u8 as Shr<i8>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i8) -> <u8 as Shr<i8>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &isize) -> <u8 as Shr<isize>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &isize) -> <u8 as Shr<isize>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u128) -> <u8 as Shr<u128>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u128) -> <u8 as Shr<u128>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u16) -> <u8 as Shr<u16>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u16) -> <u8 as Shr<u16>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u32) -> <u8 as Shr<u32>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u32) -> <u8 as Shr<u32>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u64) -> <u8 as Shr<u64>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u64) -> <u8 as Shr<u64>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u8) -> <i128 as Shr<u8>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u8) -> <i16 as Shr<u8>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u8) -> <i32 as Shr<u8>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u8) -> <i64 as Shr<u8>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u8) -> <i8 as Shr<u8>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u8) -> <isize as Shr<u8>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u8) -> <u128 as Shr<u8>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u8) -> <u16 as Shr<u8>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u8) -> <u32 as Shr<u8>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u8) -> <u64 as Shr<u8>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u8) -> <u8 as Shr<u8>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u8) -> <usize as Shr<u8>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u8) -> <i128 as Shr<u8>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u8) -> <i16 as Shr<u8>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u8) -> <i32 as Shr<u8>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u8) -> <i64 as Shr<u8>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u8) -> <i8 as Shr<u8>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u8) -> <isize as Shr<u8>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u8) -> <u128 as Shr<u8>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u8) -> <u16 as Shr<u8>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u8) -> <u32 as Shr<u8>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u8) -> <u64 as Shr<u8>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u8) -> <u8 as Shr<u8>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u8) -> <usize as Shr<u8>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &usize) -> <u8 as Shr<usize>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &usize) -> <u8 as Shr<usize>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i128) -> <u8 as Shr<i128>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i128) -> u8
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i16) -> <u8 as Shr<i16>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i16) -> u8
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i32) -> <u8 as Shr<i32>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i32) -> u8
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i64) -> <u8 as Shr<i64>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i64) -> u8
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i8) -> <u8 as Shr<i8>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i8) -> u8
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: isize) -> <u8 as Shr<isize>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: isize) -> u8
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u128) -> <u8 as Shr<u128>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u128) -> u8
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u16) -> <u8 as Shr<u16>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u16) -> u8
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u32) -> <u8 as Shr<u32>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u32) -> u8
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u64) -> <u8 as Shr<u64>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u64) -> u8
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u8) -> <i128 as Shr<u8>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u8) -> <i16 as Shr<u8>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u8) -> <i32 as Shr<u8>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u8) -> <i64 as Shr<u8>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u8) -> <i8 as Shr<u8>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u8) -> <isize as Shr<u8>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u8) -> <u128 as Shr<u8>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u8) -> <u16 as Shr<u8>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u8) -> <u32 as Shr<u8>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u8) -> <u64 as Shr<u8>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u8) -> <u8 as Shr<u8>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u8) -> <usize as Shr<u8>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u8) -> i128
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u8) -> i16
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u8) -> i32
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u8) -> i64
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u8) -> i8
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u8) -> isize
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u8) -> u128
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u8) -> u16
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u8) -> u32
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u8) -> u64
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u8) -> u8
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u8) -> usize
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: usize) -> <u8 as Shr<usize>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: usize) -> u8
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &i128)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &i16)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &i32)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &i64)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &i8)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &isize)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &u128)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &u16)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &u32)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &u64)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &u8)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &u8)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &u8)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &u8)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &u8)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &u8)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &u8)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &u8)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &u8)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &u8)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &u8)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &u8)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)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/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: i128)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: i16)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: i32)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: i64)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: i8)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: isize)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: u128)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: u16)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: u32)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: u64)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: u8)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: u8)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: u8)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: u8)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: u8)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: u8)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: u8)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: u8)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: u8)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: u8)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: u8)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: u8)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)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/up/up/portable-simd/crates/core_simd/src/vector.rs.html#663)### impl SimdElement for u8
#### type Mask = i8
🔬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.
[source](https://doc.rust-lang.org/src/core/iter/range.rs.html#391-394)### impl Step for u8
[source](https://doc.rust-lang.org/src/core/iter/range.rs.html#391-394)#### unsafe fn forward\_unchecked(start: u8, n: usize) -> u8
🔬This is a nightly-only experimental API. (`step_trait` [#42168](https://github.com/rust-lang/rust/issues/42168))
Returns the value that would be obtained by taking the *successor* of `self` `count` times. [Read more](iter/trait.step#method.forward_unchecked)
[source](https://doc.rust-lang.org/src/core/iter/range.rs.html#391-394)#### unsafe fn backward\_unchecked(start: u8, n: usize) -> u8
🔬This is a nightly-only experimental API. (`step_trait` [#42168](https://github.com/rust-lang/rust/issues/42168))
Returns the value that would be obtained by taking the *predecessor* of `self` `count` times. [Read more](iter/trait.step#method.backward_unchecked)
[source](https://doc.rust-lang.org/src/core/iter/range.rs.html#391-394)#### fn forward(start: u8, n: usize) -> u8
🔬This is a nightly-only experimental API. (`step_trait` [#42168](https://github.com/rust-lang/rust/issues/42168))
Returns the value that would be obtained by taking the *successor* of `self` `count` times. [Read more](iter/trait.step#method.forward)
[source](https://doc.rust-lang.org/src/core/iter/range.rs.html#391-394)#### fn backward(start: u8, n: usize) -> u8
🔬This is a nightly-only experimental API. (`step_trait` [#42168](https://github.com/rust-lang/rust/issues/42168))
Returns the value that would be obtained by taking the *predecessor* of `self` `count` times. [Read more](iter/trait.step#method.backward)
[source](https://doc.rust-lang.org/src/core/iter/range.rs.html#391-394)#### fn steps\_between(start: &u8, end: &u8) -> Option<usize>
🔬This is a nightly-only experimental API. (`step_trait` [#42168](https://github.com/rust-lang/rust/issues/42168))
Returns the number of *successor* steps required to get from `start` to `end`. [Read more](iter/trait.step#tymethod.steps_between)
[source](https://doc.rust-lang.org/src/core/iter/range.rs.html#391-394)#### fn forward\_checked(start: u8, n: usize) -> Option<u8>
🔬This is a nightly-only experimental API. (`step_trait` [#42168](https://github.com/rust-lang/rust/issues/42168))
Returns the value that would be obtained by taking the *successor* of `self` `count` times. [Read more](iter/trait.step#tymethod.forward_checked)
[source](https://doc.rust-lang.org/src/core/iter/range.rs.html#391-394)#### fn backward\_checked(start: u8, n: usize) -> Option<u8>
🔬This is a nightly-only experimental API. (`step_trait` [#42168](https://github.com/rust-lang/rust/issues/42168))
Returns the value that would be obtained by taking the *predecessor* of `self` `count` times. [Read more](iter/trait.step#tymethod.backward_checked)
[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
The resulting type after applying the `-` operator.
[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") · #### fn sub(self, other: &u8) -> <u8 as Sub<u8>>::Output
Performs the `-` operation. [Read more](ops/trait.sub#tymethod.sub)
[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
The resulting type after applying the `-` operator.
[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") · #### fn sub(self, other: &u8) -> <u8 as Sub<u8>>::Output
Performs the `-` operation. [Read more](ops/trait.sub#tymethod.sub)
[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
The resulting type after applying the `-` operator.
[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") · #### fn sub(self, other: u8) -> <u8 as Sub<u8>>::Output
Performs the `-` operation. [Read more](ops/trait.sub#tymethod.sub)
[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
The resulting type after applying the `-` operator.
[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") · #### fn sub(self, other: u8) -> u8
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<&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/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/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/ops/arith.rs.html#853)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/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/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/ops/arith.rs.html#853)1.8.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/ops/arith.rs.html#853)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/iter/traits/accum.rs.html#141)1.12.0 · ### impl<'a> Sum<&'a u8> for u8
[source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)#### fn sum<I>(iter: I) -> u8where I: [Iterator](iter/trait.iterator "trait std::iter::Iterator")<Item = &'a [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.12.0 · ### impl Sum<u8> for u8
[source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)#### fn sum<I>(iter: I) -> u8where I: [Iterator](iter/trait.iterator "trait std::iter::Iterator")<Item = [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/alloc/string.rs.html#2527)1.54.0 · ### impl ToString for u8
[source](https://doc.rust-lang.org/src/alloc/string.rs.html#2529)#### 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/char/convert.rs.html#98)1.59.0 · ### impl TryFrom<char> for u8
Map `char` with code point in U+0000..=U+00FF to byte in 0x00..=0xFF with same value, failing if the code point is greater than U+00FF.
See [`impl From<u8> for char`](primitive.char#impl-From%3Cu8%3E-for-char) for details on the encoding.
#### type Error = TryFromCharError
The type returned in the event of a conversion error.
[source](https://doc.rust-lang.org/src/core/char/convert.rs.html#102)#### fn try\_from(c: char) -> Result<u8, <u8 as TryFrom<char>>::Error>
Performs the conversion.
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#294)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<i128> for u8
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#294)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: i128) -> Result<u8, <u8 as TryFrom<i128>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#291)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<i16> for u8
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#291)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: i16) -> Result<u8, <u8 as TryFrom<i16>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#292)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<i32> for u8
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#292)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: i32) -> Result<u8, <u8 as TryFrom<i32>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#293)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<i64> for u8
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#293)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: i64) -> Result<u8, <u8 as TryFrom<i64>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#286)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<i8> for u8
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#286)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: i8) -> Result<u8, <u8 as TryFrom<i8>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#359)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<isize> for u8
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#359)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: isize) -> Result<u8, <u8 as TryFrom<isize>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#271)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<u128> for u8
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#271)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: u128) -> Result<u8, <u8 as TryFrom<u128>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#268)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<u16> for u8
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#268)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: u16) -> Result<u8, <u8 as TryFrom<u16>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#269)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<u32> for u8
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#269)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: u32) -> Result<u8, <u8 as TryFrom<u32>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#270)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<u64> for u8
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#270)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: u64) -> Result<u8, <u8 as TryFrom<u64>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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/convert/num.rs.html#279)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<u8> for i8
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#279)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: u8) -> Result<i8, <i8 as TryFrom<u8>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#354)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<usize> for u8
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#354)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: usize) -> Result<u8, <u8 as TryFrom<usize>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### type Error = TryFromIntError
The type returned in the event of a conversion error.
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#465-468)1.42.0 · ### impl UpperExp for u8
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#465-468)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error>
Formats the value using the given formatter.
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#175)### impl UpperHex for u8
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#175)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error>
Formats the value using the given formatter.
[source](https://doc.rust-lang.org/src/core/marker.rs.html#830-835)### impl Copy for u8
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1377)### impl Eq for u8
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#38)### impl FloatToInt<u8> for f32
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#39)### impl FloatToInt<u8> for f64
[source](https://doc.rust-lang.org/src/core/iter/range.rs.html#17)### impl TrustedStep for u8
Auto Trait Implementations
--------------------------
### impl RefUnwindSafe for u8
### impl Send for u8
### impl Sync for u8
### impl Unpin for u8
### impl UnwindSafe for u8
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 Macro std::format_args_nl Macro std::format\_args\_nl
===========================
```
macro_rules! format_args_nl {
($fmt:expr) => { ... };
($fmt:expr, $($args:tt)*) => { ... };
}
```
🔬This is a nightly-only experimental API. (`format_args_nl`)
Same as [`format_args`](macro.format_args "format_args"), but adds a newline in the end.
rust Keyword continue Keyword continue
================
Skip to the next iteration of a loop.
When `continue` is encountered, the current iteration is terminated, returning control to the loop head, typically continuing with the next iteration.
```
// Printing odd numbers by skipping even ones
for number in 1..=10 {
if number % 2 == 0 {
continue;
}
println!("{number}");
}
```
Like `break`, `continue` is normally associated with the innermost enclosing loop, but labels may be used to specify the affected loop.
```
// Print Odd numbers under 30 with unit <= 5
'tens: for ten in 0..3 {
'_units: for unit in 0..=9 {
if unit % 2 == 0 {
continue;
}
if unit > 5 {
continue 'tens;
}
println!("{}", ten * 10 + unit);
}
}
```
See [continue expressions](../reference/expressions/loop-expr#continue-expressions) from the reference for more details.
rust Crate std Crate std
=========
The Rust Standard Library
-------------------------
The Rust Standard Library is the foundation of portable Rust software, a set of minimal and battle-tested shared abstractions for the [broader Rust ecosystem](https://crates.io). It offers core types, like [`Vec<T>`](vec/struct.vec) and [`Option<T>`](option/enum.option), library-defined [operations on language primitives](#primitives), [standard macros](#macros), [I/O](io/index) and [multithreading](thread/index), among [many other things](#what-is-in-the-standard-library-documentation).
`std` is available to all Rust crates by default. Therefore, the standard library can be accessed in [`use`](../book/ch07-02-defining-modules-to-control-scope-and-privacy) statements through the path `std`, as in [`use std::env`](env/index).
How to read this documentation
------------------------------
If you already know the name of what you are looking for, the fastest way to find it is to use the [search bar](#) at the top of the page.
Otherwise, you may want to jump to one of these useful sections:
* [`std::*` modules](#modules)
* [Primitive types](#primitives)
* [Standard macros](#macros)
* [The Rust Prelude](prelude/index)
If this is your first time, the documentation for the standard library is written to be casually perused. Clicking on interesting things should generally lead you to interesting places. Still, there are important bits you don’t want to miss, so read on for a tour of the standard library and its documentation!
Once you are familiar with the contents of the standard library you may begin to find the verbosity of the prose distracting. At this stage in your development you may want to press the `[-]` button near the top of the page to collapse it into a more skimmable view.
While you are looking at that `[-]` button also notice the `source` link. Rust’s API documentation comes with the source code and you are encouraged to read it. The standard library source is generally high quality and a peek behind the curtains is often enlightening.
What is in the standard library documentation?
----------------------------------------------
First of all, The Rust Standard Library is divided into a number of focused modules, [all listed further down this page](#modules). These modules are the bedrock upon which all of Rust is forged, and they have mighty names like [`std::slice`](slice/index) and [`std::cmp`](cmp/index). Modules’ documentation typically includes an overview of the module along with examples, and are a smart place to start familiarizing yourself with the library.
Second, implicit methods on [primitive types](../book/ch03-02-data-types) are documented here. This can be a source of confusion for two reasons:
1. While primitives are implemented by the compiler, the standard library implements methods directly on the primitive types (and it is the only library that does so), which are [documented in the section on primitives](#primitives).
2. The standard library exports many modules *with the same name as primitive types*. These define additional items related to the primitive type, but not the all-important methods.
So for example there is a [page for the primitive type `i32`](primitive.i32) that lists all the methods that can be called on 32-bit integers (very useful), and there is a [page for the module `std::i32`](i32/index) that documents the constant values [`MIN`](i32/constant.min) and [`MAX`](i32/constant.max) (rarely useful).
Note the documentation for the primitives [`str`](primitive.str) and [`[T]`](primitive.slice "slice") (also called ‘slice’). Many method calls on [`String`](string/struct.string "String") and [`Vec<T>`](vec/struct.vec) are actually calls to methods on [`str`](primitive.str) and [`[T]`](primitive.slice "slice") respectively, via [deref coercions](../book/ch15-02-deref#implicit-deref-coercions-with-functions-and-methods).
Third, the standard library defines [The Rust Prelude](prelude/index), a small collection of items - mostly traits - that are imported into every module of every crate. The traits in the prelude are pervasive, making the prelude documentation a good entry point to learning about the library.
And finally, the standard library exports a number of standard macros, and [lists them on this page](#macros) (technically, not all of the standard macros are defined by the standard library - some are defined by the compiler - but they are documented here the same). Like the prelude, the standard macros are imported by default into all crates.
Contributing changes to the documentation
-----------------------------------------
Check out the rust contribution guidelines [here](https://rustc-dev-guide.rust-lang.org/contributing.html#writing-documentation). The source for this documentation can be found on [GitHub](https://github.com/rust-lang/rust). To contribute changes, make sure you read the guidelines first, then submit pull-requests for your suggested changes.
Contributions are appreciated! If you see a part of the docs that can be improved, submit a PR, or chat with us first on [Discord](https://discord.gg/rust-lang) #docs.
A Tour of The Rust Standard Library
-----------------------------------
The rest of this crate documentation is dedicated to pointing out notable features of The Rust Standard Library.
### Containers and collections
The [`option`](option/index "option") and [`result`](result/index "result") modules define optional and error-handling types, [`Option<T>`](option/enum.option) and [`Result<T, E>`](result/enum.result). The [`iter`](iter/index "iter") module defines Rust’s iterator trait, [`Iterator`](iter/trait.iterator "Iterator"), which works with the [`for`](../book/ch03-05-control-flow#looping-through-a-collection-with-for) loop to access collections.
The standard library exposes three common ways to deal with contiguous regions of memory:
* [`Vec<T>`](vec/struct.vec) - A heap-allocated *vector* that is resizable at runtime.
* [`[T; N]`](primitive.array "array") - An inline *array* with a fixed size at compile time.
* [`[T]`](primitive.slice "slice") - A dynamically sized *slice* into any other kind of contiguous storage, whether heap-allocated or not.
Slices can only be handled through some kind of *pointer*, and as such come in many flavors such as:
* `&[T]` - *shared slice*
* `&mut [T]` - *mutable slice*
* [`Box<[T]>`](boxed/index) - *owned slice*
[`str`](primitive.str), a UTF-8 string slice, is a primitive type, and the standard library defines many methods for it. Rust [`str`](primitive.str)s are typically accessed as immutable references: `&str`. Use the owned [`String`](string/struct.string "String") for building and mutating strings.
For converting to strings use the [`format!`](macro.format "format!") macro, and for converting from strings use the [`FromStr`](str/trait.fromstr) trait.
Data may be shared by placing it in a reference-counted box or the [`Rc`](rc/struct.rc) type, and if further contained in a [`Cell`](cell/struct.cell) or [`RefCell`](cell/struct.refcell), may be mutated as well as shared. Likewise, in a concurrent setting it is common to pair an atomically-reference-counted box, [`Arc`](sync/struct.arc), with a [`Mutex`](sync/struct.mutex) to get the same effect.
The [`collections`](collections/index "collections") module defines maps, sets, linked lists and other typical collection types, including the common [`HashMap<K, V>`](collections/hash_map/struct.hashmap).
### Platform abstractions and I/O
Besides basic data types, the standard library is largely concerned with abstracting over differences in common platforms, most notably Windows and Unix derivatives.
Common types of I/O, including [files](fs/struct.file), [TCP](net/struct.tcpstream), [UDP](net/struct.udpsocket), are defined in the [`io`](io/index "io"), [`fs`](fs/index "fs"), and [`net`](net/index "net") modules.
The [`thread`](thread/index "thread") module contains Rust’s threading abstractions. [`sync`](sync/index "sync") contains further primitive shared memory types, including [`atomic`](sync/atomic/index) and [`mpsc`](sync/mpsc/index), which contains the channel types for message passing.
Primitive Types
---------------
[never](primitive.never "std::never primitive")Experimental
The `!` type, also called “never”.
[array](primitive.array "std::array primitive")
A fixed-size array, denoted `[T; N]`, for the element type, `T`, and the non-negative compile-time constant size, `N`.
[bool](primitive.bool "std::bool primitive")
The boolean type.
[char](primitive.char "std::char primitive")
A character type.
[f32](primitive.f32 "std::f32 primitive")
A 32-bit floating point type (specifically, the “binary32” type defined in IEEE 754-2008).
[f64](primitive.f64 "std::f64 primitive")
A 64-bit floating point type (specifically, the “binary64” type defined in IEEE 754-2008).
[fn](primitive.fn "std::fn primitive")
Function pointers, like `fn(usize) -> bool`.
[i8](primitive.i8 "std::i8 primitive")
The 8-bit signed integer type.
[i16](primitive.i16 "std::i16 primitive")
The 16-bit signed integer type.
[i32](primitive.i32 "std::i32 primitive")
The 32-bit signed integer type.
[i64](primitive.i64 "std::i64 primitive")
The 64-bit signed integer type.
[i128](primitive.i128 "std::i128 primitive")
The 128-bit signed integer type.
[isize](primitive.isize "std::isize primitive")
The pointer-sized signed integer type.
[pointer](primitive.pointer "std::pointer primitive")
Raw, unsafe pointers, `*const T`, and `*mut T`.
[reference](primitive.reference "std::reference primitive")
References, `&T` and `&mut T`.
[slice](primitive.slice "std::slice primitive")
A dynamically-sized view into a contiguous sequence, `[T]`. Contiguous here means that elements are laid out so that every element is the same distance from its neighbors.
[str](primitive.str "std::str primitive")
String slices.
[tuple](primitive.tuple "std::tuple primitive")
A finite heterogeneous sequence, `(T, U, ..)`.
[u8](primitive.u8 "std::u8 primitive")
The 8-bit unsigned integer type.
[u16](primitive.u16 "std::u16 primitive")
The 16-bit unsigned integer type.
[u32](primitive.u32 "std::u32 primitive")
The 32-bit unsigned integer type.
[u64](primitive.u64 "std::u64 primitive")
The 64-bit unsigned integer type.
[u128](primitive.u128 "std::u128 primitive")
The 128-bit unsigned integer type.
[unit](primitive.unit "std::unit primitive")
The `()` type, also called “unit”.
[usize](primitive.usize "std::usize primitive")
The pointer-sized unsigned integer type.
Modules
-------
[assert\_matches](assert_matches/index "std::assert_matches mod")Experimental
Unstable module containing the unstable `assert_matches` macro.
[async\_iter](async_iter/index "std::async_iter mod")Experimental
Composable asynchronous iteration.
[intrinsics](intrinsics/index "std::intrinsics mod")Experimental
Compiler intrinsics.
[lazy](lazy/index "std::lazy mod")Experimental
Lazy values and one-time initialization of static data.
[simd](simd/index "std::simd mod")Experimental
Portable SIMD module.
[alloc](alloc/index "std::alloc mod")
Memory allocation APIs.
[any](any/index "std::any mod")
Utilities for dynamic typing or type reflection.
[arch](arch/index "std::arch mod")
SIMD and vendor intrinsics module.
[array](array/index "std::array mod")
Utilities for the array primitive type.
[ascii](ascii/index "std::ascii mod")
Operations on ASCII strings and characters.
[backtrace](backtrace/index "std::backtrace mod")
Support for capturing a stack backtrace of an OS thread
[borrow](borrow/index "std::borrow mod")
A module for working with borrowed data.
[boxed](boxed/index "std::boxed mod")
The `Box<T>` type for heap allocation.
[cell](cell/index "std::cell mod")
Shareable mutable containers.
[char](char/index "std::char mod")
Utilities for the `char` primitive type.
[clone](clone/index "std::clone mod")
The `Clone` trait for types that cannot be ‘implicitly copied’.
[cmp](cmp/index "std::cmp mod")
Utilities for comparing and ordering values.
[collections](collections/index "std::collections mod")
Collection types.
[convert](convert/index "std::convert mod")
Traits for conversions between types.
[default](default/index "std::default mod")
The `Default` trait for types with a default value.
[env](env/index "std::env mod")
Inspection and manipulation of the process’s environment.
[error](error/index "std::error mod")
Interfaces for working with Errors.
[f32](f32/index "std::f32 mod")
Constants for the `f32` single-precision floating point type.
[f64](f64/index "std::f64 mod")
Constants for the `f64` double-precision floating point type.
[ffi](ffi/index "std::ffi mod")
Utilities related to FFI bindings.
[fmt](fmt/index "std::fmt mod")
Utilities for formatting and printing `String`s.
[fs](fs/index "std::fs mod")
Filesystem manipulation operations.
[future](future/index "std::future mod")
Asynchronous basic functionality.
[hash](hash/index "std::hash mod")
Generic hashing support.
[hint](hint/index "std::hint mod")
Hints to compiler that affects how code should be emitted or optimized. Hints may be compile time or runtime.
[i8](i8/index "std::i8 mod")Deprecation planned
Constants for the 8-bit signed integer type.
[i16](i16/index "std::i16 mod")Deprecation planned
Constants for the 16-bit signed integer type.
[i32](i32/index "std::i32 mod")Deprecation planned
Constants for the 32-bit signed integer type.
[i64](i64/index "std::i64 mod")Deprecation planned
Constants for the 64-bit signed integer type.
[i128](i128/index "std::i128 mod")Deprecation planned
Constants for the 128-bit signed integer type.
[io](io/index "std::io mod")
Traits, helpers, and type definitions for core I/O functionality.
[isize](isize/index "std::isize mod")Deprecation planned
Constants for the pointer-sized signed integer type.
[iter](iter/index "std::iter mod")
Composable external iteration.
[marker](marker/index "std::marker mod")
Primitive traits and types representing basic properties of types.
[mem](mem/index "std::mem mod")
Basic functions for dealing with memory.
[net](net/index "std::net mod")
Networking primitives for TCP/UDP communication.
[num](num/index "std::num mod")
Additional functionality for numerics.
[ops](ops/index "std::ops mod")
Overloadable operators.
[option](option/index "std::option mod")
Optional values.
[os](os/index "std::os mod")
OS-specific functionality.
[panic](panic/index "std::panic mod")
Panic support in the standard library.
[path](path/index "std::path mod")
Cross-platform path manipulation.
[pin](pin/index "std::pin mod")
Types that pin data to its location in memory.
[prelude](prelude/index "std::prelude mod")
The Rust Prelude
[primitive](primitive/index "std::primitive mod")
This module reexports the primitive types to allow usage that is not possibly shadowed by other declared types.
[process](process/index "std::process mod")
A module for working with processes.
[ptr](ptr/index "std::ptr mod")
Manually manage memory through raw pointers.
[rc](rc/index "std::rc mod")
Single-threaded reference-counting pointers. ‘Rc’ stands for ‘Reference Counted’.
[result](result/index "std::result mod")
Error handling with the `Result` type.
[slice](slice/index "std::slice mod")
Utilities for the slice primitive type.
[str](str/index "std::str mod")
Utilities for the `str` primitive type.
[string](string/index "std::string mod")
A UTF-8–encoded, growable string.
[sync](sync/index "std::sync mod")
Useful synchronization primitives.
[task](task/index "std::task mod")
Types and Traits for working with asynchronous tasks.
[thread](thread/index "std::thread mod")
Native threads.
[time](time/index "std::time mod")
Temporal quantification.
[u8](u8/index "std::u8 mod")Deprecation planned
Constants for the 8-bit unsigned integer type.
[u16](u16/index "std::u16 mod")Deprecation planned
Constants for the 16-bit unsigned integer type.
[u32](u32/index "std::u32 mod")Deprecation planned
Constants for the 32-bit unsigned integer type.
[u64](u64/index "std::u64 mod")Deprecation planned
Constants for the 64-bit unsigned integer type.
[u128](u128/index "std::u128 mod")Deprecation planned
Constants for the 128-bit unsigned integer type.
[usize](usize/index "std::usize mod")Deprecation planned
Constants for the pointer-sized unsigned integer type.
[vec](vec/index "std::vec mod")
A contiguous growable array type with heap-allocated contents, written `Vec<T>`.
Macros
------
[concat\_bytes](macro.concat_bytes "std::concat_bytes macro")Experimental
Concatenates literals into a byte slice.
[concat\_idents](macro.concat_idents "std::concat_idents macro")Experimental
Concatenates identifiers into one identifier.
[const\_format\_args](macro.const_format_args "std::const_format_args macro")Experimental
Same as [`format_args`](macro.format_args "format_args"), but can be used in some const contexts.
[format\_args\_nl](macro.format_args_nl "std::format_args_nl macro")Experimental
Same as [`format_args`](macro.format_args "format_args"), but adds a newline in the end.
[log\_syntax](macro.log_syntax "std::log_syntax macro")Experimental
Prints passed tokens into the standard output.
[trace\_macros](macro.trace_macros "std::trace_macros macro")Experimental
Enables or disables tracing functionality used for debugging other macros.
[assert](macro.assert "std::assert macro")
Asserts that a boolean expression is `true` at runtime.
[assert\_eq](macro.assert_eq "std::assert_eq macro")
Asserts that two expressions are equal to each other (using [`PartialEq`](cmp/trait.partialeq "PartialEq")).
[assert\_ne](macro.assert_ne "std::assert_ne macro")
Asserts that two expressions are not equal to each other (using [`PartialEq`](cmp/trait.partialeq "PartialEq")).
[cfg](macro.cfg "std::cfg macro")
Evaluates boolean combinations of configuration flags at compile-time.
[column](macro.column "std::column macro")
Expands to the column number at which it was invoked.
[compile\_error](macro.compile_error "std::compile_error macro")
Causes compilation to fail with the given error message when encountered.
[concat](macro.concat "std::concat macro")
Concatenates literals into a static string slice.
[dbg](macro.dbg "std::dbg macro")
Prints and returns the value of a given expression for quick and dirty debugging.
[debug\_assert](macro.debug_assert "std::debug_assert macro")
Asserts that a boolean expression is `true` at runtime.
[debug\_assert\_eq](macro.debug_assert_eq "std::debug_assert_eq macro")
Asserts that two expressions are equal to each other.
[debug\_assert\_ne](macro.debug_assert_ne "std::debug_assert_ne macro")
Asserts that two expressions are not equal to each other.
[env](macro.env "std::env macro")
Inspects an environment variable at compile time.
[eprint](macro.eprint "std::eprint macro")
Prints to the standard error.
[eprintln](macro.eprintln "std::eprintln macro")
Prints to the standard error, with a newline.
[file](macro.file "std::file macro")
Expands to the file name in which it was invoked.
[format](macro.format "std::format macro")
Creates a `String` using interpolation of runtime expressions.
[format\_args](macro.format_args "std::format_args macro")
Constructs parameters for the other string-formatting macros.
[include](macro.include "std::include macro")
Parses a file as an expression or an item according to the context.
[include\_bytes](macro.include_bytes "std::include_bytes macro")
Includes a file as a reference to a byte array.
[include\_str](macro.include_str "std::include_str macro")
Includes a UTF-8 encoded file as a string.
[is\_x86\_feature\_detected](macro.is_x86_feature_detected "std::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.
[line](macro.line "std::line macro")
Expands to the line number on which it was invoked.
[matches](macro.matches "std::matches macro")
Returns whether the given expression matches any of the given patterns.
[module\_path](macro.module_path "std::module_path macro")
Expands to a string that represents the current module path.
[option\_env](macro.option_env "std::option_env macro")
Optionally inspects an environment variable at compile time.
[panic](macro.panic "std::panic macro")
Panics the current thread.
[print](macro.print "std::print macro")
Prints to the standard output.
[println](macro.println "std::println macro")
Prints to the standard output, with a newline.
[stringify](macro.stringify "std::stringify macro")
Stringifies its arguments.
[thread\_local](macro.thread_local "std::thread_local macro")
Declare a new thread local storage key of type [`std::thread::LocalKey`](thread/struct.localkey).
[todo](macro.todo "std::todo macro")
Indicates unfinished code.
[try](macro.try "std::try macro")Deprecated
Unwraps a result or propagates its error.
[unimplemented](macro.unimplemented "std::unimplemented macro")
Indicates unimplemented code by panicking with a message of “not implemented”.
[unreachable](macro.unreachable "std::unreachable macro")
Indicates unreachable code.
[vec](macro.vec "std::vec macro")
Creates a [`Vec`](vec/struct.vec) containing the arguments.
[write](macro.write "std::write macro")
Writes formatted data into a buffer.
[writeln](macro.writeln "std::writeln macro")
Write formatted data into a buffer, with a newline appended.
Keywords
--------
[SelfTy](keyword.selfty "std::SelfTy keyword")
The implementing type within a [`trait`](keyword.trait) or [`impl`](keyword.impl) block, or the current type within a type definition.
[as](keyword.as "std::as keyword")
Cast between types, or rename an import.
[async](keyword.async "std::async keyword")
Return a [`Future`](future/trait.future) instead of blocking the current thread.
[await](keyword.await "std::await keyword")
Suspend execution until the result of a [`Future`](future/trait.future) is ready.
[break](keyword.break "std::break keyword")
Exit early from a loop.
[const](keyword.const "std::const keyword")
Compile-time constants, compile-time evaluable functions, and raw pointers.
[continue](keyword.continue "std::continue keyword")
Skip to the next iteration of a loop.
[crate](keyword.crate "std::crate keyword")
A Rust binary or library.
[dyn](keyword.dyn "std::dyn keyword")
`dyn` is a prefix of a [trait object](../book/ch17-02-trait-objects)’s type.
[else](keyword.else "std::else keyword")
What expression to evaluate when an [`if`](keyword.if) condition evaluates to [`false`](keyword.false).
[enum](keyword.enum "std::enum keyword")
A type that can be any one of several variants.
[extern](keyword.extern "std::extern keyword")
Link to or import external code.
[false](keyword.false "std::false keyword")
A value of type [`bool`](primitive.bool "bool") representing logical **false**.
[fn](keyword.fn "std::fn keyword")
A function or function pointer.
[for](keyword.for "std::for keyword")
Iteration with [`in`](keyword.in), trait implementation with [`impl`](keyword.impl), or [higher-ranked trait bounds](../reference/trait-bounds#higher-ranked-trait-bounds) (`for<'a>`).
[if](keyword.if "std::if keyword")
Evaluate a block if a condition holds.
[impl](keyword.impl "std::impl keyword")
Implement some functionality for a type.
[in](keyword.in "std::in keyword")
Iterate over a series of values with [`for`](keyword.for).
[let](keyword.let "std::let keyword")
Bind a value to a variable.
[loop](keyword.loop "std::loop keyword")
Loop indefinitely.
[match](keyword.match "std::match keyword")
Control flow based on pattern matching.
[mod](keyword.mod "std::mod keyword")
Organize code into [modules](../reference/items/modules).
[move](keyword.move "std::move keyword")
Capture a [closure](../book/ch13-01-closures)’s environment by value.
[mut](keyword.mut "std::mut keyword")
A mutable variable, reference, or pointer.
[pub](keyword.pub "std::pub keyword")
Make an item visible to others.
[ref](keyword.ref "std::ref keyword")
Bind by reference during pattern matching.
[return](keyword.return "std::return keyword")
Return a value from a function.
[self](keyword.self "std::self keyword")
The receiver of a method, or the current module.
[static](keyword.static "std::static keyword")
A static item is a value which is valid for the entire duration of your program (a `'static` lifetime).
[struct](keyword.struct "std::struct keyword")
A type that is composed of other types.
[super](keyword.super "std::super keyword")
The parent of the current [module](../reference/items/modules).
[trait](keyword.trait "std::trait keyword")
A common interface for a group of types.
[true](keyword.true "std::true keyword")
A value of type [`bool`](primitive.bool "bool") representing logical **true**.
[type](keyword.type "std::type keyword")
Define an alias for an existing type.
[union](keyword.union "std::union keyword")
The [Rust equivalent of a C-style union](../reference/items/unions).
[unsafe](keyword.unsafe "std::unsafe keyword")
Code or interfaces whose [memory safety](../book/ch19-01-unsafe-rust) cannot be verified by the type system.
[use](keyword.use "std::use keyword")
Import or rename items from other crates or modules.
[where](keyword.where "std::where keyword")
Add constraints that must be upheld to use an item.
[while](keyword.while "std::while keyword")
Loop while a condition is upheld.
| programming_docs |
rust Macro std::vec Macro std::vec
==============
```
macro_rules! vec {
() => { ... };
($elem:expr; $n:expr) => { ... };
($($x:expr),+ $(,)?) => { ... };
}
```
Creates a [`Vec`](vec/struct.vec) containing the arguments.
`vec!` allows `Vec`s to be defined with the same syntax as array expressions. There are two forms of this macro:
* Create a [`Vec`](vec/struct.vec) containing a given list of elements:
```
let v = vec![1, 2, 3];
assert_eq!(v[0], 1);
assert_eq!(v[1], 2);
assert_eq!(v[2], 3);
```
* Create a [`Vec`](vec/struct.vec) from a given element and size:
```
let v = vec![1; 3];
assert_eq!(v, [1, 1, 1]);
```
Note that unlike array expressions this syntax supports all elements which implement [`Clone`](clone/trait.clone "Clone") and the number of elements doesn’t have to be a constant.
This will use `clone` to duplicate an expression, so one should be careful using this with types having a nonstandard `Clone` implementation. For example, `vec![Rc::new(1); 5]` will create a vector of five references to the same boxed integer value, not five references pointing to independently boxed integers.
Also, note that `vec![expr; 0]` is allowed, and produces an empty vector. This will still evaluate `expr`, however, and immediately drop the resulting value, so be mindful of side effects.
rust Keyword else Keyword else
============
What expression to evaluate when an [`if`](keyword.if) condition evaluates to [`false`](keyword.false).
`else` expressions are optional. When no else expressions are supplied it is assumed to evaluate to the unit type `()`.
The type that the `else` blocks evaluate to must be compatible with the type that the `if` block evaluates to.
As can be seen below, `else` must be followed by either: `if`, `if let`, or a block `{}` and it will return the value of that expression.
```
let result = if true == false {
"oh no"
} else if "something" == "other thing" {
"oh dear"
} else if let Some(200) = "blarg".parse::<i32>().ok() {
"uh oh"
} else {
println!("Sneaky side effect.");
"phew, nothing's broken"
};
```
Here’s another example but here we do not try and return an expression:
```
if true == false {
println!("oh no");
} else if "something" == "other thing" {
println!("oh dear");
} else if let Some(200) = "blarg".parse::<i32>().ok() {
println!("uh oh");
} else {
println!("phew, nothing's broken");
}
```
The above is *still* an expression but it will always evaluate to `()`.
There is possibly no limit to the number of `else` blocks that could follow an `if` expression however if you have several then a [`match`](keyword.match) expression might be preferable.
Read more about control flow in the [Rust Book](../book/ch03-05-control-flow#handling-multiple-conditions-with-else-if).
rust Macro std::file Macro std::file
===============
```
macro_rules! file {
() => { ... };
}
```
Expands to the file name in which it was invoked.
With [`line!`](macro.line "line!") and [`column!`](macro.column "column!"), these macros provide debugging information for developers about the location within the source.
The expanded expression has type `&'static str`, and the returned file is not the invocation of the `file!` macro itself, but rather the first macro invocation leading up to the invocation of the `file!` macro.
Examples
--------
```
let this_file = file!();
println!("defined in file: {this_file}");
```
rust Macro std::assert Macro std::assert
=================
```
macro_rules! assert {
($cond:expr $(,)?) => { ... };
($cond:expr, $($arg:tt)+) => { ... };
}
```
Asserts that a boolean expression is `true` at runtime.
This will invoke the [`panic!`](https://doc.rust-lang.org/core/macro.panic.html "panic!") macro if the provided expression cannot be evaluated to `true` at runtime.
Uses
----
Assertions are always checked in both debug and release builds, and cannot be disabled. See [`debug_assert!`](macro.debug_assert "debug_assert!") for assertions that are not enabled in release builds by default.
Unsafe code may rely on `assert!` to enforce run-time invariants that, if violated could lead to unsafety.
Other use-cases of `assert!` include testing and enforcing run-time invariants in safe code (whose violation cannot result in unsafety).
Custom Messages
---------------
This macro has a second form, where a custom panic message can be provided with or without arguments for formatting. See [`std::fmt`](fmt/index) for syntax for this form. Expressions used as format arguments will only be evaluated if the assertion fails.
Examples
--------
```
// the panic message for these assertions is the stringified value of the
// expression given.
assert!(true);
fn some_computation() -> bool { true } // a very simple function
assert!(some_computation());
// assert with a custom message
let x = true;
assert!(x, "x wasn't true!");
let a = 3; let b = 27;
assert!(a + b == 30, "a = {}, b = {}", a, b);
```
rust Keyword as Keyword as
==========
Cast between types, or rename an import.
`as` is most commonly used to turn primitive types into other primitive types, but it has other uses that include turning pointers into addresses, addresses into pointers, and pointers into other pointers.
```
let thing1: u8 = 89.0 as u8;
assert_eq!('B' as u32, 66);
assert_eq!(thing1 as char, 'Y');
let thing2: f32 = thing1 as f32 + 10.5;
assert_eq!(true as u8 + thing2 as u8, 100);
```
In general, any cast that can be performed via ascribing the type can also be done using `as`, so instead of writing `let x: u32 = 123`, you can write `let x = 123 as u32` (note: `let x: u32 = 123` would be best in that situation). The same is not true in the other direction, however; explicitly using `as` allows a few more coercions that aren’t allowed implicitly, such as changing the type of a raw pointer or turning closures into raw pointers.
`as` can be seen as the primitive for `From` and `Into`: `as` only works with primitives (`u8`, `bool`, `str`, pointers, …) whereas `From` and `Into` also works with types like `String` or `Vec`.
`as` can also be used with the `_` placeholder when the destination type can be inferred. Note that this can cause inference breakage and usually such code should use an explicit type for both clarity and stability. This is most useful when converting pointers using `as *const _` or `as *mut _` though the [`cast`](primitive.pointer#method.cast) method is recommended over `as *const _` and it is [the same](primitive.pointer#method.cast-1) for `as *mut _`: those methods make the intent clearer.
`as` is also used to rename imports in [`use`](keyword.use) and [`extern crate`](keyword.crate) statements:
```
use std::{mem as memory, net as network};
// Now you can use the names `memory` and `network` to refer to `std::mem` and `std::net`.
```
For more information on what `as` is capable of, see the [Reference](../reference/expressions/operator-expr#type-cast-expressions).
rust Macro std::unimplemented Macro std::unimplemented
========================
```
macro_rules! unimplemented {
() => { ... };
($($arg:tt)+) => { ... };
}
```
Indicates unimplemented code by panicking with a message of “not implemented”.
This allows your code to type-check, which is useful if you are prototyping or implementing a trait that requires multiple methods which you don’t plan to use all of.
The difference between `unimplemented!` and [`todo!`](macro.todo) is that while `todo!` conveys an intent of implementing the functionality later and the message is “not yet implemented”, `unimplemented!` makes no such claims. Its message is “not implemented”. Also some IDEs will mark `todo!`s.
Panics
------
This will always [`panic!`](https://doc.rust-lang.org/core/macro.panic.html "panic!") because `unimplemented!` is just a shorthand for `panic!` with a fixed, specific message.
Like `panic!`, this macro has a second form for displaying custom values.
Examples
--------
Say we have a trait `Foo`:
```
trait Foo {
fn bar(&self) -> u8;
fn baz(&self);
fn qux(&self) -> Result<u64, ()>;
}
```
We want to implement `Foo` for ‘MyStruct’, but for some reason it only makes sense to implement the `bar()` function. `baz()` and `qux()` will still need to be defined in our implementation of `Foo`, but we can use `unimplemented!` in their definitions to allow our code to compile.
We still want to have our program stop running if the unimplemented methods are reached.
```
struct MyStruct;
impl Foo for MyStruct {
fn bar(&self) -> u8 {
1 + 1
}
fn baz(&self) {
// It makes no sense to `baz` a `MyStruct`, so we have no logic here
// at all.
// This will display "thread 'main' panicked at 'not implemented'".
unimplemented!();
}
fn qux(&self) -> Result<u64, ()> {
// We have some logic here,
// We can add a message to unimplemented! to display our omission.
// This will display:
// "thread 'main' panicked at 'not implemented: MyStruct isn't quxable'".
unimplemented!("MyStruct isn't quxable");
}
}
fn main() {
let s = MyStruct;
s.bar();
}
```
rust Primitive Type u64 Primitive Type u64
==================
The 64-bit unsigned integer type.
Implementations
---------------
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#863)### impl u64
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#864-868)1.43.0 · #### pub const MIN: u64 = 0u64
The smallest value that can be represented by this integer type.
##### Examples
Basic usage:
```
assert_eq!(u64::MIN, 0);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#864-868)1.43.0 · #### pub const MAX: u64 = 18\_446\_744\_073\_709\_551\_615u64
The largest value that can be represented by this integer type (264 − 1)
##### Examples
Basic usage:
```
assert_eq!(u64::MAX, 18446744073709551615);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#864-868)1.53.0 · #### pub const BITS: u32 = 64u32
The size of this integer type in bits.
##### Examples
```
assert_eq!(u64::BITS, 64);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#864-868)#### pub fn from\_str\_radix(src: &str, radix: u32) -> Result<u64, ParseIntError>
Converts a string slice in a given base to an integer.
The string is expected to be an optional `+` sign followed by digits. Leading and trailing whitespace represent an error. Digits are a subset of these characters, depending on `radix`:
* `0-9`
* `a-z`
* `A-Z`
##### Panics
This function panics if `radix` is not in the range from 2 to 36.
##### Examples
Basic usage:
```
assert_eq!(u64::from_str_radix("A", 16), Ok(10));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#864-868)const: 1.32.0 · #### pub const fn count\_ones(self) -> u32
Returns the number of ones in the binary representation of `self`.
##### Examples
Basic usage:
```
let n = 0b01001100u64;
assert_eq!(n.count_ones(), 3);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#864-868)const: 1.32.0 · #### pub const fn count\_zeros(self) -> u32
Returns the number of zeros in the binary representation of `self`.
##### Examples
Basic usage:
```
assert_eq!(u64::MAX.count_zeros(), 0);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#864-868)const: 1.32.0 · #### pub const fn leading\_zeros(self) -> u32
Returns the number of leading zeros in the binary representation of `self`.
##### Examples
Basic usage:
```
let n = u64::MAX >> 2;
assert_eq!(n.leading_zeros(), 2);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#864-868)const: 1.32.0 · #### pub const fn trailing\_zeros(self) -> u32
Returns the number of trailing zeros in the binary representation of `self`.
##### Examples
Basic usage:
```
let n = 0b0101000u64;
assert_eq!(n.trailing_zeros(), 3);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#864-868)1.46.0 (const: 1.46.0) · #### pub const fn leading\_ones(self) -> u32
Returns the number of leading ones in the binary representation of `self`.
##### Examples
Basic usage:
```
let n = !(u64::MAX >> 2);
assert_eq!(n.leading_ones(), 2);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#864-868)1.46.0 (const: 1.46.0) · #### pub const fn trailing\_ones(self) -> u32
Returns the number of trailing ones in the binary representation of `self`.
##### Examples
Basic usage:
```
let n = 0b1010111u64;
assert_eq!(n.trailing_ones(), 3);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#864-868)const: 1.32.0 · #### pub const fn rotate\_left(self, n: u32) -> u64
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:
```
let n = 0xaa00000000006e1u64;
let m = 0x6e10aa;
assert_eq!(n.rotate_left(12), m);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#864-868)const: 1.32.0 · #### pub const fn rotate\_right(self, n: u32) -> u64
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:
```
let n = 0x6e10aau64;
let m = 0xaa00000000006e1;
assert_eq!(n.rotate_right(12), m);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#864-868)const: 1.32.0 · #### pub const fn swap\_bytes(self) -> u64
Reverses the byte order of the integer.
##### Examples
Basic usage:
```
let n = 0x1234567890123456u64;
let m = n.swap_bytes();
assert_eq!(m, 0x5634129078563412);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#864-868)1.37.0 (const: 1.37.0) · #### pub const fn reverse\_bits(self) -> u64
Reverses the order of bits in the integer. The least significant bit becomes the most significant bit, second least-significant bit becomes second most-significant bit, etc.
##### Examples
Basic usage:
```
let n = 0x1234567890123456u64;
let m = n.reverse_bits();
assert_eq!(m, 0x6a2c48091e6a2c48);
assert_eq!(0, 0u64.reverse_bits());
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#864-868)const: 1.32.0 · #### pub const fn from\_be(x: u64) -> u64
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:
```
let n = 0x1Au64;
if cfg!(target_endian = "big") {
assert_eq!(u64::from_be(n), n)
} else {
assert_eq!(u64::from_be(n), n.swap_bytes())
}
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#864-868)const: 1.32.0 · #### pub const fn from\_le(x: u64) -> u64
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:
```
let n = 0x1Au64;
if cfg!(target_endian = "little") {
assert_eq!(u64::from_le(n), n)
} else {
assert_eq!(u64::from_le(n), n.swap_bytes())
}
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#864-868)const: 1.32.0 · #### pub const fn to\_be(self) -> u64
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:
```
let n = 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/mod.rs.html#864-868)const: 1.32.0 · #### pub const fn to\_le(self) -> u64
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:
```
let n = 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/mod.rs.html#864-868)const: 1.47.0 · #### pub const fn checked\_add(self, rhs: u64) -> Option<u64>
Checked integer addition. Computes `self + rhs`, returning `None` if overflow occurred.
##### Examples
Basic usage:
```
assert_eq!((u64::MAX - 2).checked_add(1), Some(u64::MAX - 1));
assert_eq!((u64::MAX - 2).checked_add(3), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#864-868)const: [unstable](https://github.com/rust-lang/rust/issues/85122 "Tracking issue for const_inherent_unchecked_arith") · #### pub unsafe fn unchecked\_add(self, rhs: u64) -> u64
🔬This is a nightly-only experimental API. (`unchecked_math` [#85122](https://github.com/rust-lang/rust/issues/85122))
Unchecked integer addition. Computes `self + rhs`, assuming overflow cannot occur.
##### Safety
This results in undefined behavior when `self + rhs > u64::MAX` or `self + rhs < u64::MIN`, i.e. when [`checked_add`](primitive.u64#method.checked_add) would return `None`.
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#864-868)const: [unstable](https://github.com/rust-lang/rust/issues/87840 "Tracking issue for mixed_integer_ops") · #### pub fn checked\_add\_signed(self, rhs: i64) -> Option<u64>
🔬This is a nightly-only experimental API. (`mixed_integer_ops` [#87840](https://github.com/rust-lang/rust/issues/87840))
Checked addition with a signed integer. Computes `self + rhs`, returning `None` if overflow occurred.
##### Examples
Basic usage:
```
assert_eq!(1u64.checked_add_signed(2), Some(3));
assert_eq!(1u64.checked_add_signed(-2), None);
assert_eq!((u64::MAX - 2).checked_add_signed(3), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#864-868)const: 1.47.0 · #### pub const fn checked\_sub(self, rhs: u64) -> Option<u64>
Checked integer subtraction. Computes `self - rhs`, returning `None` if overflow occurred.
##### Examples
Basic usage:
```
assert_eq!(1u64.checked_sub(1), Some(0));
assert_eq!(0u64.checked_sub(1), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#864-868)const: [unstable](https://github.com/rust-lang/rust/issues/85122 "Tracking issue for const_inherent_unchecked_arith") · #### pub unsafe fn unchecked\_sub(self, rhs: u64) -> u64
🔬This is a nightly-only experimental API. (`unchecked_math` [#85122](https://github.com/rust-lang/rust/issues/85122))
Unchecked integer subtraction. Computes `self - rhs`, assuming overflow cannot occur.
##### Safety
This results in undefined behavior when `self - rhs > u64::MAX` or `self - rhs < u64::MIN`, i.e. when [`checked_sub`](primitive.u64#method.checked_sub) would return `None`.
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#864-868)const: 1.47.0 · #### pub const fn checked\_mul(self, rhs: u64) -> Option<u64>
Checked integer multiplication. Computes `self * rhs`, returning `None` if overflow occurred.
##### Examples
Basic usage:
```
assert_eq!(5u64.checked_mul(1), Some(5));
assert_eq!(u64::MAX.checked_mul(2), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#864-868)const: [unstable](https://github.com/rust-lang/rust/issues/85122 "Tracking issue for const_inherent_unchecked_arith") · #### pub unsafe fn unchecked\_mul(self, rhs: u64) -> u64
🔬This is a nightly-only experimental API. (`unchecked_math` [#85122](https://github.com/rust-lang/rust/issues/85122))
Unchecked integer multiplication. Computes `self * rhs`, assuming overflow cannot occur.
##### Safety
This results in undefined behavior when `self * rhs > u64::MAX` or `self * rhs < u64::MIN`, i.e. when [`checked_mul`](primitive.u64#method.checked_mul) would return `None`.
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#864-868)const: 1.52.0 · #### pub const fn checked\_div(self, rhs: u64) -> Option<u64>
Checked integer division. Computes `self / rhs`, returning `None` if `rhs == 0`.
##### Examples
Basic usage:
```
assert_eq!(128u64.checked_div(2), Some(64));
assert_eq!(1u64.checked_div(0), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#864-868)1.38.0 (const: 1.52.0) · #### pub const fn checked\_div\_euclid(self, rhs: u64) -> Option<u64>
Checked Euclidean division. Computes `self.div_euclid(rhs)`, returning `None` if `rhs == 0`.
##### Examples
Basic usage:
```
assert_eq!(128u64.checked_div_euclid(2), Some(64));
assert_eq!(1u64.checked_div_euclid(0), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#864-868)1.7.0 (const: 1.52.0) · #### pub const fn checked\_rem(self, rhs: u64) -> Option<u64>
Checked integer remainder. Computes `self % rhs`, returning `None` if `rhs == 0`.
##### Examples
Basic usage:
```
assert_eq!(5u64.checked_rem(2), Some(1));
assert_eq!(5u64.checked_rem(0), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#864-868)1.38.0 (const: 1.52.0) · #### pub const fn checked\_rem\_euclid(self, rhs: u64) -> Option<u64>
Checked Euclidean modulo. Computes `self.rem_euclid(rhs)`, returning `None` if `rhs == 0`.
##### Examples
Basic usage:
```
assert_eq!(5u64.checked_rem_euclid(2), Some(1));
assert_eq!(5u64.checked_rem_euclid(0), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#864-868)#### pub const fn ilog(self, base: u64) -> u32
🔬This is a nightly-only experimental API. (`int_log` [#70887](https://github.com/rust-lang/rust/issues/70887))
Returns the logarithm of the number with respect to an arbitrary base, rounded down.
This method might not be optimized owing to implementation details; `ilog2` can produce results more efficiently for base 2, and `ilog10` can produce results more efficiently for base 10.
##### Panics
When the number is zero, or if the base is not at least 2; it panics in debug mode and the return value is 0 in release mode.
##### Examples
```
#![feature(int_log)]
assert_eq!(5u64.ilog(5), 1);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#864-868)#### 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.
##### Panics
When the number is zero it panics in debug mode and the return value is 0 in release mode.
##### Examples
```
#![feature(int_log)]
assert_eq!(2u64.ilog2(), 1);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#864-868)#### 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.
##### Panics
When the number is zero it panics in debug mode and the return value is 0 in release mode.
##### Example
```
#![feature(int_log)]
assert_eq!(10u64.ilog10(), 1);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#864-868)#### pub const fn checked\_ilog(self, base: u64) -> Option<u32>
🔬This is a nightly-only experimental API. (`int_log` [#70887](https://github.com/rust-lang/rust/issues/70887))
Returns the logarithm of the number with respect to an arbitrary base, rounded down.
Returns `None` if the number is zero, or if the base is not at least 2.
This method might not be optimized owing to implementation details; `checked_ilog2` can produce results more efficiently for base 2, and `checked_ilog10` can produce results more efficiently for base 10.
##### Examples
```
#![feature(int_log)]
assert_eq!(5u64.checked_ilog(5), Some(1));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#864-868)#### pub const fn checked\_ilog2(self) -> Option<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.
Returns `None` if the number is zero.
##### Examples
```
#![feature(int_log)]
assert_eq!(2u64.checked_ilog2(), Some(1));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#864-868)#### pub const fn checked\_ilog10(self) -> Option<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.
Returns `None` if the number is zero.
##### Examples
```
#![feature(int_log)]
assert_eq!(10u64.checked_ilog10(), Some(1));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#864-868)1.7.0 (const: 1.47.0) · #### pub const fn checked\_neg(self) -> Option<u64>
Checked negation. Computes `-self`, returning `None` unless `self == 0`.
Note that negating any positive integer will overflow.
##### Examples
Basic usage:
```
assert_eq!(0u64.checked_neg(), Some(0));
assert_eq!(1u64.checked_neg(), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#864-868)1.7.0 (const: 1.47.0) · #### pub const fn checked\_shl(self, rhs: u32) -> Option<u64>
Checked shift left. Computes `self << rhs`, returning `None` if `rhs` is larger than or equal to the number of bits in `self`.
##### Examples
Basic usage:
```
assert_eq!(0x1u64.checked_shl(4), Some(0x10));
assert_eq!(0x10u64.checked_shl(129), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#864-868)const: [unstable](https://github.com/rust-lang/rust/issues/85122 "Tracking issue for const_inherent_unchecked_arith") · #### pub unsafe fn unchecked\_shl(self, rhs: u64) -> u64
🔬This is a nightly-only experimental API. (`unchecked_math` [#85122](https://github.com/rust-lang/rust/issues/85122))
Unchecked shift left. Computes `self << rhs`, assuming that `rhs` is less than the number of bits in `self`.
##### Safety
This results in undefined behavior if `rhs` is larger than or equal to the number of bits in `self`, i.e. when [`checked_shl`](primitive.u64#method.checked_shl) would return `None`.
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#864-868)1.7.0 (const: 1.47.0) · #### pub const fn checked\_shr(self, rhs: u32) -> Option<u64>
Checked shift right. Computes `self >> rhs`, returning `None` if `rhs` is larger than or equal to the number of bits in `self`.
##### Examples
Basic usage:
```
assert_eq!(0x10u64.checked_shr(4), Some(0x1));
assert_eq!(0x10u64.checked_shr(129), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#864-868)const: [unstable](https://github.com/rust-lang/rust/issues/85122 "Tracking issue for const_inherent_unchecked_arith") · #### pub unsafe fn unchecked\_shr(self, rhs: u64) -> u64
🔬This is a nightly-only experimental API. (`unchecked_math` [#85122](https://github.com/rust-lang/rust/issues/85122))
Unchecked shift right. Computes `self >> rhs`, assuming that `rhs` is less than the number of bits in `self`.
##### Safety
This results in undefined behavior if `rhs` is larger than or equal to the number of bits in `self`, i.e. when [`checked_shr`](primitive.u64#method.checked_shr) would return `None`.
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#864-868)1.34.0 (const: 1.50.0) · #### pub const fn checked\_pow(self, exp: u32) -> Option<u64>
Checked exponentiation. Computes `self.pow(exp)`, returning `None` if overflow occurred.
##### Examples
Basic usage:
```
assert_eq!(2u64.checked_pow(5), Some(32));
assert_eq!(u64::MAX.checked_pow(2), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#864-868)const: 1.47.0 · #### pub const fn saturating\_add(self, rhs: u64) -> u64
Saturating integer addition. Computes `self + rhs`, saturating at the numeric bounds instead of overflowing.
##### Examples
Basic usage:
```
assert_eq!(100u64.saturating_add(1), 101);
assert_eq!(u64::MAX.saturating_add(127), u64::MAX);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#864-868)const: [unstable](https://github.com/rust-lang/rust/issues/87840 "Tracking issue for mixed_integer_ops") · #### pub fn saturating\_add\_signed(self, rhs: i64) -> u64
🔬This is a nightly-only experimental API. (`mixed_integer_ops` [#87840](https://github.com/rust-lang/rust/issues/87840))
Saturating addition with a signed integer. Computes `self + rhs`, saturating at the numeric bounds instead of overflowing.
##### Examples
Basic usage:
```
assert_eq!(1u64.saturating_add_signed(2), 3);
assert_eq!(1u64.saturating_add_signed(-2), 0);
assert_eq!((u64::MAX - 2).saturating_add_signed(4), u64::MAX);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#864-868)const: 1.47.0 · #### pub const fn saturating\_sub(self, rhs: u64) -> u64
Saturating integer subtraction. Computes `self - rhs`, saturating at the numeric bounds instead of overflowing.
##### Examples
Basic usage:
```
assert_eq!(100u64.saturating_sub(27), 73);
assert_eq!(13u64.saturating_sub(127), 0);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#864-868)1.7.0 (const: 1.47.0) · #### pub const fn saturating\_mul(self, rhs: u64) -> u64
Saturating integer multiplication. Computes `self * rhs`, saturating at the numeric bounds instead of overflowing.
##### Examples
Basic usage:
```
assert_eq!(2u64.saturating_mul(10), 20);
assert_eq!((u64::MAX).saturating_mul(10), u64::MAX);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#864-868)1.58.0 (const: 1.58.0) · #### pub const fn saturating\_div(self, rhs: u64) -> u64
Saturating integer division. Computes `self / rhs`, saturating at the numeric bounds instead of overflowing.
##### Examples
Basic usage:
```
assert_eq!(5u64.saturating_div(2), 2);
```
ⓘ
```
let _ = 1u64.saturating_div(0);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#864-868)1.34.0 (const: 1.50.0) · #### pub const fn saturating\_pow(self, exp: u32) -> u64
Saturating integer exponentiation. Computes `self.pow(exp)`, saturating at the numeric bounds instead of overflowing.
##### Examples
Basic usage:
```
assert_eq!(4u64.saturating_pow(3), 64);
assert_eq!(u64::MAX.saturating_pow(2), u64::MAX);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#864-868)const: 1.32.0 · #### pub const fn wrapping\_add(self, rhs: u64) -> u64
Wrapping (modular) addition. Computes `self + rhs`, wrapping around at the boundary of the type.
##### Examples
Basic usage:
```
assert_eq!(200u64.wrapping_add(55), 255);
assert_eq!(200u64.wrapping_add(u64::MAX), 199);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#864-868)const: [unstable](https://github.com/rust-lang/rust/issues/87840 "Tracking issue for mixed_integer_ops") · #### pub fn wrapping\_add\_signed(self, rhs: i64) -> u64
🔬This is a nightly-only experimental API. (`mixed_integer_ops` [#87840](https://github.com/rust-lang/rust/issues/87840))
Wrapping (modular) addition with a signed integer. Computes `self + rhs`, wrapping around at the boundary of the type.
##### Examples
Basic usage:
```
assert_eq!(1u64.wrapping_add_signed(2), 3);
assert_eq!(1u64.wrapping_add_signed(-2), u64::MAX);
assert_eq!((u64::MAX - 2).wrapping_add_signed(4), 1);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#864-868)const: 1.32.0 · #### pub const fn wrapping\_sub(self, rhs: u64) -> u64
Wrapping (modular) subtraction. Computes `self - rhs`, wrapping around at the boundary of the type.
##### Examples
Basic usage:
```
assert_eq!(100u64.wrapping_sub(100), 0);
assert_eq!(100u64.wrapping_sub(u64::MAX), 101);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#864-868)const: 1.32.0 · #### pub const fn wrapping\_mul(self, rhs: u64) -> u64
Wrapping (modular) multiplication. Computes `self * rhs`, wrapping around at the boundary of the type.
##### Examples
Basic usage:
Please note that this example is shared between integer types. Which explains why `u8` is used here.
```
assert_eq!(10u8.wrapping_mul(12), 120);
assert_eq!(25u8.wrapping_mul(12), 44);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#864-868)1.2.0 (const: 1.52.0) · #### pub const fn wrapping\_div(self, rhs: u64) -> u64
Wrapping (modular) division. Computes `self / rhs`. Wrapped division on unsigned types is just normal division. There’s no way wrapping could ever happen. This function exists, so that all operations are accounted for in the wrapping operations.
##### Examples
Basic usage:
```
assert_eq!(100u64.wrapping_div(10), 10);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#864-868)1.38.0 (const: 1.52.0) · #### pub const fn wrapping\_div\_euclid(self, rhs: u64) -> u64
Wrapping Euclidean division. Computes `self.div_euclid(rhs)`. Wrapped division on unsigned types is just normal division. There’s no way wrapping could ever happen. This function exists, so that all operations are accounted for in the wrapping operations. Since, for the positive integers, all common definitions of division are equal, this is exactly equal to `self.wrapping_div(rhs)`.
##### Examples
Basic usage:
```
assert_eq!(100u64.wrapping_div_euclid(10), 10);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#864-868)1.2.0 (const: 1.52.0) · #### pub const fn wrapping\_rem(self, rhs: u64) -> u64
Wrapping (modular) remainder. Computes `self % rhs`. Wrapped remainder calculation on unsigned types is just the regular remainder calculation. There’s no way wrapping could ever happen. This function exists, so that all operations are accounted for in the wrapping operations.
##### Examples
Basic usage:
```
assert_eq!(100u64.wrapping_rem(10), 0);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#864-868)1.38.0 (const: 1.52.0) · #### pub const fn wrapping\_rem\_euclid(self, rhs: u64) -> u64
Wrapping Euclidean modulo. Computes `self.rem_euclid(rhs)`. Wrapped modulo calculation on unsigned types is just the regular remainder calculation. There’s no way wrapping could ever happen. This function exists, so that all operations are accounted for in the wrapping operations. Since, for the positive integers, all common definitions of division are equal, this is exactly equal to `self.wrapping_rem(rhs)`.
##### Examples
Basic usage:
```
assert_eq!(100u64.wrapping_rem_euclid(10), 0);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#864-868)1.2.0 (const: 1.32.0) · #### pub const fn wrapping\_neg(self) -> u64
Wrapping (modular) negation. Computes `-self`, wrapping around at the boundary of the type.
Since unsigned types do not have negative equivalents all applications of this function will wrap (except for `-0`). For values smaller than the corresponding signed type’s maximum the result is the same as casting the corresponding signed value. Any larger values are equivalent to `MAX + 1 - (val - MAX - 1)` where `MAX` is the corresponding signed type’s maximum.
##### Examples
Basic usage:
Please note that this example is shared between integer types. Which explains why `i8` is used here.
```
assert_eq!(100i8.wrapping_neg(), -100);
assert_eq!((-128i8).wrapping_neg(), -128);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#864-868)1.2.0 (const: 1.32.0) · #### pub const fn wrapping\_shl(self, rhs: u32) -> u64
Panic-free bitwise shift-left; yields `self << mask(rhs)`, where `mask` removes any high-order bits of `rhs` that would cause the shift to exceed the bitwidth of the type.
Note that this is *not* the same as a rotate-left; the RHS of a wrapping shift-left is restricted to the range of the type, rather than the bits shifted out of the LHS being returned to the other end. The primitive integer types all implement a [`rotate_left`](primitive.u64#method.rotate_left) function, which may be what you want instead.
##### Examples
Basic usage:
```
assert_eq!(1u64.wrapping_shl(7), 128);
assert_eq!(1u64.wrapping_shl(128), 1);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#864-868)1.2.0 (const: 1.32.0) · #### pub const fn wrapping\_shr(self, rhs: u32) -> u64
Panic-free bitwise shift-right; yields `self >> mask(rhs)`, where `mask` removes any high-order bits of `rhs` that would cause the shift to exceed the bitwidth of the type.
Note that this is *not* the same as a rotate-right; the RHS of a wrapping shift-right is restricted to the range of the type, rather than the bits shifted out of the LHS being returned to the other end. The primitive integer types all implement a [`rotate_right`](primitive.u64#method.rotate_right) function, which may be what you want instead.
##### Examples
Basic usage:
```
assert_eq!(128u64.wrapping_shr(7), 1);
assert_eq!(128u64.wrapping_shr(128), 128);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#864-868)1.34.0 (const: 1.50.0) · #### pub const fn wrapping\_pow(self, exp: u32) -> u64
Wrapping (modular) exponentiation. Computes `self.pow(exp)`, wrapping around at the boundary of the type.
##### Examples
Basic usage:
```
assert_eq!(3u64.wrapping_pow(5), 243);
assert_eq!(3u8.wrapping_pow(6), 217);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#864-868)1.7.0 (const: 1.32.0) · #### pub const fn overflowing\_add(self, rhs: u64) -> (u64, bool)
Calculates `self` + `rhs`
Returns a tuple of the addition along with a boolean indicating whether an arithmetic overflow would occur. If an overflow would have occurred then the wrapped value is returned.
##### Examples
Basic usage
```
assert_eq!(5u64.overflowing_add(2), (7, false));
assert_eq!(u64::MAX.overflowing_add(1), (0, true));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#864-868)const: [unstable](https://github.com/rust-lang/rust/issues/85532 "Tracking issue for const_bigint_helper_methods") · #### pub fn carrying\_add(self, rhs: u64, carry: bool) -> (u64, bool)
🔬This is a nightly-only experimental API. (`bigint_helper_methods` [#85532](https://github.com/rust-lang/rust/issues/85532))
Calculates `self + rhs + carry` without the ability to overflow.
Performs “ternary addition” which takes in an extra bit to add, and may return an additional bit of overflow. This allows for chaining together multiple additions to create “big integers” which represent larger values.
This can be thought of as a 64-bit “full adder”, in the electronics sense.
##### Examples
Basic usage
```
#![feature(bigint_helper_methods)]
assert_eq!(5u64.carrying_add(2, false), (7, false));
assert_eq!(5u64.carrying_add(2, true), (8, false));
assert_eq!(u64::MAX.carrying_add(1, false), (0, true));
assert_eq!(u64::MAX.carrying_add(0, true), (0, true));
assert_eq!(u64::MAX.carrying_add(1, true), (1, true));
assert_eq!(u64::MAX.carrying_add(u64::MAX, true), (u64::MAX, true));
```
If `carry` is false, this method is equivalent to [`overflowing_add`](primitive.u64#method.overflowing_add):
```
#![feature(bigint_helper_methods)]
assert_eq!(5_u64.carrying_add(2, false), 5_u64.overflowing_add(2));
assert_eq!(u64::MAX.carrying_add(1, false), u64::MAX.overflowing_add(1));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#864-868)const: [unstable](https://github.com/rust-lang/rust/issues/87840 "Tracking issue for mixed_integer_ops") · #### pub fn overflowing\_add\_signed(self, rhs: i64) -> (u64, bool)
🔬This is a nightly-only experimental API. (`mixed_integer_ops` [#87840](https://github.com/rust-lang/rust/issues/87840))
Calculates `self` + `rhs` with a signed `rhs`
Returns a tuple of the addition along with a boolean indicating whether an arithmetic overflow would occur. If an overflow would have occurred then the wrapped value is returned.
##### Examples
Basic usage:
```
assert_eq!(1u64.overflowing_add_signed(2), (3, false));
assert_eq!(1u64.overflowing_add_signed(-2), (u64::MAX, true));
assert_eq!((u64::MAX - 2).overflowing_add_signed(4), (1, true));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#864-868)1.7.0 (const: 1.32.0) · #### pub const fn overflowing\_sub(self, rhs: u64) -> (u64, bool)
Calculates `self` - `rhs`
Returns a tuple of the subtraction along with a boolean indicating whether an arithmetic overflow would occur. If an overflow would have occurred then the wrapped value is returned.
##### Examples
Basic usage
```
assert_eq!(5u64.overflowing_sub(2), (3, false));
assert_eq!(0u64.overflowing_sub(1), (u64::MAX, true));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#864-868)const: [unstable](https://github.com/rust-lang/rust/issues/85532 "Tracking issue for const_bigint_helper_methods") · #### pub fn borrowing\_sub(self, rhs: u64, borrow: bool) -> (u64, bool)
🔬This is a nightly-only experimental API. (`bigint_helper_methods` [#85532](https://github.com/rust-lang/rust/issues/85532))
Calculates `self - rhs - borrow` without the ability to overflow.
Performs “ternary subtraction” which takes in an extra bit to subtract, and may return an additional bit of overflow. This allows for chaining together multiple subtractions to create “big integers” which represent larger values.
##### Examples
Basic usage
```
#![feature(bigint_helper_methods)]
assert_eq!(5u64.borrowing_sub(2, false), (3, false));
assert_eq!(5u64.borrowing_sub(2, true), (2, false));
assert_eq!(0u64.borrowing_sub(1, false), (u64::MAX, true));
assert_eq!(0u64.borrowing_sub(1, true), (u64::MAX - 1, true));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#864-868)1.60.0 (const: 1.60.0) · #### pub const fn abs\_diff(self, other: u64) -> u64
Computes the absolute difference between `self` and `other`.
##### Examples
Basic usage:
```
assert_eq!(100u64.abs_diff(80), 20u64);
assert_eq!(100u64.abs_diff(110), 10u64);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#864-868)1.7.0 (const: 1.32.0) · #### pub const fn overflowing\_mul(self, rhs: u64) -> (u64, bool)
Calculates the multiplication of `self` and `rhs`.
Returns a tuple of the multiplication along with a boolean indicating whether an arithmetic overflow would occur. If an overflow would have occurred then the wrapped value is returned.
##### Examples
Basic usage:
Please note that this example is shared between integer types. Which explains why `u32` is used here.
```
assert_eq!(5u32.overflowing_mul(2), (10, false));
assert_eq!(1_000_000_000u32.overflowing_mul(10), (1410065408, true));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#864-868)1.7.0 (const: 1.52.0) · #### pub const fn overflowing\_div(self, rhs: u64) -> (u64, bool)
Calculates the divisor when `self` is divided by `rhs`.
Returns a tuple of the divisor along with a boolean indicating whether an arithmetic overflow would occur. Note that for unsigned integers overflow never occurs, so the second value is always `false`.
##### Panics
This function will panic if `rhs` is 0.
##### Examples
Basic usage
```
assert_eq!(5u64.overflowing_div(2), (2, false));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#864-868)1.38.0 (const: 1.52.0) · #### pub const fn overflowing\_div\_euclid(self, rhs: u64) -> (u64, bool)
Calculates the quotient of Euclidean division `self.div_euclid(rhs)`.
Returns a tuple of the divisor along with a boolean indicating whether an arithmetic overflow would occur. Note that for unsigned integers overflow never occurs, so the second value is always `false`. Since, for the positive integers, all common definitions of division are equal, this is exactly equal to `self.overflowing_div(rhs)`.
##### Panics
This function will panic if `rhs` is 0.
##### Examples
Basic usage
```
assert_eq!(5u64.overflowing_div_euclid(2), (2, false));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#864-868)1.7.0 (const: 1.52.0) · #### pub const fn overflowing\_rem(self, rhs: u64) -> (u64, bool)
Calculates the remainder when `self` is divided by `rhs`.
Returns a tuple of the remainder after dividing along with a boolean indicating whether an arithmetic overflow would occur. Note that for unsigned integers overflow never occurs, so the second value is always `false`.
##### Panics
This function will panic if `rhs` is 0.
##### Examples
Basic usage
```
assert_eq!(5u64.overflowing_rem(2), (1, false));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#864-868)1.38.0 (const: 1.52.0) · #### pub const fn overflowing\_rem\_euclid(self, rhs: u64) -> (u64, bool)
Calculates the remainder `self.rem_euclid(rhs)` as if by Euclidean division.
Returns a tuple of the modulo after dividing along with a boolean indicating whether an arithmetic overflow would occur. Note that for unsigned integers overflow never occurs, so the second value is always `false`. Since, for the positive integers, all common definitions of division are equal, this operation is exactly equal to `self.overflowing_rem(rhs)`.
##### Panics
This function will panic if `rhs` is 0.
##### Examples
Basic usage
```
assert_eq!(5u64.overflowing_rem_euclid(2), (1, false));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#864-868)1.7.0 (const: 1.32.0) · #### pub const fn overflowing\_neg(self) -> (u64, bool)
Negates self in an overflowing fashion.
Returns `!self + 1` using wrapping operations to return the value that represents the negation of this unsigned value. Note that for positive unsigned values overflow always occurs, but negating 0 does not overflow.
##### Examples
Basic usage
```
assert_eq!(0u64.overflowing_neg(), (0, false));
assert_eq!(2u64.overflowing_neg(), (-2i32 as u64, true));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#864-868)1.7.0 (const: 1.32.0) · #### pub const fn overflowing\_shl(self, rhs: u32) -> (u64, bool)
Shifts self left by `rhs` bits.
Returns a tuple of the shifted version of self along with a boolean indicating whether the shift value was larger than or equal to the number of bits. If the shift value is too large, then value is masked (N-1) where N is the number of bits, and this value is then used to perform the shift.
##### Examples
Basic usage
```
assert_eq!(0x1u64.overflowing_shl(4), (0x10, false));
assert_eq!(0x1u64.overflowing_shl(132), (0x10, true));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#864-868)1.7.0 (const: 1.32.0) · #### pub const fn overflowing\_shr(self, rhs: u32) -> (u64, bool)
Shifts self right by `rhs` bits.
Returns a tuple of the shifted version of self along with a boolean indicating whether the shift value was larger than or equal to the number of bits. If the shift value is too large, then value is masked (N-1) where N is the number of bits, and this value is then used to perform the shift.
##### Examples
Basic usage
```
assert_eq!(0x10u64.overflowing_shr(4), (0x1, false));
assert_eq!(0x10u64.overflowing_shr(132), (0x1, true));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#864-868)1.34.0 (const: 1.50.0) · #### pub const fn overflowing\_pow(self, exp: u32) -> (u64, bool)
Raises self to the power of `exp`, using exponentiation by squaring.
Returns a tuple of the exponentiation along with a bool indicating whether an overflow happened.
##### Examples
Basic usage:
```
assert_eq!(3u64.overflowing_pow(5), (243, false));
assert_eq!(3u8.overflowing_pow(6), (217, true));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#864-868)const: 1.50.0 · #### pub const fn pow(self, exp: u32) -> u64
Raises self to the power of `exp`, using exponentiation by squaring.
##### Examples
Basic usage:
```
assert_eq!(2u64.pow(5), 32);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#864-868)1.38.0 (const: 1.52.0) · #### pub const fn div\_euclid(self, rhs: u64) -> u64
Performs Euclidean division.
Since, for the positive integers, all common definitions of division are equal, this is exactly equal to `self / rhs`.
##### Panics
This function will panic if `rhs` is 0.
##### Examples
Basic usage:
```
assert_eq!(7u64.div_euclid(4), 1); // or any other integer type
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#864-868)1.38.0 (const: 1.52.0) · #### pub const fn rem\_euclid(self, rhs: u64) -> u64
Calculates the least remainder of `self (mod rhs)`.
Since, for the positive integers, all common definitions of division are equal, this is exactly equal to `self % rhs`.
##### Panics
This function will panic if `rhs` is 0.
##### Examples
Basic usage:
```
assert_eq!(7u64.rem_euclid(4), 3); // or any other integer type
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#864-868)#### pub const fn div\_floor(self, rhs: u64) -> u64
🔬This is a nightly-only experimental API. (`int_roundings` [#88581](https://github.com/rust-lang/rust/issues/88581))
Calculates the quotient of `self` and `rhs`, rounding the result towards negative infinity.
This is the same as performing `self / rhs` for all unsigned integers.
##### Panics
This function will panic if `rhs` is zero.
##### Examples
Basic usage:
```
#![feature(int_roundings)]
assert_eq!(7_u64.div_floor(4), 1);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#864-868)#### pub const fn div\_ceil(self, rhs: u64) -> u64
🔬This is a nightly-only experimental API. (`int_roundings` [#88581](https://github.com/rust-lang/rust/issues/88581))
Calculates the quotient of `self` and `rhs`, rounding the result towards positive infinity.
##### Panics
This function will panic if `rhs` is zero.
###### [Overflow behavior](#overflow-behavior)
On overflow, this function will panic if overflow checks are enabled (default in debug mode) and wrap if overflow checks are disabled (default in release mode).
##### Examples
Basic usage:
```
#![feature(int_roundings)]
assert_eq!(7_u64.div_ceil(4), 2);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#864-868)#### pub const fn next\_multiple\_of(self, rhs: u64) -> u64
🔬This is a nightly-only experimental API. (`int_roundings` [#88581](https://github.com/rust-lang/rust/issues/88581))
Calculates the smallest value greater than or equal to `self` that is a multiple of `rhs`.
##### Panics
This function will panic if `rhs` is zero.
###### [Overflow behavior](#overflow-behavior-1)
On overflow, this function will panic if overflow checks are enabled (default in debug mode) and wrap if overflow checks are disabled (default in release mode).
##### Examples
Basic usage:
```
#![feature(int_roundings)]
assert_eq!(16_u64.next_multiple_of(8), 16);
assert_eq!(23_u64.next_multiple_of(8), 24);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#864-868)#### pub const fn checked\_next\_multiple\_of(self, rhs: u64) -> Option<u64>
🔬This is a nightly-only experimental API. (`int_roundings` [#88581](https://github.com/rust-lang/rust/issues/88581))
Calculates the smallest value greater than or equal to `self` that is a multiple of `rhs`. Returns `None` if `rhs` is zero or the operation would result in overflow.
##### Examples
Basic usage:
```
#![feature(int_roundings)]
assert_eq!(16_u64.checked_next_multiple_of(8), Some(16));
assert_eq!(23_u64.checked_next_multiple_of(8), Some(24));
assert_eq!(1_u64.checked_next_multiple_of(0), None);
assert_eq!(u64::MAX.checked_next_multiple_of(2), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#864-868)const: 1.32.0 · #### pub const fn is\_power\_of\_two(self) -> bool
Returns `true` if and only if `self == 2^k` for some `k`.
##### Examples
Basic usage:
```
assert!(16u64.is_power_of_two());
assert!(!10u64.is_power_of_two());
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#864-868)const: 1.50.0 · #### pub const fn next\_power\_of\_two(self) -> u64
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`), it panics in debug mode and the return value is wrapped to 0 in release mode (the only situation in which method can return 0).
##### Examples
Basic usage:
```
assert_eq!(2u64.next_power_of_two(), 2);
assert_eq!(3u64.next_power_of_two(), 4);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#864-868)const: 1.50.0 · #### pub const fn checked\_next\_power\_of\_two(self) -> Option<u64>
Returns the smallest power of two greater than or equal to `n`. If the next power of two is greater than the type’s maximum value, `None` is returned, otherwise the power of two is wrapped in `Some`.
##### Examples
Basic usage:
```
assert_eq!(2u64.checked_next_power_of_two(), Some(2));
assert_eq!(3u64.checked_next_power_of_two(), Some(4));
assert_eq!(u64::MAX.checked_next_power_of_two(), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#864-868)const: [unstable](https://github.com/rust-lang/rust/issues/32463 "Tracking issue for wrapping_next_power_of_two") · #### pub fn wrapping\_next\_power\_of\_two(self) -> 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 `n`. If the next power of two is greater than the type’s maximum value, the return value is wrapped to `0`.
##### Examples
Basic usage:
```
#![feature(wrapping_next_power_of_two)]
assert_eq!(2u64.wrapping_next_power_of_two(), 2);
assert_eq!(3u64.wrapping_next_power_of_two(), 4);
assert_eq!(u64::MAX.wrapping_next_power_of_two(), 0);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#864-868)1.32.0 (const: 1.44.0) · #### pub const fn to\_be\_bytes(self) -> [u8; 8]
Return the memory representation of this integer as a byte array in big-endian (network) byte order.
##### Examples
```
let bytes = 0x1234567890123456u64.to_be_bytes();
assert_eq!(bytes, [0x12, 0x34, 0x56, 0x78, 0x90, 0x12, 0x34, 0x56]);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#864-868)1.32.0 (const: 1.44.0) · #### pub const fn to\_le\_bytes(self) -> [u8; 8]
Return the memory representation of this integer as a byte array in little-endian byte order.
##### Examples
```
let bytes = 0x1234567890123456u64.to_le_bytes();
assert_eq!(bytes, [0x56, 0x34, 0x12, 0x90, 0x78, 0x56, 0x34, 0x12]);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#864-868)1.32.0 (const: 1.44.0) · #### pub const fn to\_ne\_bytes(self) -> [u8; 8]
Return the memory representation of this integer as a byte array in native byte order.
As the target platform’s native endianness is used, portable code should use [`to_be_bytes`](primitive.u64#method.to_be_bytes) or [`to_le_bytes`](primitive.u64#method.to_le_bytes), as appropriate, instead.
##### Examples
```
let bytes = 0x1234567890123456u64.to_ne_bytes();
assert_eq!(
bytes,
if cfg!(target_endian = "big") {
[0x12, 0x34, 0x56, 0x78, 0x90, 0x12, 0x34, 0x56]
} else {
[0x56, 0x34, 0x12, 0x90, 0x78, 0x56, 0x34, 0x12]
}
);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#864-868)1.32.0 (const: 1.44.0) · #### pub const fn from\_be\_bytes(bytes: [u8; 8]) -> u64
Create a native endian integer value from its representation as a byte array in big endian.
##### Examples
```
let value = u64::from_be_bytes([0x12, 0x34, 0x56, 0x78, 0x90, 0x12, 0x34, 0x56]);
assert_eq!(value, 0x1234567890123456);
```
When starting from a slice rather than an array, fallible conversion APIs can be used:
```
fn read_be_u64(input: &mut &[u8]) -> u64 {
let (int_bytes, rest) = input.split_at(std::mem::size_of::<u64>());
*input = rest;
u64::from_be_bytes(int_bytes.try_into().unwrap())
}
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#864-868)1.32.0 (const: 1.44.0) · #### pub const fn from\_le\_bytes(bytes: [u8; 8]) -> u64
Create a native endian integer value from its representation as a byte array in little endian.
##### Examples
```
let value = u64::from_le_bytes([0x56, 0x34, 0x12, 0x90, 0x78, 0x56, 0x34, 0x12]);
assert_eq!(value, 0x1234567890123456);
```
When starting from a slice rather than an array, fallible conversion APIs can be used:
```
fn read_le_u64(input: &mut &[u8]) -> u64 {
let (int_bytes, rest) = input.split_at(std::mem::size_of::<u64>());
*input = rest;
u64::from_le_bytes(int_bytes.try_into().unwrap())
}
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#864-868)1.32.0 (const: 1.44.0) · #### pub const fn from\_ne\_bytes(bytes: [u8; 8]) -> u64
Create a native endian integer value from its memory representation as a byte array in native endianness.
As the target platform’s native endianness is used, portable code likely wants to use [`from_be_bytes`](primitive.u64#method.from_be_bytes) or [`from_le_bytes`](primitive.u64#method.from_le_bytes), as appropriate instead.
##### Examples
```
let value = u64::from_ne_bytes(if cfg!(target_endian = "big") {
[0x12, 0x34, 0x56, 0x78, 0x90, 0x12, 0x34, 0x56]
} else {
[0x56, 0x34, 0x12, 0x90, 0x78, 0x56, 0x34, 0x12]
});
assert_eq!(value, 0x1234567890123456);
```
When starting from a slice rather than an array, fallible conversion APIs can be used:
```
fn read_ne_u64(input: &mut &[u8]) -> u64 {
let (int_bytes, rest) = input.split_at(std::mem::size_of::<u64>());
*input = rest;
u64::from_ne_bytes(int_bytes.try_into().unwrap())
}
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#864-868)const: 1.32.0 · #### pub const fn min\_value() -> u64
👎Deprecating in a future Rust version: replaced by the `MIN` associated constant on this type
New code should prefer to use [`u64::MIN`](primitive.u64#associatedconstant.MIN "u64::MIN") instead.
Returns the smallest value that can be represented by this integer type.
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#864-868)const: 1.32.0 · #### pub const fn max\_value() -> u64
👎Deprecating in a future Rust version: replaced by the `MAX` associated constant on this type
New code should prefer to use [`u64::MAX`](primitive.u64#associatedconstant.MAX "u64::MAX") instead.
Returns the largest value that can be represented by this integer type.
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#869)const: [unstable](https://github.com/rust-lang/rust/issues/85532 "Tracking issue for const_bigint_helper_methods") · #### pub fn widening\_mul(self, rhs: u64) -> (u64, u64)
🔬This is a nightly-only experimental API. (`bigint_helper_methods` [#85532](https://github.com/rust-lang/rust/issues/85532))
Calculates the complete product `self * rhs` without the possibility to overflow.
This returns the low-order (wrapping) bits and the high-order (overflow) bits of the result as two separate values, in that order.
##### Examples
Basic usage:
Please note that this example is shared between integer types. Which explains why `u32` is used here.
```
#![feature(bigint_helper_methods)]
assert_eq!(5u32.widening_mul(2), (10, 0));
assert_eq!(1_000_000_000u32.widening_mul(10), (1410065408, 2));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#869)const: [unstable](https://github.com/rust-lang/rust/issues/85532 "Tracking issue for bigint_helper_methods") · #### pub fn carrying\_mul(self, rhs: u64, carry: u64) -> (u64, u64)
🔬This is a nightly-only experimental API. (`bigint_helper_methods` [#85532](https://github.com/rust-lang/rust/issues/85532))
Calculates the “full multiplication” `self * rhs + carry` without the possibility to overflow.
This returns the low-order (wrapping) bits and the high-order (overflow) bits of the result as two separate values, in that order.
Performs “long multiplication” which takes in an extra amount to add, and may return an additional amount of overflow. This allows for chaining together multiple multiplications to create “big integers” which represent larger values.
##### Examples
Basic usage:
Please note that this example is shared between integer types. Which explains why `u32` is used here.
```
#![feature(bigint_helper_methods)]
assert_eq!(5u32.carrying_mul(2, 0), (10, 0));
assert_eq!(5u32.carrying_mul(2, 10), (20, 0));
assert_eq!(1_000_000_000u32.carrying_mul(10, 0), (1410065408, 2));
assert_eq!(1_000_000_000u32.carrying_mul(10, 10), (1410065418, 2));
assert_eq!(u64::MAX.carrying_mul(u64::MAX, u64::MAX), (0, u64::MAX));
```
If `carry` is zero, this is similar to [`overflowing_mul`](primitive.u64#method.overflowing_mul), except that it gives the value of the overflow instead of just whether one happened:
```
#![feature(bigint_helper_methods)]
let r = u8::carrying_mul(7, 13, 0);
assert_eq!((r.0, r.1 != 0), u8::overflowing_mul(7, 13));
let r = u8::carrying_mul(13, 42, 0);
assert_eq!((r.0, r.1 != 0), u8::overflowing_mul(13, 42));
```
The value of the first field in the returned tuple matches what you’d get by combining the [`wrapping_mul`](primitive.u64#method.wrapping_mul) and [`wrapping_add`](primitive.u64#method.wrapping_add) methods:
```
#![feature(bigint_helper_methods)]
assert_eq!(
789_u16.carrying_mul(456, 123).0,
789_u16.wrapping_mul(456).wrapping_add(123),
);
```
Trait Implementations
---------------------
[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
The resulting type after applying the `+` operator.
[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") · #### fn add(self, other: &u64) -> <u64 as Add<u64>>::Output
Performs the `+` operation. [Read more](ops/trait.add#tymethod.add)
[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
The resulting type after applying the `+` operator.
[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") · #### fn add(self, other: &u64) -> <u64 as Add<u64>>::Output
Performs the `+` operation. [Read more](ops/trait.add#tymethod.add)
[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
The resulting type after applying the `+` operator.
[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") · #### fn add(self, other: u64) -> <u64 as Add<u64>>::Output
Performs the `+` operation. [Read more](ops/trait.add#tymethod.add)
[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
The resulting type after applying the `+` operator.
[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") · #### fn add(self, other: u64) -> u64
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<&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/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/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/ops/arith.rs.html#786)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/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/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/ops/arith.rs.html#786)1.8.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/ops/arith.rs.html#786)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/fmt/num.rs.html#178)### impl Binary for u64
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#178)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error>
Formats the value using the given formatter.
[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
The resulting type after applying the `&` operator.
[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") · #### fn bitand(self, other: &u64) -> <u64 as BitAnd<u64>>::Output
Performs the `&` operation. [Read more](ops/trait.bitand#tymethod.bitand)
[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
The resulting type after applying the `&` operator.
[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") · #### fn bitand(self, other: &u64) -> <u64 as BitAnd<u64>>::Output
Performs the `&` operation. [Read more](ops/trait.bitand#tymethod.bitand)
[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
The resulting type after applying the `&` operator.
[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") · #### fn bitand(self, other: u64) -> <u64 as BitAnd<u64>>::Output
Performs the `&` operation. [Read more](ops/trait.bitand#tymethod.bitand)
[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
The resulting type after applying the `&` operator.
[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") · #### fn bitand(self, rhs: u64) -> u64
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<&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/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/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/ops/bit.rs.html#734)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/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/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/ops/bit.rs.html#734)1.8.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/ops/bit.rs.html#734)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/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
The resulting type after applying the `|` operator.
[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") · #### fn bitor(self, other: &u64) -> <u64 as BitOr<u64>>::Output
Performs the `|` operation. [Read more](ops/trait.bitor#tymethod.bitor)
[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
The resulting type after applying the `|` operator.
[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") · #### fn bitor(self, other: &u64) -> <u64 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 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/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
The resulting type after applying the `|` operator.
[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") · #### fn bitor(self, other: u64) -> <u64 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 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/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
The resulting type after applying the `|` operator.
[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") · #### fn bitor(self, rhs: u64) -> u64
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<&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/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/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/ops/bit.rs.html#806)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/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/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/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/ops/bit.rs.html#806)1.8.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/ops/bit.rs.html#806)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/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
The resulting type after applying the `^` operator.
[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") · #### fn bitxor(self, other: &u64) -> <u64 as BitXor<u64>>::Output
Performs the `^` operation. [Read more](ops/trait.bitxor#tymethod.bitxor)
[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
The resulting type after applying the `^` operator.
[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") · #### fn bitxor(self, other: &u64) -> <u64 as BitXor<u64>>::Output
Performs the `^` operation. [Read more](ops/trait.bitxor#tymethod.bitxor)
[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
The resulting type after applying the `^` operator.
[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") · #### fn bitxor(self, other: u64) -> <u64 as BitXor<u64>>::Output
Performs the `^` operation. [Read more](ops/trait.bitxor#tymethod.bitxor)
[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
The resulting type after applying the `^` operator.
[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") · #### fn bitxor(self, other: u64) -> u64
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<&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/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/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/ops/bit.rs.html#878)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/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/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/ops/bit.rs.html#878)1.8.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/ops/bit.rs.html#878)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/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") · #### fn clone(&self) -> u64
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/num.rs.html#197-200)### impl Debug for u64
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#197-200)#### 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/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#211)const: [unstable](https://github.com/rust-lang/rust/issues/87864 "Tracking issue for const_default_impls") · #### fn default() -> u64
Returns the default value of `0`
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#461-464)### impl Display for u64
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#461-464)#### 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/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
The resulting type after applying the `/` operator.
[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") · #### fn div(self, other: &u64) -> <u64 as Div<u64>>::Output
Performs the `/` operation. [Read more](ops/trait.div#tymethod.div)
[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
The resulting type after applying the `/` operator.
[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") · #### fn div(self, other: &u64) -> <u64 as Div<u64>>::Output
Performs the `/` operation. [Read more](ops/trait.div#tymethod.div)
[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/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
The resulting type after applying the `/` operator.
[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") · #### fn div(self, other: u64) -> <u64 as Div<u64>>::Output
Performs the `/` operation. [Read more](ops/trait.div#tymethod.div)
[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
The resulting type after applying the `/` operator.
[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") · #### fn div(self, other: u64) -> u64
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<&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/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/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/ops/arith.rs.html#968)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/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/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/ops/arith.rs.html#968)1.8.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/ops/arith.rs.html#968)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/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#89)1.28.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<bool> for u64
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#89)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: bool) -> u64
Converts a `bool` to a `u64`. The resulting value is `0` for `false` and `1` for `true` values.
##### Examples
```
assert_eq!(u64::from(true), 1);
assert_eq!(u64::from(false), 0);
```
[source](https://doc.rust-lang.org/src/core/char/convert.rs.html#51)1.51.0 (const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert")) · ### impl From<char> for u64
[source](https://doc.rust-lang.org/src/core/char/convert.rs.html#64)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn from(c: char) -> u64
Converts a [`char`](primitive.char "char") into a [`u64`](primitive.u64 "u64").
##### Examples
```
use std::mem;
let c = '👤';
let u = u64::from(c);
assert!(8 == mem::size_of_val(&u))
```
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#106)1.5.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<u16> for u64
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#106)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: u16) -> u64
Converts `u16` to `u64` losslessly.
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#108)1.5.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<u32> for u64
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#108)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: u32) -> u64
Converts `u32` to `u64` losslessly.
[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/87852 "Tracking issue for const_num_from_num")) · ### impl From<u64> for AtomicU64
[source](https://doc.rust-lang.org/src/core/sync/atomic.rs.html#2815-2833)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(v: u64) -> AtomicU64
Converts an `u64` into an `AtomicU64`.
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#135)1.26.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<u64> for i128
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#135)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: u64) -> i128
Converts `u64` to `i128` losslessly.
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#110)1.26.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<u64> for u128
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#110)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: u64) -> u128
Converts `u64` to `u128` losslessly.
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#102)1.5.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<u8> for u64
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#102)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: u8) -> u64
Converts `u8` to `u64` losslessly.
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#1018)### impl FromStr for u64
#### type Err = ParseIntError
The associated error which can be returned from parsing.
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#1018)#### fn from\_str(src: &str) -> Result<u64, ParseIntError>
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/hash/mod.rs.html#829-842)### impl Hash for u64
[source](https://doc.rust-lang.org/src/core/hash/mod.rs.html#829-842)#### 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#829-842)#### fn hash\_slice<H>(data: &[u64], 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/fmt/num.rs.html#465-468)1.42.0 · ### impl LowerExp for u64
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#465-468)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error>
Formats the value using the given formatter.
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#178)### impl LowerHex for u64
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#178)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error>
Formats the value using the given formatter.
[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
The resulting type after applying the `*` operator.
[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") · #### fn mul(self, other: &u64) -> <u64 as Mul<u64>>::Output
Performs the `*` operation. [Read more](ops/trait.mul#tymethod.mul)
[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
The resulting type after applying the `*` operator.
[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") · #### fn mul(self, other: &u64) -> <u64 as Mul<u64>>::Output
Performs the `*` operation. [Read more](ops/trait.mul#tymethod.mul)
[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
The resulting type after applying the `*` operator.
[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") · #### fn mul(self, other: u64) -> <u64 as Mul<u64>>::Output
Performs the `*` operation. [Read more](ops/trait.mul#tymethod.mul)
[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
The resulting type after applying the `*` operator.
[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") · #### fn mul(self, other: u64) -> u64
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<&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/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/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/ops/arith.rs.html#911)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/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/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/ops/arith.rs.html#911)1.8.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/ops/arith.rs.html#911)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/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
The resulting type after applying the `!` operator.
[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") · #### fn not(self) -> <u64 as Not>::Output
Performs the unary `!` operation. [Read more](ops/trait.not#tymethod.not)
[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
The resulting type after applying the `!` operator.
[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") · #### fn not(self) -> u64
Performs the unary `!` operation. [Read more](ops/trait.not#tymethod.not)
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#178)### impl Octal for u64
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#178)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error>
Formats the value using the given formatter.
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1486)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · ### impl Ord for u64
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1486)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · #### fn cmp(&self, other: &u64) -> 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/cmp.rs.html#1366-1368)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · ### impl PartialEq<u64> for u64
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1366-1368)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · #### fn eq(&self, other: &u64) -> 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#1366-1368)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · #### fn ne(&self, other: &u64) -> 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/cmp.rs.html#1486)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · ### impl PartialOrd<u64> for u64
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1486)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · #### fn partial\_cmp(&self, other: &u64) -> 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#1486)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · #### fn lt(&self, other: &u64) -> 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#1486)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · #### fn le(&self, other: &u64) -> 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#1486)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · #### fn ge(&self, other: &u64) -> 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/cmp.rs.html#1486)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · #### fn gt(&self, other: &u64) -> 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/iter/traits/accum.rs.html#141)1.12.0 · ### impl<'a> Product<&'a u64> for u64
[source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)#### fn product<I>(iter: I) -> u64where I: [Iterator](iter/trait.iterator "trait std::iter::Iterator")<Item = &'a [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.12.0 · ### impl Product<u64> for u64
[source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)#### fn product<I>(iter: I) -> u64where I: [Iterator](iter/trait.iterator "trait std::iter::Iterator")<Item = [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/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
The resulting type after applying the `%` operator.
[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") · #### fn rem(self, other: &u64) -> <u64 as Rem<u64>>::Output
Performs the `%` operation. [Read more](ops/trait.rem#tymethod.rem)
[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
The resulting type after applying the `%` operator.
[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") · #### fn rem(self, other: &u64) -> <u64 as Rem<u64>>::Output
Performs the `%` operation. [Read more](ops/trait.rem#tymethod.rem)
[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/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
The resulting type after applying the `%` operator.
[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") · #### fn rem(self, other: u64) -> <u64 as Rem<u64>>::Output
Performs the `%` operation. [Read more](ops/trait.rem#tymethod.rem)
[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
The resulting type after applying the `%` operator.
[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") · #### fn rem(self, other: u64) -> u64
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<&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/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/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/ops/arith.rs.html#1029)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/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/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/ops/arith.rs.html#1029)1.8.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/ops/arith.rs.html#1029)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/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i128) -> <u64 as Shl<i128>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i128) -> <u64 as Shl<i128>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i16) -> <u64 as Shl<i16>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i16) -> <u64 as Shl<i16>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i32) -> <u64 as Shl<i32>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i32) -> <u64 as Shl<i32>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i64) -> <u64 as Shl<i64>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i64) -> <u64 as Shl<i64>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i8) -> <u64 as Shl<i8>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i8) -> <u64 as Shl<i8>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &isize) -> <u64 as Shl<isize>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &isize) -> <u64 as Shl<isize>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u128) -> <u64 as Shl<u128>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u128) -> <u64 as Shl<u128>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u16) -> <u64 as Shl<u16>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u16) -> <u64 as Shl<u16>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u32) -> <u64 as Shl<u32>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u32) -> <u64 as Shl<u32>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u64) -> <i128 as Shl<u64>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u64) -> <i16 as Shl<u64>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u64) -> <i32 as Shl<u64>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u64) -> <i64 as Shl<u64>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u64) -> <i8 as Shl<u64>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u64) -> <isize as Shl<u64>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u64) -> <u128 as Shl<u64>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u64) -> <u16 as Shl<u64>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u64) -> <u32 as Shl<u64>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u64) -> <u64 as Shl<u64>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u64) -> <u8 as Shl<u64>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u64) -> <usize as Shl<u64>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u64) -> <i128 as Shl<u64>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u64) -> <i16 as Shl<u64>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u64) -> <i32 as Shl<u64>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u64) -> <i64 as Shl<u64>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u64) -> <i8 as Shl<u64>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u64) -> <isize as Shl<u64>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u64) -> <u128 as Shl<u64>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u64) -> <u16 as Shl<u64>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u64) -> <u32 as Shl<u64>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u64) -> <u64 as Shl<u64>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u64) -> <u8 as Shl<u64>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u64) -> <usize as Shl<u64>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u8) -> <u64 as Shl<u8>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u8) -> <u64 as Shl<u8>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &usize) -> <u64 as Shl<usize>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &usize) -> <u64 as Shl<usize>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i128) -> <u64 as Shl<i128>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i128) -> u64
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i16) -> <u64 as Shl<i16>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i16) -> u64
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i32) -> <u64 as Shl<i32>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i32) -> u64
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i64) -> <u64 as Shl<i64>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i64) -> u64
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i8) -> <u64 as Shl<i8>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i8) -> u64
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: isize) -> <u64 as Shl<isize>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: isize) -> u64
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u128) -> <u64 as Shl<u128>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u128) -> u64
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u16) -> <u64 as Shl<u16>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u16) -> u64
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u32) -> <u64 as Shl<u32>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u32) -> u64
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u64) -> <i128 as Shl<u64>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u64) -> <i16 as Shl<u64>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u64) -> <i32 as Shl<u64>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u64) -> <i64 as Shl<u64>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u64) -> <i8 as Shl<u64>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u64) -> <isize as Shl<u64>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u64) -> <u128 as Shl<u64>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u64) -> <u16 as Shl<u64>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u64) -> <u32 as Shl<u64>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u64) -> <u64 as Shl<u64>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u64) -> <u8 as Shl<u64>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u64) -> <usize as Shl<u64>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u64) -> i128
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u64) -> i16
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u64) -> i32
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u64) -> i64
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u64) -> i8
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u64) -> isize
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u64) -> u128
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u64) -> u16
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u64) -> u32
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u64) -> u64
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u64) -> u8
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u64) -> usize
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u8) -> <u64 as Shl<u8>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u8) -> u64
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: usize) -> <u64 as Shl<usize>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: usize) -> u64
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &i128)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &i16)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &i32)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &i64)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &i8)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &isize)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &u128)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &u16)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &u32)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &u64)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &u64)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &u64)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &u64)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &u64)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &u64)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &u64)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &u64)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &u64)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &u64)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &u64)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &u64)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &u8)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)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/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: i128)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: i16)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: i32)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: i64)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: i8)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: isize)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: u128)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: u16)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: u32)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: u64)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: u64)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: u64)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: u64)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: u64)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: u64)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: u64)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: u64)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: u64)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: u64)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: u64)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: u64)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: u8)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)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/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i128) -> <u64 as Shr<i128>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i128) -> <u64 as Shr<i128>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i16) -> <u64 as Shr<i16>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i16) -> <u64 as Shr<i16>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i32) -> <u64 as Shr<i32>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i32) -> <u64 as Shr<i32>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i64) -> <u64 as Shr<i64>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i64) -> <u64 as Shr<i64>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i8) -> <u64 as Shr<i8>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i8) -> <u64 as Shr<i8>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &isize) -> <u64 as Shr<isize>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &isize) -> <u64 as Shr<isize>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u128) -> <u64 as Shr<u128>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u128) -> <u64 as Shr<u128>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u16) -> <u64 as Shr<u16>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u16) -> <u64 as Shr<u16>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u32) -> <u64 as Shr<u32>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u32) -> <u64 as Shr<u32>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u64) -> <i128 as Shr<u64>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u64) -> <i16 as Shr<u64>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u64) -> <i32 as Shr<u64>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u64) -> <i64 as Shr<u64>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u64) -> <i8 as Shr<u64>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u64) -> <isize as Shr<u64>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u64) -> <u128 as Shr<u64>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u64) -> <u16 as Shr<u64>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u64) -> <u32 as Shr<u64>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u64) -> <u64 as Shr<u64>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u64) -> <u8 as Shr<u64>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u64) -> <usize as Shr<u64>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u64) -> <i128 as Shr<u64>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u64) -> <i16 as Shr<u64>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u64) -> <i32 as Shr<u64>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u64) -> <i64 as Shr<u64>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u64) -> <i8 as Shr<u64>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u64) -> <isize as Shr<u64>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u64) -> <u128 as Shr<u64>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u64) -> <u16 as Shr<u64>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u64) -> <u32 as Shr<u64>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u64) -> <u64 as Shr<u64>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u64) -> <u8 as Shr<u64>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u64) -> <usize as Shr<u64>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u8) -> <u64 as Shr<u8>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u8) -> <u64 as Shr<u8>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &usize) -> <u64 as Shr<usize>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &usize) -> <u64 as Shr<usize>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i128) -> <u64 as Shr<i128>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i128) -> u64
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i16) -> <u64 as Shr<i16>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i16) -> u64
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i32) -> <u64 as Shr<i32>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i32) -> u64
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i64) -> <u64 as Shr<i64>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i64) -> u64
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i8) -> <u64 as Shr<i8>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i8) -> u64
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: isize) -> <u64 as Shr<isize>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: isize) -> u64
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u128) -> <u64 as Shr<u128>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u128) -> u64
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u16) -> <u64 as Shr<u16>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u16) -> u64
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u32) -> <u64 as Shr<u32>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u32) -> u64
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u64) -> <i128 as Shr<u64>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u64) -> <i16 as Shr<u64>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u64) -> <i32 as Shr<u64>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u64) -> <i64 as Shr<u64>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u64) -> <i8 as Shr<u64>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u64) -> <isize as Shr<u64>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u64) -> <u128 as Shr<u64>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u64) -> <u16 as Shr<u64>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u64) -> <u32 as Shr<u64>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u64) -> <u64 as Shr<u64>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u64) -> <u8 as Shr<u64>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u64) -> <usize as Shr<u64>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u64) -> i128
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u64) -> i16
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u64) -> i32
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u64) -> i64
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u64) -> i8
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u64) -> isize
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u64) -> u128
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u64) -> u16
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u64) -> u32
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u64) -> u64
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u64) -> u8
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u64) -> usize
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u8) -> <u64 as Shr<u8>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u8) -> u64
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: usize) -> <u64 as Shr<usize>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: usize) -> u64
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &i128)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &i16)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &i32)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &i64)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &i8)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &isize)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &u128)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &u16)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &u32)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &u64)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &u64)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &u64)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &u64)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &u64)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &u64)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &u64)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &u64)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &u64)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &u64)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &u64)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &u64)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &u8)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)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/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: i128)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: i16)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: i32)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: i64)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: i8)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: isize)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: u128)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: u16)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: u32)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: u64)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: u64)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: u64)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: u64)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: u64)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: u64)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: u64)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: u64)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: u64)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: u64)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: u64)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: u64)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: u8)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)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/up/up/portable-simd/crates/core_simd/src/vector.rs.html#684)### impl SimdElement for u64
#### type Mask = i64
🔬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.
[source](https://doc.rust-lang.org/src/core/iter/range.rs.html#391-394)### impl Step for u64
[source](https://doc.rust-lang.org/src/core/iter/range.rs.html#391-394)#### unsafe fn forward\_unchecked(start: u64, n: usize) -> u64
🔬This is a nightly-only experimental API. (`step_trait` [#42168](https://github.com/rust-lang/rust/issues/42168))
Returns the value that would be obtained by taking the *successor* of `self` `count` times. [Read more](iter/trait.step#method.forward_unchecked)
[source](https://doc.rust-lang.org/src/core/iter/range.rs.html#391-394)#### unsafe fn backward\_unchecked(start: u64, n: usize) -> u64
🔬This is a nightly-only experimental API. (`step_trait` [#42168](https://github.com/rust-lang/rust/issues/42168))
Returns the value that would be obtained by taking the *predecessor* of `self` `count` times. [Read more](iter/trait.step#method.backward_unchecked)
[source](https://doc.rust-lang.org/src/core/iter/range.rs.html#391-394)#### fn forward(start: u64, n: usize) -> u64
🔬This is a nightly-only experimental API. (`step_trait` [#42168](https://github.com/rust-lang/rust/issues/42168))
Returns the value that would be obtained by taking the *successor* of `self` `count` times. [Read more](iter/trait.step#method.forward)
[source](https://doc.rust-lang.org/src/core/iter/range.rs.html#391-394)#### fn backward(start: u64, n: usize) -> u64
🔬This is a nightly-only experimental API. (`step_trait` [#42168](https://github.com/rust-lang/rust/issues/42168))
Returns the value that would be obtained by taking the *predecessor* of `self` `count` times. [Read more](iter/trait.step#method.backward)
[source](https://doc.rust-lang.org/src/core/iter/range.rs.html#391-394)#### fn steps\_between(start: &u64, end: &u64) -> Option<usize>
🔬This is a nightly-only experimental API. (`step_trait` [#42168](https://github.com/rust-lang/rust/issues/42168))
Returns the number of *successor* steps required to get from `start` to `end`. [Read more](iter/trait.step#tymethod.steps_between)
[source](https://doc.rust-lang.org/src/core/iter/range.rs.html#391-394)#### fn forward\_checked(start: u64, n: usize) -> Option<u64>
🔬This is a nightly-only experimental API. (`step_trait` [#42168](https://github.com/rust-lang/rust/issues/42168))
Returns the value that would be obtained by taking the *successor* of `self` `count` times. [Read more](iter/trait.step#tymethod.forward_checked)
[source](https://doc.rust-lang.org/src/core/iter/range.rs.html#391-394)#### fn backward\_checked(start: u64, n: usize) -> Option<u64>
🔬This is a nightly-only experimental API. (`step_trait` [#42168](https://github.com/rust-lang/rust/issues/42168))
Returns the value that would be obtained by taking the *predecessor* of `self` `count` times. [Read more](iter/trait.step#tymethod.backward_checked)
[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
The resulting type after applying the `-` operator.
[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") · #### fn sub(self, other: &u64) -> <u64 as Sub<u64>>::Output
Performs the `-` operation. [Read more](ops/trait.sub#tymethod.sub)
[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
The resulting type after applying the `-` operator.
[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") · #### fn sub(self, other: &u64) -> <u64 as Sub<u64>>::Output
Performs the `-` operation. [Read more](ops/trait.sub#tymethod.sub)
[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
The resulting type after applying the `-` operator.
[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") · #### fn sub(self, other: u64) -> <u64 as Sub<u64>>::Output
Performs the `-` operation. [Read more](ops/trait.sub#tymethod.sub)
[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
The resulting type after applying the `-` operator.
[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") · #### fn sub(self, other: u64) -> u64
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<&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/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/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/ops/arith.rs.html#853)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/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/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/ops/arith.rs.html#853)1.8.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/ops/arith.rs.html#853)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/iter/traits/accum.rs.html#141)1.12.0 · ### impl<'a> Sum<&'a u64> for u64
[source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)#### fn sum<I>(iter: I) -> u64where I: [Iterator](iter/trait.iterator "trait std::iter::Iterator")<Item = &'a [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.12.0 · ### impl Sum<u64> for u64
[source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)#### fn sum<I>(iter: I) -> u64where I: [Iterator](iter/trait.iterator "trait std::iter::Iterator")<Item = [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/convert/num.rs.html#294)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<i128> for u64
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#294)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: i128) -> Result<u64, <u64 as TryFrom<i128>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#287)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<i16> for u64
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#287)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: i16) -> Result<u64, <u64 as TryFrom<i16>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#288)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<i32> for u64
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#288)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: i32) -> Result<u64, <u64 as TryFrom<i32>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#289)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<i64> for u64
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#289)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: i64) -> Result<u64, <u64 as TryFrom<i64>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#286)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<i8> for u64
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#286)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: i8) -> Result<u64, <u64 as TryFrom<i8>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#360)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<isize> for u64
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#360)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: isize) -> Result<u64, <u64 as TryFrom<isize>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#271)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<u128> for u64
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#271)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: u128) -> Result<u64, <u64 as TryFrom<u128>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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/convert/num.rs.html#282)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<u64> for i16
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#282)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: u64) -> Result<i16, <i16 as TryFrom<u64>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#282)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<u64> for i32
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#282)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: u64) -> Result<i32, <i32 as TryFrom<u64>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#282)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<u64> for i64
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#282)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: u64) -> Result<i64, <i64 as TryFrom<u64>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#282)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<u64> for i8
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#282)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: u64) -> Result<i8, <i8 as TryFrom<u64>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#370)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<u64> for isize
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#370)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: u64) -> Result<isize, <isize as TryFrom<u64>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#270)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<u64> for u16
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#270)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: u64) -> Result<u16, <u16 as TryFrom<u64>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#270)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<u64> for u32
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#270)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: u64) -> Result<u32, <u32 as TryFrom<u64>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#270)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<u64> for u8
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#270)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: u64) -> Result<u8, <u8 as TryFrom<u64>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#364)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<u64> for usize
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#364)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(value: u64) -> Result<usize, <usize as TryFrom<u64>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#355)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<usize> for u64
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#355)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(value: usize) -> Result<u64, <u64 as TryFrom<usize>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### type Error = TryFromIntError
The type returned in the event of a conversion error.
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#465-468)1.42.0 · ### impl UpperExp for u64
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#465-468)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error>
Formats the value using the given formatter.
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#178)### impl UpperHex for u64
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#178)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error>
Formats the value using the given formatter.
[source](https://doc.rust-lang.org/src/core/marker.rs.html#830-835)### impl Copy for u64
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1377)### impl Eq for u64
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#38)### impl FloatToInt<u64> for f32
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#39)### impl FloatToInt<u64> for f64
[source](https://doc.rust-lang.org/src/core/iter/range.rs.html#17)### impl TrustedStep for u64
Auto Trait Implementations
--------------------------
### impl RefUnwindSafe for u64
### impl Send for u64
### impl Sync for u64
### impl Unpin for u64
### impl UnwindSafe for u64
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 Macro std::debug_assert_ne Macro std::debug\_assert\_ne
============================
```
macro_rules! debug_assert_ne {
($($arg:tt)*) => { ... };
}
```
Asserts that two expressions are not equal to each other.
On panic, this macro will print the values of the expressions with their debug representations.
Unlike [`assert_ne!`](macro.assert_ne "assert_ne!"), `debug_assert_ne!` statements are only enabled in non optimized builds by default. An optimized build will not execute `debug_assert_ne!` statements unless `-C debug-assertions` is passed to the compiler. This makes `debug_assert_ne!` useful for checks that are too expensive to be present in a release build but may be helpful during development. The result of expanding `debug_assert_ne!` is always type checked.
Examples
--------
```
let a = 3;
let b = 2;
debug_assert_ne!(a, b);
```
rust Keyword await Keyword await
=============
Suspend execution until the result of a [`Future`](future/trait.future) is ready.
`.await`ing a future will suspend the current function’s execution until the executor has run the future to completion.
Read the [async book](https://rust-lang.github.io/async-book/) for details on how [`async`](keyword.async)/`await` and executors work.
### Editions
`await` is a keyword from the 2018 edition onwards.
It is available for use in stable Rust from version 1.39 onwards.
rust Keyword type Keyword type
============
Define an alias for an existing type.
The syntax is `type Name = ExistingType;`.
Examples
--------
`type` does **not** create a new type:
```
type Meters = u32;
type Kilograms = u32;
let m: Meters = 3;
let k: Kilograms = 3;
assert_eq!(m, k);
```
In traits, `type` is used to declare an [associated type](../reference/items/associated-items#associated-types):
```
trait Iterator {
// associated type declaration
type Item;
fn next(&mut self) -> Option<Self::Item>;
}
struct Once<T>(Option<T>);
impl<T> Iterator for Once<T> {
// associated type definition
type Item = T;
fn next(&mut self) -> Option<Self::Item> {
self.0.take()
}
}
```
rust Keyword pub Keyword pub
===========
Make an item visible to others.
The keyword `pub` makes any module, function, or data structure accessible from inside of external modules. The `pub` keyword may also be used in a `use` declaration to re-export an identifier from a namespace.
For more information on the `pub` keyword, please see the visibility section of the [reference](../reference/visibility-and-privacy?highlight=pub#visibility-and-privacy) and for some examples, see [Rust by Example](https://doc.rust-lang.org/rust-by-example/mod/visibility.html).
rust Keyword super Keyword super
=============
The parent of the current [module](../reference/items/modules).
```
mod a {
pub fn foo() {}
}
mod b {
pub fn foo() {
super::a::foo(); // call a's foo function
}
}
```
It is also possible to use `super` multiple times: `super::super::foo`, going up the ancestor chain.
See the [Reference](../reference/paths#super) for more information.
rust Macro std::assert_eq Macro std::assert\_eq
=====================
```
macro_rules! assert_eq {
($left:expr, $right:expr $(,)?) => { ... };
($left:expr, $right:expr, $($arg:tt)+) => { ... };
}
```
Asserts that two expressions are equal to each other (using [`PartialEq`](cmp/trait.partialeq "PartialEq")).
On panic, this macro will print the values of the expressions with their debug representations.
Like [`assert!`](macro.assert "assert!"), this macro has a second form, where a custom panic message can be provided.
Examples
--------
```
let a = 3;
let b = 1 + 2;
assert_eq!(a, b);
assert_eq!(a, b, "we are testing addition with {} and {}", a, b);
```
rust Macro std::log_syntax Macro std::log\_syntax
======================
```
macro_rules! log_syntax {
($($arg:tt)*) => { ... };
}
```
🔬This is a nightly-only experimental API. (`log_syntax` [#29598](https://github.com/rust-lang/rust/issues/29598))
Prints passed tokens into the standard output.
rust Keyword self Keyword self
============
The receiver of a method, or the current module.
`self` is used in two situations: referencing the current module and marking the receiver of a method.
In paths, `self` can be used to refer to the current module, either in a [`use`](keyword.use) statement or in a path to access an element:
```
use std::io::{self, Read};
```
Is functionally the same as:
```
use std::io;
use std::io::Read;
```
Using `self` to access an element in the current module:
```
fn foo() {}
fn bar() {
self::foo()
}
```
`self` as the current receiver for a method allows to omit the parameter type most of the time. With the exception of this particularity, `self` is used much like any other parameter:
```
struct Foo(i32);
impl Foo {
// No `self`.
fn new() -> Self {
Self(0)
}
// Consuming `self`.
fn consume(self) -> Self {
Self(self.0 + 1)
}
// Borrowing `self`.
fn borrow(&self) -> &i32 {
&self.0
}
// Borrowing `self` mutably.
fn borrow_mut(&mut self) -> &mut i32 {
&mut self.0
}
}
// This method must be called with a `Type::` prefix.
let foo = Foo::new();
assert_eq!(foo.0, 0);
// Those two calls produces the same result.
let foo = Foo::consume(foo);
assert_eq!(foo.0, 1);
let foo = foo.consume();
assert_eq!(foo.0, 2);
// Borrowing is handled automatically with the second syntax.
let borrow_1 = Foo::borrow(&foo);
let borrow_2 = foo.borrow();
assert_eq!(borrow_1, borrow_2);
// Borrowing mutably is handled automatically too with the second syntax.
let mut foo = Foo::new();
*Foo::borrow_mut(&mut foo) += 1;
assert_eq!(foo.0, 1);
*foo.borrow_mut() += 1;
assert_eq!(foo.0, 2);
```
Note that this automatic conversion when calling `foo.method()` is not limited to the examples above. See the [Reference](../reference/items/associated-items#methods) for more information.
rust Keyword SelfTy Keyword SelfTy
==============
The implementing type within a [`trait`](keyword.trait) or [`impl`](keyword.impl) block, or the current type within a type definition.
Within a type definition:
```
struct Node {
elem: i32,
// `Self` is a `Node` here.
next: Option<Box<Self>>,
}
```
In an [`impl`](keyword.impl) block:
```
struct Foo(i32);
impl Foo {
fn new() -> Self {
Self(0)
}
}
assert_eq!(Foo::new().0, Foo(0).0);
```
Generic parameters are implicit with `Self`:
```
struct Wrap<T> {
elem: T,
}
impl<T> Wrap<T> {
fn new(elem: T) -> Self {
Self { elem }
}
}
```
In a [`trait`](keyword.trait) definition and related [`impl`](keyword.impl) block:
```
trait Example {
fn example() -> Self;
}
struct Foo(i32);
impl Example for Foo {
fn example() -> Self {
Self(42)
}
}
assert_eq!(Foo::example().0, Foo(42).0);
```
rust Keyword mut Keyword mut
===========
A mutable variable, reference, or pointer.
`mut` can be used in several situations. The first is mutable variables, which can be used anywhere you can bind a value to a variable name. Some examples:
```
// A mutable variable in the parameter list of a function.
fn foo(mut x: u8, y: u8) -> u8 {
x += y;
x
}
// Modifying a mutable variable.
let mut a = 5;
a = 6;
assert_eq!(foo(3, 4), 7);
assert_eq!(a, 6);
```
The second is mutable references. They can be created from `mut` variables and must be unique: no other variables can have a mutable reference, nor a shared reference.
```
// Taking a mutable reference.
fn push_two(v: &mut Vec<u8>) {
v.push(2);
}
// A mutable reference cannot be taken to a non-mutable variable.
let mut v = vec![0, 1];
// Passing a mutable reference.
push_two(&mut v);
assert_eq!(v, vec![0, 1, 2]);
```
ⓘ
```
let mut v = vec![0, 1];
let mut_ref_v = &mut v;
#[allow(unused)]
let ref_v = &v;
mut_ref_v.push(2);
```
Mutable raw pointers work much like mutable references, with the added possibility of not pointing to a valid object. The syntax is `*mut Type`.
More information on mutable references and pointers can be found in the [Reference](../reference/types/pointer#mutable-references-mut).
rust Keyword async Keyword async
=============
Return a [`Future`](future/trait.future) instead of blocking the current thread.
Use `async` in front of `fn`, `closure`, or a `block` to turn the marked code into a `Future`. As such the code will not be run immediately, but will only be evaluated when the returned future is [`.await`](keyword.await)ed.
We have written an [async book](https://rust-lang.github.io/async-book/) detailing `async`/`await` and trade-offs compared to using threads.
### Editions
`async` is a keyword from the 2018 edition onwards.
It is available for use in stable Rust from version 1.39 onwards.
rust Macro std::include_str Macro std::include\_str
=======================
```
macro_rules! include_str {
($file:expr $(,)?) => { ... };
}
```
Includes a UTF-8 encoded file as a string.
The file is located relative to the current file (similarly to how modules are found). The provided path is interpreted in a platform-specific way at compile time. So, for instance, an invocation with a Windows path containing backslashes `\` would not compile correctly on Unix.
This macro will yield an expression of type `&'static str` which is the contents of the file.
Examples
--------
Assume there are two files in the same directory with the following contents:
File ‘spanish.in’:
```
adiós
```
File ‘main.rs’:
ⓘ
```
fn main() {
let my_str = include_str!("spanish.in");
assert_eq!(my_str, "adiós\n");
print!("{my_str}");
}
```
Compiling ‘main.rs’ and running the resulting binary will print “adiós”.
rust Primitive Type i64 Primitive Type i64
==================
The 64-bit signed integer type.
Implementations
---------------
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#225)### impl i64
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#226-229)1.43.0 · #### pub const MIN: i64 = -9\_223\_372\_036\_854\_775\_808i64
The smallest value that can be represented by this integer type (−263)
##### Examples
Basic usage:
```
assert_eq!(i64::MIN, -9223372036854775808);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#226-229)1.43.0 · #### pub const MAX: i64 = 9\_223\_372\_036\_854\_775\_807i64
The largest value that can be represented by this integer type (263 − 1)
##### Examples
Basic usage:
```
assert_eq!(i64::MAX, 9223372036854775807);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#226-229)1.53.0 · #### pub const BITS: u32 = 64u32
The size of this integer type in bits.
##### Examples
```
assert_eq!(i64::BITS, 64);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#226-229)#### pub fn from\_str\_radix(src: &str, radix: u32) -> Result<i64, ParseIntError>
Converts a string slice in a given base to an integer.
The string is expected to be an optional `+` or `-` sign followed by digits. Leading and trailing whitespace represent an error. Digits are a subset of these characters, depending on `radix`:
* `0-9`
* `a-z`
* `A-Z`
##### Panics
This function panics if `radix` is not in the range from 2 to 36.
##### Examples
Basic usage:
```
assert_eq!(i64::from_str_radix("A", 16), Ok(10));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#226-229)const: 1.32.0 · #### pub const fn count\_ones(self) -> u32
Returns the number of ones in the binary representation of `self`.
##### Examples
Basic usage:
```
let n = 0b100_0000i64;
assert_eq!(n.count_ones(), 1);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#226-229)const: 1.32.0 · #### pub const fn count\_zeros(self) -> u32
Returns the number of zeros in the binary representation of `self`.
##### Examples
Basic usage:
```
assert_eq!(i64::MAX.count_zeros(), 1);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#226-229)const: 1.32.0 · #### pub const fn leading\_zeros(self) -> u32
Returns the number of leading zeros in the binary representation of `self`.
##### Examples
Basic usage:
```
let n = -1i64;
assert_eq!(n.leading_zeros(), 0);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#226-229)const: 1.32.0 · #### pub const fn trailing\_zeros(self) -> u32
Returns the number of trailing zeros in the binary representation of `self`.
##### Examples
Basic usage:
```
let n = -4i64;
assert_eq!(n.trailing_zeros(), 2);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#226-229)1.46.0 (const: 1.46.0) · #### pub const fn leading\_ones(self) -> u32
Returns the number of leading ones in the binary representation of `self`.
##### Examples
Basic usage:
```
let n = -1i64;
assert_eq!(n.leading_ones(), 64);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#226-229)1.46.0 (const: 1.46.0) · #### pub const fn trailing\_ones(self) -> u32
Returns the number of trailing ones in the binary representation of `self`.
##### Examples
Basic usage:
```
let n = 3i64;
assert_eq!(n.trailing_ones(), 2);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#226-229)const: 1.32.0 · #### pub const fn rotate\_left(self, n: u32) -> i64
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:
```
let n = 0xaa00000000006e1i64;
let m = 0x6e10aa;
assert_eq!(n.rotate_left(12), m);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#226-229)const: 1.32.0 · #### pub const fn rotate\_right(self, n: u32) -> i64
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:
```
let n = 0x6e10aai64;
let m = 0xaa00000000006e1;
assert_eq!(n.rotate_right(12), m);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#226-229)const: 1.32.0 · #### pub const fn swap\_bytes(self) -> i64
Reverses the byte order of the integer.
##### Examples
Basic usage:
```
let n = 0x1234567890123456i64;
let m = n.swap_bytes();
assert_eq!(m, 0x5634129078563412);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#226-229)1.37.0 (const: 1.37.0) · #### pub const fn reverse\_bits(self) -> i64
Reverses the order of bits in the integer. The least significant bit becomes the most significant bit, second least-significant bit becomes second most-significant bit, etc.
##### Examples
Basic usage:
```
let n = 0x1234567890123456i64;
let m = n.reverse_bits();
assert_eq!(m, 0x6a2c48091e6a2c48);
assert_eq!(0, 0i64.reverse_bits());
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#226-229)const: 1.32.0 · #### pub const fn from\_be(x: i64) -> i64
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:
```
let n = 0x1Ai64;
if cfg!(target_endian = "big") {
assert_eq!(i64::from_be(n), n)
} else {
assert_eq!(i64::from_be(n), n.swap_bytes())
}
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#226-229)const: 1.32.0 · #### pub const fn from\_le(x: i64) -> i64
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:
```
let n = 0x1Ai64;
if cfg!(target_endian = "little") {
assert_eq!(i64::from_le(n), n)
} else {
assert_eq!(i64::from_le(n), n.swap_bytes())
}
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#226-229)const: 1.32.0 · #### pub const fn to\_be(self) -> i64
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:
```
let n = 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/mod.rs.html#226-229)const: 1.32.0 · #### pub const fn to\_le(self) -> i64
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:
```
let n = 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/mod.rs.html#226-229)const: 1.47.0 · #### pub const fn checked\_add(self, rhs: i64) -> Option<i64>
Checked integer addition. Computes `self + rhs`, returning `None` if overflow occurred.
##### Examples
Basic usage:
```
assert_eq!((i64::MAX - 2).checked_add(1), Some(i64::MAX - 1));
assert_eq!((i64::MAX - 2).checked_add(3), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#226-229)const: [unstable](https://github.com/rust-lang/rust/issues/85122 "Tracking issue for const_inherent_unchecked_arith") · #### pub unsafe fn unchecked\_add(self, rhs: i64) -> i64
🔬This is a nightly-only experimental API. (`unchecked_math` [#85122](https://github.com/rust-lang/rust/issues/85122))
Unchecked integer addition. Computes `self + rhs`, assuming overflow cannot occur.
##### Safety
This results in undefined behavior when `self + rhs > i64::MAX` or `self + rhs < i64::MIN`, i.e. when [`checked_add`](primitive.i64#method.checked_add) would return `None`.
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#226-229)const: [unstable](https://github.com/rust-lang/rust/issues/87840 "Tracking issue for mixed_integer_ops") · #### pub fn checked\_add\_unsigned(self, rhs: u64) -> Option<i64>
🔬This is a nightly-only experimental API. (`mixed_integer_ops` [#87840](https://github.com/rust-lang/rust/issues/87840))
Checked addition with an unsigned integer. Computes `self + rhs`, returning `None` if overflow occurred.
##### Examples
Basic usage:
```
assert_eq!(1i64.checked_add_unsigned(2), Some(3));
assert_eq!((i64::MAX - 2).checked_add_unsigned(3), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#226-229)const: 1.47.0 · #### pub const fn checked\_sub(self, rhs: i64) -> Option<i64>
Checked integer subtraction. Computes `self - rhs`, returning `None` if overflow occurred.
##### Examples
Basic usage:
```
assert_eq!((i64::MIN + 2).checked_sub(1), Some(i64::MIN + 1));
assert_eq!((i64::MIN + 2).checked_sub(3), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#226-229)const: [unstable](https://github.com/rust-lang/rust/issues/85122 "Tracking issue for const_inherent_unchecked_arith") · #### pub unsafe fn unchecked\_sub(self, rhs: i64) -> i64
🔬This is a nightly-only experimental API. (`unchecked_math` [#85122](https://github.com/rust-lang/rust/issues/85122))
Unchecked integer subtraction. Computes `self - rhs`, assuming overflow cannot occur.
##### Safety
This results in undefined behavior when `self - rhs > i64::MAX` or `self - rhs < i64::MIN`, i.e. when [`checked_sub`](primitive.i64#method.checked_sub) would return `None`.
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#226-229)const: [unstable](https://github.com/rust-lang/rust/issues/87840 "Tracking issue for mixed_integer_ops") · #### pub fn checked\_sub\_unsigned(self, rhs: u64) -> Option<i64>
🔬This is a nightly-only experimental API. (`mixed_integer_ops` [#87840](https://github.com/rust-lang/rust/issues/87840))
Checked subtraction with an unsigned integer. Computes `self - rhs`, returning `None` if overflow occurred.
##### Examples
Basic usage:
```
assert_eq!(1i64.checked_sub_unsigned(2), Some(-1));
assert_eq!((i64::MIN + 2).checked_sub_unsigned(3), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#226-229)const: 1.47.0 · #### pub const fn checked\_mul(self, rhs: i64) -> Option<i64>
Checked integer multiplication. Computes `self * rhs`, returning `None` if overflow occurred.
##### Examples
Basic usage:
```
assert_eq!(i64::MAX.checked_mul(1), Some(i64::MAX));
assert_eq!(i64::MAX.checked_mul(2), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#226-229)const: [unstable](https://github.com/rust-lang/rust/issues/85122 "Tracking issue for const_inherent_unchecked_arith") · #### pub unsafe fn unchecked\_mul(self, rhs: i64) -> i64
🔬This is a nightly-only experimental API. (`unchecked_math` [#85122](https://github.com/rust-lang/rust/issues/85122))
Unchecked integer multiplication. Computes `self * rhs`, assuming overflow cannot occur.
##### Safety
This results in undefined behavior when `self * rhs > i64::MAX` or `self * rhs < i64::MIN`, i.e. when [`checked_mul`](primitive.i64#method.checked_mul) would return `None`.
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#226-229)const: 1.52.0 · #### pub const fn checked\_div(self, rhs: i64) -> Option<i64>
Checked integer division. Computes `self / rhs`, returning `None` if `rhs == 0` or the division results in overflow.
##### Examples
Basic usage:
```
assert_eq!((i64::MIN + 1).checked_div(-1), Some(9223372036854775807));
assert_eq!(i64::MIN.checked_div(-1), None);
assert_eq!((1i64).checked_div(0), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#226-229)1.38.0 (const: 1.52.0) · #### pub const fn checked\_div\_euclid(self, rhs: i64) -> Option<i64>
Checked Euclidean division. Computes `self.div_euclid(rhs)`, returning `None` if `rhs == 0` or the division results in overflow.
##### Examples
Basic usage:
```
assert_eq!((i64::MIN + 1).checked_div_euclid(-1), Some(9223372036854775807));
assert_eq!(i64::MIN.checked_div_euclid(-1), None);
assert_eq!((1i64).checked_div_euclid(0), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#226-229)1.7.0 (const: 1.52.0) · #### pub const fn checked\_rem(self, rhs: i64) -> Option<i64>
Checked integer remainder. Computes `self % rhs`, returning `None` if `rhs == 0` or the division results in overflow.
##### Examples
Basic usage:
```
assert_eq!(5i64.checked_rem(2), Some(1));
assert_eq!(5i64.checked_rem(0), None);
assert_eq!(i64::MIN.checked_rem(-1), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#226-229)1.38.0 (const: 1.52.0) · #### pub const fn checked\_rem\_euclid(self, rhs: i64) -> Option<i64>
Checked Euclidean remainder. Computes `self.rem_euclid(rhs)`, returning `None` if `rhs == 0` or the division results in overflow.
##### Examples
Basic usage:
```
assert_eq!(5i64.checked_rem_euclid(2), Some(1));
assert_eq!(5i64.checked_rem_euclid(0), None);
assert_eq!(i64::MIN.checked_rem_euclid(-1), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#226-229)1.7.0 (const: 1.47.0) · #### pub const fn checked\_neg(self) -> Option<i64>
Checked negation. Computes `-self`, returning `None` if `self == MIN`.
##### Examples
Basic usage:
```
assert_eq!(5i64.checked_neg(), Some(-5));
assert_eq!(i64::MIN.checked_neg(), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#226-229)1.7.0 (const: 1.47.0) · #### pub const fn checked\_shl(self, rhs: u32) -> Option<i64>
Checked shift left. Computes `self << rhs`, returning `None` if `rhs` is larger than or equal to the number of bits in `self`.
##### Examples
Basic usage:
```
assert_eq!(0x1i64.checked_shl(4), Some(0x10));
assert_eq!(0x1i64.checked_shl(129), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#226-229)const: [unstable](https://github.com/rust-lang/rust/issues/85122 "Tracking issue for const_inherent_unchecked_arith") · #### pub unsafe fn unchecked\_shl(self, rhs: i64) -> i64
🔬This is a nightly-only experimental API. (`unchecked_math` [#85122](https://github.com/rust-lang/rust/issues/85122))
Unchecked shift left. Computes `self << rhs`, assuming that `rhs` is less than the number of bits in `self`.
##### Safety
This results in undefined behavior if `rhs` is larger than or equal to the number of bits in `self`, i.e. when [`checked_shl`](primitive.i64#method.checked_shl) would return `None`.
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#226-229)1.7.0 (const: 1.47.0) · #### pub const fn checked\_shr(self, rhs: u32) -> Option<i64>
Checked shift right. Computes `self >> rhs`, returning `None` if `rhs` is larger than or equal to the number of bits in `self`.
##### Examples
Basic usage:
```
assert_eq!(0x10i64.checked_shr(4), Some(0x1));
assert_eq!(0x10i64.checked_shr(128), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#226-229)const: [unstable](https://github.com/rust-lang/rust/issues/85122 "Tracking issue for const_inherent_unchecked_arith") · #### pub unsafe fn unchecked\_shr(self, rhs: i64) -> i64
🔬This is a nightly-only experimental API. (`unchecked_math` [#85122](https://github.com/rust-lang/rust/issues/85122))
Unchecked shift right. Computes `self >> rhs`, assuming that `rhs` is less than the number of bits in `self`.
##### Safety
This results in undefined behavior if `rhs` is larger than or equal to the number of bits in `self`, i.e. when [`checked_shr`](primitive.i64#method.checked_shr) would return `None`.
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#226-229)1.13.0 (const: 1.47.0) · #### pub const fn checked\_abs(self) -> Option<i64>
Checked absolute value. Computes `self.abs()`, returning `None` if `self == MIN`.
##### Examples
Basic usage:
```
assert_eq!((-5i64).checked_abs(), Some(5));
assert_eq!(i64::MIN.checked_abs(), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#226-229)1.34.0 (const: 1.50.0) · #### pub const fn checked\_pow(self, exp: u32) -> Option<i64>
Checked exponentiation. Computes `self.pow(exp)`, returning `None` if overflow occurred.
##### Examples
Basic usage:
```
assert_eq!(8i64.checked_pow(2), Some(64));
assert_eq!(i64::MAX.checked_pow(2), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#226-229)const: 1.47.0 · #### pub const fn saturating\_add(self, rhs: i64) -> i64
Saturating integer addition. Computes `self + rhs`, saturating at the numeric bounds instead of overflowing.
##### Examples
Basic usage:
```
assert_eq!(100i64.saturating_add(1), 101);
assert_eq!(i64::MAX.saturating_add(100), i64::MAX);
assert_eq!(i64::MIN.saturating_add(-1), i64::MIN);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#226-229)const: [unstable](https://github.com/rust-lang/rust/issues/87840 "Tracking issue for mixed_integer_ops") · #### pub fn saturating\_add\_unsigned(self, rhs: u64) -> i64
🔬This is a nightly-only experimental API. (`mixed_integer_ops` [#87840](https://github.com/rust-lang/rust/issues/87840))
Saturating addition with an unsigned integer. Computes `self + rhs`, saturating at the numeric bounds instead of overflowing.
##### Examples
Basic usage:
```
assert_eq!(1i64.saturating_add_unsigned(2), 3);
assert_eq!(i64::MAX.saturating_add_unsigned(100), i64::MAX);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#226-229)const: 1.47.0 · #### pub const fn saturating\_sub(self, rhs: i64) -> i64
Saturating integer subtraction. Computes `self - rhs`, saturating at the numeric bounds instead of overflowing.
##### Examples
Basic usage:
```
assert_eq!(100i64.saturating_sub(127), -27);
assert_eq!(i64::MIN.saturating_sub(100), i64::MIN);
assert_eq!(i64::MAX.saturating_sub(-1), i64::MAX);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#226-229)const: [unstable](https://github.com/rust-lang/rust/issues/87840 "Tracking issue for mixed_integer_ops") · #### pub fn saturating\_sub\_unsigned(self, rhs: u64) -> i64
🔬This is a nightly-only experimental API. (`mixed_integer_ops` [#87840](https://github.com/rust-lang/rust/issues/87840))
Saturating subtraction with an unsigned integer. Computes `self - rhs`, saturating at the numeric bounds instead of overflowing.
##### Examples
Basic usage:
```
assert_eq!(100i64.saturating_sub_unsigned(127), -27);
assert_eq!(i64::MIN.saturating_sub_unsigned(100), i64::MIN);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#226-229)1.45.0 (const: 1.47.0) · #### pub const fn saturating\_neg(self) -> i64
Saturating integer negation. Computes `-self`, returning `MAX` if `self == MIN` instead of overflowing.
##### Examples
Basic usage:
```
assert_eq!(100i64.saturating_neg(), -100);
assert_eq!((-100i64).saturating_neg(), 100);
assert_eq!(i64::MIN.saturating_neg(), i64::MAX);
assert_eq!(i64::MAX.saturating_neg(), i64::MIN + 1);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#226-229)1.45.0 (const: 1.47.0) · #### pub const fn saturating\_abs(self) -> i64
Saturating absolute value. Computes `self.abs()`, returning `MAX` if `self == MIN` instead of overflowing.
##### Examples
Basic usage:
```
assert_eq!(100i64.saturating_abs(), 100);
assert_eq!((-100i64).saturating_abs(), 100);
assert_eq!(i64::MIN.saturating_abs(), i64::MAX);
assert_eq!((i64::MIN + 1).saturating_abs(), i64::MAX);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#226-229)1.7.0 (const: 1.47.0) · #### pub const fn saturating\_mul(self, rhs: i64) -> i64
Saturating integer multiplication. Computes `self * rhs`, saturating at the numeric bounds instead of overflowing.
##### Examples
Basic usage:
```
assert_eq!(10i64.saturating_mul(12), 120);
assert_eq!(i64::MAX.saturating_mul(10), i64::MAX);
assert_eq!(i64::MIN.saturating_mul(10), i64::MIN);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#226-229)1.58.0 (const: 1.58.0) · #### pub const fn saturating\_div(self, rhs: i64) -> i64
Saturating integer division. Computes `self / rhs`, saturating at the numeric bounds instead of overflowing.
##### Examples
Basic usage:
```
assert_eq!(5i64.saturating_div(2), 2);
assert_eq!(i64::MAX.saturating_div(-1), i64::MIN + 1);
assert_eq!(i64::MIN.saturating_div(-1), i64::MAX);
```
ⓘ
```
let _ = 1i64.saturating_div(0);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#226-229)1.34.0 (const: 1.50.0) · #### pub const fn saturating\_pow(self, exp: u32) -> i64
Saturating integer exponentiation. Computes `self.pow(exp)`, saturating at the numeric bounds instead of overflowing.
##### Examples
Basic usage:
```
assert_eq!((-4i64).saturating_pow(3), -64);
assert_eq!(i64::MIN.saturating_pow(2), i64::MAX);
assert_eq!(i64::MIN.saturating_pow(3), i64::MIN);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#226-229)const: 1.32.0 · #### pub const fn wrapping\_add(self, rhs: i64) -> i64
Wrapping (modular) addition. Computes `self + rhs`, wrapping around at the boundary of the type.
##### Examples
Basic usage:
```
assert_eq!(100i64.wrapping_add(27), 127);
assert_eq!(i64::MAX.wrapping_add(2), i64::MIN + 1);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#226-229)const: [unstable](https://github.com/rust-lang/rust/issues/87840 "Tracking issue for mixed_integer_ops") · #### pub fn wrapping\_add\_unsigned(self, rhs: u64) -> i64
🔬This is a nightly-only experimental API. (`mixed_integer_ops` [#87840](https://github.com/rust-lang/rust/issues/87840))
Wrapping (modular) addition with an unsigned integer. Computes `self + rhs`, wrapping around at the boundary of the type.
##### Examples
Basic usage:
```
assert_eq!(100i64.wrapping_add_unsigned(27), 127);
assert_eq!(i64::MAX.wrapping_add_unsigned(2), i64::MIN + 1);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#226-229)const: 1.32.0 · #### pub const fn wrapping\_sub(self, rhs: i64) -> i64
Wrapping (modular) subtraction. Computes `self - rhs`, wrapping around at the boundary of the type.
##### Examples
Basic usage:
```
assert_eq!(0i64.wrapping_sub(127), -127);
assert_eq!((-2i64).wrapping_sub(i64::MAX), i64::MAX);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#226-229)const: [unstable](https://github.com/rust-lang/rust/issues/87840 "Tracking issue for mixed_integer_ops") · #### pub fn wrapping\_sub\_unsigned(self, rhs: u64) -> i64
🔬This is a nightly-only experimental API. (`mixed_integer_ops` [#87840](https://github.com/rust-lang/rust/issues/87840))
Wrapping (modular) subtraction with an unsigned integer. Computes `self - rhs`, wrapping around at the boundary of the type.
##### Examples
Basic usage:
```
assert_eq!(0i64.wrapping_sub_unsigned(127), -127);
assert_eq!((-2i64).wrapping_sub_unsigned(u64::MAX), -1);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#226-229)const: 1.32.0 · #### pub const fn wrapping\_mul(self, rhs: i64) -> i64
Wrapping (modular) multiplication. Computes `self * rhs`, wrapping around at the boundary of the type.
##### Examples
Basic usage:
```
assert_eq!(10i64.wrapping_mul(12), 120);
assert_eq!(11i8.wrapping_mul(12), -124);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#226-229)1.2.0 (const: 1.52.0) · #### pub const fn wrapping\_div(self, rhs: i64) -> i64
Wrapping (modular) division. Computes `self / rhs`, wrapping around at the boundary of the type.
The only case where such wrapping can occur is when one divides `MIN / -1` on a signed type (where `MIN` is the negative minimal value for the type); this is equivalent to `-MIN`, a positive value that is too large to represent in the type. In such a case, this function returns `MIN` itself.
##### Panics
This function will panic if `rhs` is 0.
##### Examples
Basic usage:
```
assert_eq!(100i64.wrapping_div(10), 10);
assert_eq!((-128i8).wrapping_div(-1), -128);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#226-229)1.38.0 (const: 1.52.0) · #### pub const fn wrapping\_div\_euclid(self, rhs: i64) -> i64
Wrapping Euclidean division. Computes `self.div_euclid(rhs)`, wrapping around at the boundary of the type.
Wrapping will only occur in `MIN / -1` on a signed type (where `MIN` is the negative minimal value for the type). This is equivalent to `-MIN`, a positive value that is too large to represent in the type. In this case, this method returns `MIN` itself.
##### Panics
This function will panic if `rhs` is 0.
##### Examples
Basic usage:
```
assert_eq!(100i64.wrapping_div_euclid(10), 10);
assert_eq!((-128i8).wrapping_div_euclid(-1), -128);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#226-229)1.2.0 (const: 1.52.0) · #### pub const fn wrapping\_rem(self, rhs: i64) -> i64
Wrapping (modular) remainder. Computes `self % rhs`, wrapping around at the boundary of the type.
Such wrap-around never actually occurs mathematically; implementation artifacts make `x % y` invalid for `MIN / -1` on a signed type (where `MIN` is the negative minimal value). In such a case, this function returns `0`.
##### Panics
This function will panic if `rhs` is 0.
##### Examples
Basic usage:
```
assert_eq!(100i64.wrapping_rem(10), 0);
assert_eq!((-128i8).wrapping_rem(-1), 0);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#226-229)1.38.0 (const: 1.52.0) · #### pub const fn wrapping\_rem\_euclid(self, rhs: i64) -> i64
Wrapping Euclidean remainder. Computes `self.rem_euclid(rhs)`, wrapping around at the boundary of the type.
Wrapping will only occur in `MIN % -1` on a signed type (where `MIN` is the negative minimal value for the type). In this case, this method returns 0.
##### Panics
This function will panic if `rhs` is 0.
##### Examples
Basic usage:
```
assert_eq!(100i64.wrapping_rem_euclid(10), 0);
assert_eq!((-128i8).wrapping_rem_euclid(-1), 0);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#226-229)1.2.0 (const: 1.32.0) · #### pub const fn wrapping\_neg(self) -> i64
Wrapping (modular) negation. Computes `-self`, wrapping around at the boundary of the type.
The only case where such wrapping can occur is when one negates `MIN` on a signed type (where `MIN` is 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:
```
assert_eq!(100i64.wrapping_neg(), -100);
assert_eq!(i64::MIN.wrapping_neg(), i64::MIN);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#226-229)1.2.0 (const: 1.32.0) · #### pub const fn wrapping\_shl(self, rhs: u32) -> i64
Panic-free bitwise shift-left; yields `self << mask(rhs)`, where `mask` removes any high-order bits of `rhs` that would cause the shift to exceed the bitwidth of the type.
Note that this is *not* the same as a rotate-left; the RHS of a wrapping shift-left is restricted to the range of the type, rather than the bits shifted out of the LHS being returned to the other end. The primitive integer types all implement a [`rotate_left`](primitive.i64#method.rotate_left) function, which may be what you want instead.
##### Examples
Basic usage:
```
assert_eq!((-1i64).wrapping_shl(7), -128);
assert_eq!((-1i64).wrapping_shl(128), -1);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#226-229)1.2.0 (const: 1.32.0) · #### pub const fn wrapping\_shr(self, rhs: u32) -> i64
Panic-free bitwise shift-right; yields `self >> mask(rhs)`, where `mask` removes any high-order bits of `rhs` that would cause the shift to exceed the bitwidth of the type.
Note that this is *not* the same as a rotate-right; the RHS of a wrapping shift-right is restricted to the range of the type, rather than the bits shifted out of the LHS being returned to the other end. The primitive integer types all implement a [`rotate_right`](primitive.i64#method.rotate_right) function, which may be what you want instead.
##### Examples
Basic usage:
```
assert_eq!((-128i64).wrapping_shr(7), -1);
assert_eq!((-128i16).wrapping_shr(64), -128);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#226-229)1.13.0 (const: 1.32.0) · #### pub const fn wrapping\_abs(self) -> i64
Wrapping (modular) absolute value. Computes `self.abs()`, 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:
```
assert_eq!(100i64.wrapping_abs(), 100);
assert_eq!((-100i64).wrapping_abs(), 100);
assert_eq!(i64::MIN.wrapping_abs(), i64::MIN);
assert_eq!((-128i8).wrapping_abs() as u8, 128);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#226-229)1.51.0 (const: 1.51.0) · #### pub const fn unsigned\_abs(self) -> u64
Computes the absolute value of `self` without any wrapping or panicking.
##### Examples
Basic usage:
```
assert_eq!(100i64.unsigned_abs(), 100u64);
assert_eq!((-100i64).unsigned_abs(), 100u64);
assert_eq!((-128i8).unsigned_abs(), 128u8);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#226-229)1.34.0 (const: 1.50.0) · #### pub const fn wrapping\_pow(self, exp: u32) -> i64
Wrapping (modular) exponentiation. Computes `self.pow(exp)`, wrapping around at the boundary of the type.
##### Examples
Basic usage:
```
assert_eq!(3i64.wrapping_pow(4), 81);
assert_eq!(3i8.wrapping_pow(5), -13);
assert_eq!(3i8.wrapping_pow(6), -39);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#226-229)1.7.0 (const: 1.32.0) · #### pub const fn overflowing\_add(self, rhs: i64) -> (i64, bool)
Calculates `self` + `rhs`
Returns a tuple of the addition along with a boolean indicating whether an arithmetic overflow would occur. If an overflow would have occurred then the wrapped value is returned.
##### Examples
Basic usage:
```
assert_eq!(5i64.overflowing_add(2), (7, false));
assert_eq!(i64::MAX.overflowing_add(1), (i64::MIN, true));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#226-229)const: [unstable](https://github.com/rust-lang/rust/issues/85532 "Tracking issue for const_bigint_helper_methods") · #### pub fn carrying\_add(self, rhs: i64, carry: bool) -> (i64, bool)
🔬This is a nightly-only experimental API. (`bigint_helper_methods` [#85532](https://github.com/rust-lang/rust/issues/85532))
Calculates `self + rhs + carry` without the ability to overflow.
Performs “signed ternary addition” which takes in an extra bit to add, and may return an additional bit of overflow. This signed function is used only on the highest-ordered data, for which the signed overflow result indicates whether the big integer overflowed or not.
##### Examples
Basic usage:
```
#![feature(bigint_helper_methods)]
assert_eq!(5i64.carrying_add(2, false), (7, false));
assert_eq!(5i64.carrying_add(2, true), (8, false));
assert_eq!(i64::MAX.carrying_add(1, false), (i64::MIN, true));
assert_eq!(i64::MAX.carrying_add(0, true), (i64::MIN, true));
assert_eq!(i64::MAX.carrying_add(1, true), (i64::MIN + 1, true));
assert_eq!(i64::MAX.carrying_add(i64::MAX, true), (-1, true));
assert_eq!(i64::MIN.carrying_add(-1, true), (i64::MIN, false));
assert_eq!(0i64.carrying_add(i64::MAX, true), (i64::MIN, true));
```
If `carry` is false, this method is equivalent to [`overflowing_add`](primitive.i64#method.overflowing_add):
```
#![feature(bigint_helper_methods)]
assert_eq!(5_i64.carrying_add(2, false), 5_i64.overflowing_add(2));
assert_eq!(i64::MAX.carrying_add(1, false), i64::MAX.overflowing_add(1));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#226-229)const: [unstable](https://github.com/rust-lang/rust/issues/87840 "Tracking issue for mixed_integer_ops") · #### pub fn overflowing\_add\_unsigned(self, rhs: u64) -> (i64, bool)
🔬This is a nightly-only experimental API. (`mixed_integer_ops` [#87840](https://github.com/rust-lang/rust/issues/87840))
Calculates `self` + `rhs` with an unsigned `rhs`
Returns a tuple of the addition along with a boolean indicating whether an arithmetic overflow would occur. If an overflow would have occurred then the wrapped value is returned.
##### Examples
Basic usage:
```
assert_eq!(1i64.overflowing_add_unsigned(2), (3, false));
assert_eq!((i64::MIN).overflowing_add_unsigned(u64::MAX), (i64::MAX, false));
assert_eq!((i64::MAX - 2).overflowing_add_unsigned(3), (i64::MIN, true));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#226-229)1.7.0 (const: 1.32.0) · #### pub const fn overflowing\_sub(self, rhs: i64) -> (i64, bool)
Calculates `self` - `rhs`
Returns a tuple of the subtraction along with a boolean indicating whether an arithmetic overflow would occur. If an overflow would have occurred then the wrapped value is returned.
##### Examples
Basic usage:
```
assert_eq!(5i64.overflowing_sub(2), (3, false));
assert_eq!(i64::MIN.overflowing_sub(1), (i64::MAX, true));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#226-229)const: [unstable](https://github.com/rust-lang/rust/issues/85532 "Tracking issue for const_bigint_helper_methods") · #### pub fn borrowing\_sub(self, rhs: i64, borrow: bool) -> (i64, bool)
🔬This is a nightly-only experimental API. (`bigint_helper_methods` [#85532](https://github.com/rust-lang/rust/issues/85532))
Calculates `self - rhs - borrow` without the ability to overflow.
Performs “signed ternary subtraction” which takes in an extra bit to subtract, and may return an additional bit of overflow. This signed function is used only on the highest-ordered data, for which the signed overflow result indicates whether the big integer overflowed or not.
##### Examples
Basic usage:
```
#![feature(bigint_helper_methods)]
assert_eq!(5i64.borrowing_sub(2, false), (3, false));
assert_eq!(5i64.borrowing_sub(2, true), (2, false));
assert_eq!(0i64.borrowing_sub(1, false), (-1, false));
assert_eq!(0i64.borrowing_sub(1, true), (-2, false));
assert_eq!(i64::MIN.borrowing_sub(1, true), (i64::MAX - 1, true));
assert_eq!(i64::MAX.borrowing_sub(-1, false), (i64::MIN, true));
assert_eq!(i64::MAX.borrowing_sub(-1, true), (i64::MAX, false));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#226-229)const: [unstable](https://github.com/rust-lang/rust/issues/87840 "Tracking issue for mixed_integer_ops") · #### pub fn overflowing\_sub\_unsigned(self, rhs: u64) -> (i64, bool)
🔬This is a nightly-only experimental API. (`mixed_integer_ops` [#87840](https://github.com/rust-lang/rust/issues/87840))
Calculates `self` - `rhs` with an unsigned `rhs`
Returns a tuple of the subtraction along with a boolean indicating whether an arithmetic overflow would occur. If an overflow would have occurred then the wrapped value is returned.
##### Examples
Basic usage:
```
assert_eq!(1i64.overflowing_sub_unsigned(2), (-1, false));
assert_eq!((i64::MAX).overflowing_sub_unsigned(u64::MAX), (i64::MIN, false));
assert_eq!((i64::MIN + 2).overflowing_sub_unsigned(3), (i64::MAX, true));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#226-229)1.7.0 (const: 1.32.0) · #### pub const fn overflowing\_mul(self, rhs: i64) -> (i64, bool)
Calculates the multiplication of `self` and `rhs`.
Returns a tuple of the multiplication along with a boolean indicating whether an arithmetic overflow would occur. If an overflow would have occurred then the wrapped value is returned.
##### Examples
Basic usage:
```
assert_eq!(5i64.overflowing_mul(2), (10, false));
assert_eq!(1_000_000_000i32.overflowing_mul(10), (1410065408, true));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#226-229)1.7.0 (const: 1.52.0) · #### pub const fn overflowing\_div(self, rhs: i64) -> (i64, bool)
Calculates the divisor when `self` is divided by `rhs`.
Returns a tuple of the divisor along with a boolean indicating whether an arithmetic overflow would occur. If an overflow would occur then self is returned.
##### Panics
This function will panic if `rhs` is 0.
##### Examples
Basic usage:
```
assert_eq!(5i64.overflowing_div(2), (2, false));
assert_eq!(i64::MIN.overflowing_div(-1), (i64::MIN, true));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#226-229)1.38.0 (const: 1.52.0) · #### pub const fn overflowing\_div\_euclid(self, rhs: i64) -> (i64, bool)
Calculates the quotient of Euclidean division `self.div_euclid(rhs)`.
Returns a tuple of the divisor along with a boolean indicating whether an arithmetic overflow would occur. If an overflow would occur then `self` is returned.
##### Panics
This function will panic if `rhs` is 0.
##### Examples
Basic usage:
```
assert_eq!(5i64.overflowing_div_euclid(2), (2, false));
assert_eq!(i64::MIN.overflowing_div_euclid(-1), (i64::MIN, true));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#226-229)1.7.0 (const: 1.52.0) · #### pub const fn overflowing\_rem(self, rhs: i64) -> (i64, bool)
Calculates the remainder when `self` is divided by `rhs`.
Returns a tuple of the remainder after dividing along with a boolean indicating whether an arithmetic overflow would occur. If an overflow would occur then 0 is returned.
##### Panics
This function will panic if `rhs` is 0.
##### Examples
Basic usage:
```
assert_eq!(5i64.overflowing_rem(2), (1, false));
assert_eq!(i64::MIN.overflowing_rem(-1), (0, true));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#226-229)1.38.0 (const: 1.52.0) · #### pub const fn overflowing\_rem\_euclid(self, rhs: i64) -> (i64, bool)
Overflowing Euclidean remainder. Calculates `self.rem_euclid(rhs)`.
Returns a tuple of the remainder after dividing along with a boolean indicating whether an arithmetic overflow would occur. If an overflow would occur then 0 is returned.
##### Panics
This function will panic if `rhs` is 0.
##### Examples
Basic usage:
```
assert_eq!(5i64.overflowing_rem_euclid(2), (1, false));
assert_eq!(i64::MIN.overflowing_rem_euclid(-1), (0, true));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#226-229)1.7.0 (const: 1.32.0) · #### pub const fn overflowing\_neg(self) -> (i64, bool)
Negates self, overflowing if this is equal to the minimum value.
Returns a tuple of the negated version of self along with a boolean indicating whether an overflow happened. If `self` is the minimum value (e.g., `i32::MIN` for values of type `i32`), then the minimum value will be returned again and `true` will be returned for an overflow happening.
##### Examples
Basic usage:
```
assert_eq!(2i64.overflowing_neg(), (-2, false));
assert_eq!(i64::MIN.overflowing_neg(), (i64::MIN, true));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#226-229)1.7.0 (const: 1.32.0) · #### pub const fn overflowing\_shl(self, rhs: u32) -> (i64, bool)
Shifts self left by `rhs` bits.
Returns a tuple of the shifted version of self along with a boolean indicating whether the shift value was larger than or equal to the number of bits. If the shift value is too large, then value is masked (N-1) where N is the number of bits, and this value is then used to perform the shift.
##### Examples
Basic usage:
```
assert_eq!(0x1i64.overflowing_shl(4), (0x10, false));
assert_eq!(0x1i32.overflowing_shl(36), (0x10, true));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#226-229)1.7.0 (const: 1.32.0) · #### pub const fn overflowing\_shr(self, rhs: u32) -> (i64, bool)
Shifts self right by `rhs` bits.
Returns a tuple of the shifted version of self along with a boolean indicating whether the shift value was larger than or equal to the number of bits. If the shift value is too large, then value is masked (N-1) where N is the number of bits, and this value is then used to perform the shift.
##### Examples
Basic usage:
```
assert_eq!(0x10i64.overflowing_shr(4), (0x1, false));
assert_eq!(0x10i32.overflowing_shr(36), (0x1, true));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#226-229)1.13.0 (const: 1.32.0) · #### pub const fn overflowing\_abs(self) -> (i64, bool)
Computes the absolute value of `self`.
Returns a tuple of the absolute version of self along with a boolean indicating whether an overflow happened. If self is the minimum value (e.g., i64::MIN for values of type i64), then the minimum value will be returned again and true will be returned for an overflow happening.
##### Examples
Basic usage:
```
assert_eq!(10i64.overflowing_abs(), (10, false));
assert_eq!((-10i64).overflowing_abs(), (10, false));
assert_eq!((i64::MIN).overflowing_abs(), (i64::MIN, true));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#226-229)1.34.0 (const: 1.50.0) · #### pub const fn overflowing\_pow(self, exp: u32) -> (i64, bool)
Raises self to the power of `exp`, using exponentiation by squaring.
Returns a tuple of the exponentiation along with a bool indicating whether an overflow happened.
##### Examples
Basic usage:
```
assert_eq!(3i64.overflowing_pow(4), (81, false));
assert_eq!(3i8.overflowing_pow(5), (-13, true));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#226-229)const: 1.50.0 · #### pub const fn pow(self, exp: u32) -> i64
Raises self to the power of `exp`, using exponentiation by squaring.
##### Examples
Basic usage:
```
let x: i64 = 2; // or any other integer type
assert_eq!(x.pow(5), 32);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#226-229)1.38.0 (const: 1.52.0) · #### pub const fn div\_euclid(self, rhs: i64) -> i64
Calculates the quotient of Euclidean division of `self` by `rhs`.
This computes the integer `q` such that `self = q * rhs + r`, with `r = self.rem_euclid(rhs)` and `0 <= r < abs(rhs)`.
In other words, the result is `self / rhs` rounded to the integer `q` such that `self >= q * rhs`. If `self > 0`, this is equal to round towards zero (the default in Rust); if `self < 0`, this is equal to round towards +/- infinity.
##### Panics
This function will panic if `rhs` is 0 or the division results in overflow.
##### Examples
Basic usage:
```
let a: i64 = 7; // or any other integer type
let b = 4;
assert_eq!(a.div_euclid(b), 1); // 7 >= 4 * 1
assert_eq!(a.div_euclid(-b), -1); // 7 >= -4 * -1
assert_eq!((-a).div_euclid(b), -2); // -7 >= 4 * -2
assert_eq!((-a).div_euclid(-b), 2); // -7 >= -4 * 2
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#226-229)1.38.0 (const: 1.52.0) · #### pub const fn rem\_euclid(self, rhs: i64) -> i64
Calculates the least nonnegative remainder of `self (mod rhs)`.
This is done as if by the Euclidean division algorithm – given `r = self.rem_euclid(rhs)`, `self = rhs * self.div_euclid(rhs) + r`, and `0 <= r < abs(rhs)`.
##### Panics
This function will panic if `rhs` is 0 or the division results in overflow.
##### Examples
Basic usage:
```
let a: i64 = 7; // or any other integer type
let b = 4;
assert_eq!(a.rem_euclid(b), 3);
assert_eq!((-a).rem_euclid(b), 1);
assert_eq!(a.rem_euclid(-b), 3);
assert_eq!((-a).rem_euclid(-b), 1);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#226-229)#### pub const fn div\_floor(self, rhs: i64) -> i64
🔬This is a nightly-only experimental API. (`int_roundings` [#88581](https://github.com/rust-lang/rust/issues/88581))
Calculates the quotient of `self` and `rhs`, rounding the result towards negative infinity.
##### Panics
This function will panic if `rhs` is zero.
###### [Overflow behavior](#overflow-behavior)
On overflow, this function will panic if overflow checks are enabled (default in debug mode) and wrap if overflow checks are disabled (default in release mode).
##### Examples
Basic usage:
```
#![feature(int_roundings)]
let a: i64 = 8;
let b = 3;
assert_eq!(a.div_floor(b), 2);
assert_eq!(a.div_floor(-b), -3);
assert_eq!((-a).div_floor(b), -3);
assert_eq!((-a).div_floor(-b), 2);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#226-229)#### pub const fn div\_ceil(self, rhs: i64) -> i64
🔬This is a nightly-only experimental API. (`int_roundings` [#88581](https://github.com/rust-lang/rust/issues/88581))
Calculates the quotient of `self` and `rhs`, rounding the result towards positive infinity.
##### Panics
This function will panic if `rhs` is zero.
###### [Overflow behavior](#overflow-behavior-1)
On overflow, this function will panic if overflow checks are enabled (default in debug mode) and wrap if overflow checks are disabled (default in release mode).
##### Examples
Basic usage:
```
#![feature(int_roundings)]
let a: i64 = 8;
let b = 3;
assert_eq!(a.div_ceil(b), 3);
assert_eq!(a.div_ceil(-b), -2);
assert_eq!((-a).div_ceil(b), -2);
assert_eq!((-a).div_ceil(-b), 3);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#226-229)#### pub const fn next\_multiple\_of(self, rhs: i64) -> i64
🔬This is a nightly-only experimental API. (`int_roundings` [#88581](https://github.com/rust-lang/rust/issues/88581))
If `rhs` is positive, calculates the smallest value greater than or equal to `self` that is a multiple of `rhs`. If `rhs` is negative, calculates the largest value less than or equal to `self` that is a multiple of `rhs`.
##### Panics
This function will panic if `rhs` is zero.
###### [Overflow behavior](#overflow-behavior-2)
On overflow, this function will panic if overflow checks are enabled (default in debug mode) and wrap if overflow checks are disabled (default in release mode).
##### Examples
Basic usage:
```
#![feature(int_roundings)]
assert_eq!(16_i64.next_multiple_of(8), 16);
assert_eq!(23_i64.next_multiple_of(8), 24);
assert_eq!(16_i64.next_multiple_of(-8), 16);
assert_eq!(23_i64.next_multiple_of(-8), 16);
assert_eq!((-16_i64).next_multiple_of(8), -16);
assert_eq!((-23_i64).next_multiple_of(8), -16);
assert_eq!((-16_i64).next_multiple_of(-8), -16);
assert_eq!((-23_i64).next_multiple_of(-8), -24);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#226-229)#### pub const fn checked\_next\_multiple\_of(self, rhs: i64) -> Option<i64>
🔬This is a nightly-only experimental API. (`int_roundings` [#88581](https://github.com/rust-lang/rust/issues/88581))
If `rhs` is positive, calculates the smallest value greater than or equal to `self` that is a multiple of `rhs`. If `rhs` is negative, calculates the largest value less than or equal to `self` that is a multiple of `rhs`. Returns `None` if `rhs` is zero or the operation would result in overflow.
##### Examples
Basic usage:
```
#![feature(int_roundings)]
assert_eq!(16_i64.checked_next_multiple_of(8), Some(16));
assert_eq!(23_i64.checked_next_multiple_of(8), Some(24));
assert_eq!(16_i64.checked_next_multiple_of(-8), Some(16));
assert_eq!(23_i64.checked_next_multiple_of(-8), Some(16));
assert_eq!((-16_i64).checked_next_multiple_of(8), Some(-16));
assert_eq!((-23_i64).checked_next_multiple_of(8), Some(-16));
assert_eq!((-16_i64).checked_next_multiple_of(-8), Some(-16));
assert_eq!((-23_i64).checked_next_multiple_of(-8), Some(-24));
assert_eq!(1_i64.checked_next_multiple_of(0), None);
assert_eq!(i64::MAX.checked_next_multiple_of(2), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#226-229)#### pub const fn ilog(self, base: i64) -> u32
🔬This is a nightly-only experimental API. (`int_log` [#70887](https://github.com/rust-lang/rust/issues/70887))
Returns the logarithm of the number with respect to an arbitrary base, rounded down.
This method might not be optimized owing to implementation details; `ilog2` can produce results more efficiently for base 2, and `ilog10` can produce results more efficiently for base 10.
##### Panics
When the number is negative, zero, or if the base is not at least 2; it panics in debug mode and the return value is 0 in release mode.
##### Examples
```
#![feature(int_log)]
assert_eq!(5i64.ilog(5), 1);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#226-229)#### 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.
##### Panics
When the number is negative or zero it panics in debug mode and the return value is 0 in release mode.
##### Examples
```
#![feature(int_log)]
assert_eq!(2i64.ilog2(), 1);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#226-229)#### 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.
##### Panics
When the number is negative or zero it panics in debug mode and the return value is 0 in release mode.
##### Example
```
#![feature(int_log)]
assert_eq!(10i64.ilog10(), 1);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#226-229)#### pub const fn checked\_ilog(self, base: i64) -> Option<u32>
🔬This is a nightly-only experimental API. (`int_log` [#70887](https://github.com/rust-lang/rust/issues/70887))
Returns the logarithm of the number with respect to an arbitrary base, rounded down.
Returns `None` if the number is negative or zero, or if the base is not at least 2.
This method might not be optimized owing to implementation details; `checked_ilog2` can produce results more efficiently for base 2, and `checked_ilog10` can produce results more efficiently for base 10.
##### Examples
```
#![feature(int_log)]
assert_eq!(5i64.checked_ilog(5), Some(1));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#226-229)#### pub const fn checked\_ilog2(self) -> Option<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.
Returns `None` if the number is negative or zero.
##### Examples
```
#![feature(int_log)]
assert_eq!(2i64.checked_ilog2(), Some(1));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#226-229)#### pub const fn checked\_ilog10(self) -> Option<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.
Returns `None` if the number is negative or zero.
##### Example
```
#![feature(int_log)]
assert_eq!(10i64.checked_ilog10(), Some(1));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#226-229)const: 1.32.0 · #### pub const fn abs(self) -> i64
Computes the absolute value of `self`.
##### Overflow behavior
The absolute value of `i64::MIN` cannot be represented as an `i64`, and attempting to calculate it will cause an overflow. This means that code in debug mode will trigger a panic on this case and optimized code will return `i64::MIN` without a panic.
##### Examples
Basic usage:
```
assert_eq!(10i64.abs(), 10);
assert_eq!((-10i64).abs(), 10);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#226-229)1.60.0 (const: 1.60.0) · #### pub const fn abs\_diff(self, other: i64) -> u64
Computes the absolute difference between `self` and `other`.
This function always returns the correct answer without overflow or panics by returning an unsigned integer.
##### Examples
Basic usage:
```
assert_eq!(100i64.abs_diff(80), 20u64);
assert_eq!(100i64.abs_diff(110), 10u64);
assert_eq!((-100i64).abs_diff(80), 180u64);
assert_eq!((-100i64).abs_diff(-120), 20u64);
assert_eq!(i64::MIN.abs_diff(i64::MAX), u64::MAX);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#226-229)const: 1.47.0 · #### pub const fn signum(self) -> i64
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:
```
assert_eq!(10i64.signum(), 1);
assert_eq!(0i64.signum(), 0);
assert_eq!((-10i64).signum(), -1);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#226-229)const: 1.32.0 · #### pub const fn is\_positive(self) -> bool
Returns `true` if `self` is positive and `false` if the number is zero or negative.
##### Examples
Basic usage:
```
assert!(10i64.is_positive());
assert!(!(-10i64).is_positive());
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#226-229)const: 1.32.0 · #### pub const fn is\_negative(self) -> bool
Returns `true` if `self` is negative and `false` if the number is zero or positive.
##### Examples
Basic usage:
```
assert!((-10i64).is_negative());
assert!(!10i64.is_negative());
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#226-229)1.32.0 (const: 1.44.0) · #### pub const fn to\_be\_bytes(self) -> [u8; 8]
Return the memory representation of this integer as a byte array in big-endian (network) byte order.
##### Examples
```
let bytes = 0x1234567890123456i64.to_be_bytes();
assert_eq!(bytes, [0x12, 0x34, 0x56, 0x78, 0x90, 0x12, 0x34, 0x56]);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#226-229)1.32.0 (const: 1.44.0) · #### pub const fn to\_le\_bytes(self) -> [u8; 8]
Return the memory representation of this integer as a byte array in little-endian byte order.
##### Examples
```
let bytes = 0x1234567890123456i64.to_le_bytes();
assert_eq!(bytes, [0x56, 0x34, 0x12, 0x90, 0x78, 0x56, 0x34, 0x12]);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#226-229)1.32.0 (const: 1.44.0) · #### pub const fn to\_ne\_bytes(self) -> [u8; 8]
Return the memory representation of this integer as a byte array in native byte order.
As the target platform’s native endianness is used, portable code should use [`to_be_bytes`](primitive.i64#method.to_be_bytes) or [`to_le_bytes`](primitive.i64#method.to_le_bytes), as appropriate, instead.
##### Examples
```
let bytes = 0x1234567890123456i64.to_ne_bytes();
assert_eq!(
bytes,
if cfg!(target_endian = "big") {
[0x12, 0x34, 0x56, 0x78, 0x90, 0x12, 0x34, 0x56]
} else {
[0x56, 0x34, 0x12, 0x90, 0x78, 0x56, 0x34, 0x12]
}
);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#226-229)1.32.0 (const: 1.44.0) · #### pub const fn from\_be\_bytes(bytes: [u8; 8]) -> i64
Create an integer value from its representation as a byte array in big endian.
##### Examples
```
let value = i64::from_be_bytes([0x12, 0x34, 0x56, 0x78, 0x90, 0x12, 0x34, 0x56]);
assert_eq!(value, 0x1234567890123456);
```
When starting from a slice rather than an array, fallible conversion APIs can be used:
```
fn read_be_i64(input: &mut &[u8]) -> i64 {
let (int_bytes, rest) = input.split_at(std::mem::size_of::<i64>());
*input = rest;
i64::from_be_bytes(int_bytes.try_into().unwrap())
}
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#226-229)1.32.0 (const: 1.44.0) · #### pub const fn from\_le\_bytes(bytes: [u8; 8]) -> i64
Create an integer value from its representation as a byte array in little endian.
##### Examples
```
let value = i64::from_le_bytes([0x56, 0x34, 0x12, 0x90, 0x78, 0x56, 0x34, 0x12]);
assert_eq!(value, 0x1234567890123456);
```
When starting from a slice rather than an array, fallible conversion APIs can be used:
```
fn read_le_i64(input: &mut &[u8]) -> i64 {
let (int_bytes, rest) = input.split_at(std::mem::size_of::<i64>());
*input = rest;
i64::from_le_bytes(int_bytes.try_into().unwrap())
}
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#226-229)1.32.0 (const: 1.44.0) · #### pub const fn from\_ne\_bytes(bytes: [u8; 8]) -> i64
Create an integer value from its memory representation as a byte array in native endianness.
As the target platform’s native endianness is used, portable code likely wants to use [`from_be_bytes`](primitive.i64#method.from_be_bytes) or [`from_le_bytes`](primitive.i64#method.from_le_bytes), as appropriate instead.
##### Examples
```
let value = i64::from_ne_bytes(if cfg!(target_endian = "big") {
[0x12, 0x34, 0x56, 0x78, 0x90, 0x12, 0x34, 0x56]
} else {
[0x56, 0x34, 0x12, 0x90, 0x78, 0x56, 0x34, 0x12]
});
assert_eq!(value, 0x1234567890123456);
```
When starting from a slice rather than an array, fallible conversion APIs can be used:
```
fn read_ne_i64(input: &mut &[u8]) -> i64 {
let (int_bytes, rest) = input.split_at(std::mem::size_of::<i64>());
*input = rest;
i64::from_ne_bytes(int_bytes.try_into().unwrap())
}
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#226-229)const: 1.32.0 · #### pub const fn min\_value() -> i64
👎Deprecating in a future Rust version: replaced by the `MIN` associated constant on this type
New code should prefer to use [`i64::MIN`](primitive.i64#associatedconstant.MIN "i64::MIN") instead.
Returns the smallest value that can be represented by this integer type.
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#226-229)const: 1.32.0 · #### pub const fn max\_value() -> i64
👎Deprecating in a future Rust version: replaced by the `MAX` associated constant on this type
New code should prefer to use [`i64::MAX`](primitive.i64#associatedconstant.MAX "i64::MAX") instead.
Returns the largest value that can be represented by this integer type.
Trait Implementations
---------------------
[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
The resulting type after applying the `+` operator.
[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") · #### fn add(self, other: &i64) -> <i64 as Add<i64>>::Output
Performs the `+` operation. [Read more](ops/trait.add#tymethod.add)
[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
The resulting type after applying the `+` operator.
[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") · #### fn add(self, other: &i64) -> <i64 as Add<i64>>::Output
Performs the `+` operation. [Read more](ops/trait.add#tymethod.add)
[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
The resulting type after applying the `+` operator.
[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") · #### fn add(self, other: i64) -> <i64 as Add<i64>>::Output
Performs the `+` operation. [Read more](ops/trait.add#tymethod.add)
[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
The resulting type after applying the `+` operator.
[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") · #### fn add(self, other: i64) -> i64
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<&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/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/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/ops/arith.rs.html#786)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/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/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/ops/arith.rs.html#786)1.8.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/ops/arith.rs.html#786)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/fmt/num.rs.html#178)### impl Binary for i64
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#178)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error>
Formats the value using the given formatter.
[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
The resulting type after applying the `&` operator.
[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") · #### fn bitand(self, other: &i64) -> <i64 as BitAnd<i64>>::Output
Performs the `&` operation. [Read more](ops/trait.bitand#tymethod.bitand)
[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
The resulting type after applying the `&` operator.
[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") · #### fn bitand(self, other: &i64) -> <i64 as BitAnd<i64>>::Output
Performs the `&` operation. [Read more](ops/trait.bitand#tymethod.bitand)
[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
The resulting type after applying the `&` operator.
[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") · #### fn bitand(self, other: i64) -> <i64 as BitAnd<i64>>::Output
Performs the `&` operation. [Read more](ops/trait.bitand#tymethod.bitand)
[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
The resulting type after applying the `&` operator.
[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") · #### fn bitand(self, rhs: i64) -> i64
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<&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/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/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/ops/bit.rs.html#734)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/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/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/ops/bit.rs.html#734)1.8.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/ops/bit.rs.html#734)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/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
The resulting type after applying the `|` operator.
[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") · #### fn bitor(self, other: &i64) -> <i64 as BitOr<i64>>::Output
Performs the `|` operation. [Read more](ops/trait.bitor#tymethod.bitor)
[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
The resulting type after applying the `|` operator.
[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") · #### fn bitor(self, other: &i64) -> <i64 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 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/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
The resulting type after applying the `|` operator.
[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") · #### fn bitor(self, other: i64) -> <i64 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 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/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
The resulting type after applying the `|` operator.
[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") · #### fn bitor(self, rhs: i64) -> i64
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<&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/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/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/ops/bit.rs.html#806)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/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/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/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/ops/bit.rs.html#806)1.8.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/ops/bit.rs.html#806)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/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
The resulting type after applying the `^` operator.
[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") · #### fn bitxor(self, other: &i64) -> <i64 as BitXor<i64>>::Output
Performs the `^` operation. [Read more](ops/trait.bitxor#tymethod.bitxor)
[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
The resulting type after applying the `^` operator.
[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") · #### fn bitxor(self, other: &i64) -> <i64 as BitXor<i64>>::Output
Performs the `^` operation. [Read more](ops/trait.bitxor#tymethod.bitxor)
[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
The resulting type after applying the `^` operator.
[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") · #### fn bitxor(self, other: i64) -> <i64 as BitXor<i64>>::Output
Performs the `^` operation. [Read more](ops/trait.bitxor#tymethod.bitxor)
[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
The resulting type after applying the `^` operator.
[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") · #### fn bitxor(self, other: i64) -> i64
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<&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/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/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/ops/bit.rs.html#878)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/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/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/ops/bit.rs.html#878)1.8.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/ops/bit.rs.html#878)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/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") · #### fn clone(&self) -> i64
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/num.rs.html#197-200)### impl Debug for i64
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#197-200)#### 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/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#218)const: [unstable](https://github.com/rust-lang/rust/issues/87864 "Tracking issue for const_default_impls") · #### fn default() -> i64
Returns the default value of `0`
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#461-464)### impl Display for i64
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#461-464)#### 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/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
The resulting type after applying the `/` operator.
[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") · #### fn div(self, other: &i64) -> <i64 as Div<i64>>::Output
Performs the `/` operation. [Read more](ops/trait.div#tymethod.div)
[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
The resulting type after applying the `/` operator.
[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") · #### fn div(self, other: &i64) -> <i64 as Div<i64>>::Output
Performs the `/` operation. [Read more](ops/trait.div#tymethod.div)
[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
The resulting type after applying the `/` operator.
[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") · #### fn div(self, other: i64) -> <i64 as Div<i64>>::Output
Performs the `/` operation. [Read more](ops/trait.div#tymethod.div)
[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
The resulting type after applying the `/` operator.
[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") · #### fn div(self, other: i64) -> i64
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<&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/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/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/ops/arith.rs.html#968)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/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/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/ops/arith.rs.html#968)1.8.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/ops/arith.rs.html#968)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/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#95)1.28.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<bool> for i64
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#95)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: bool) -> i64
Converts a `bool` to a `i64`. The resulting value is `0` for `false` and `1` for `true` values.
##### Examples
```
assert_eq!(i64::from(true), 1);
assert_eq!(i64::from(false), 0);
```
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#119)1.5.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<i16> for i64
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#119)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: i16) -> i64
Converts `i16` to `i64` losslessly.
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#121)1.5.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<i32> for i64
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#121)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: i32) -> i64
Converts `i32` to `i64` losslessly.
[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/87852 "Tracking issue for const_num_from_num")) · ### impl From<i64> for AtomicI64
[source](https://doc.rust-lang.org/src/core/sync/atomic.rs.html#2795-2813)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(v: i64) -> AtomicI64
Converts an `i64` into an `AtomicI64`.
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#123)1.26.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<i64> for i128
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#123)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: i64) -> i128
Converts `i64` to `i128` losslessly.
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#115)1.5.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<i8> for i64
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#115)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: i8) -> i64
Converts `i8` to `i64` losslessly.
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#131)1.5.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<u16> for i64
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#131)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: u16) -> i64
Converts `u16` to `i64` losslessly.
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#133)1.5.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<u32> for i64
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#133)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: u32) -> i64
Converts `u32` to `i64` losslessly.
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#128)1.5.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<u8> for i64
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#128)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: u8) -> i64
Converts `u8` to `i64` losslessly.
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#1018)### impl FromStr for i64
#### type Err = ParseIntError
The associated error which can be returned from parsing.
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#1018)#### fn from\_str(src: &str) -> Result<i64, ParseIntError>
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/hash/mod.rs.html#829-842)### impl Hash for i64
[source](https://doc.rust-lang.org/src/core/hash/mod.rs.html#829-842)#### 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#829-842)#### fn hash\_slice<H>(data: &[i64], 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/fmt/num.rs.html#465-468)1.42.0 · ### impl LowerExp for i64
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#465-468)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error>
Formats the value using the given formatter.
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#178)### impl LowerHex for i64
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#178)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error>
Formats the value using the given formatter.
[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
The resulting type after applying the `*` operator.
[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") · #### fn mul(self, other: &i64) -> <i64 as Mul<i64>>::Output
Performs the `*` operation. [Read more](ops/trait.mul#tymethod.mul)
[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
The resulting type after applying the `*` operator.
[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") · #### fn mul(self, other: &i64) -> <i64 as Mul<i64>>::Output
Performs the `*` operation. [Read more](ops/trait.mul#tymethod.mul)
[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
The resulting type after applying the `*` operator.
[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") · #### fn mul(self, other: i64) -> <i64 as Mul<i64>>::Output
Performs the `*` operation. [Read more](ops/trait.mul#tymethod.mul)
[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
The resulting type after applying the `*` operator.
[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") · #### fn mul(self, other: i64) -> i64
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<&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/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/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/ops/arith.rs.html#911)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/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/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/ops/arith.rs.html#911)1.8.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/ops/arith.rs.html#911)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/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
The resulting type after applying the `-` operator.
[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") · #### fn neg(self) -> <i64 as Neg>::Output
Performs the unary `-` operation. [Read more](ops/trait.neg#tymethod.neg)
[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
The resulting type after applying the `-` operator.
[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") · #### fn neg(self) -> i64
Performs the unary `-` operation. [Read more](ops/trait.neg#tymethod.neg)
[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
The resulting type after applying the `!` operator.
[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") · #### fn not(self) -> <i64 as Not>::Output
Performs the unary `!` operation. [Read more](ops/trait.not#tymethod.not)
[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
The resulting type after applying the `!` operator.
[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") · #### fn not(self) -> i64
Performs the unary `!` operation. [Read more](ops/trait.not#tymethod.not)
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#178)### impl Octal for i64
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#178)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error>
Formats the value using the given formatter.
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1486)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · ### impl Ord for i64
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1486)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · #### fn cmp(&self, other: &i64) -> 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/cmp.rs.html#1366-1368)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · ### impl PartialEq<i64> for i64
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1366-1368)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · #### fn eq(&self, other: &i64) -> 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#1366-1368)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · #### fn ne(&self, other: &i64) -> 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/cmp.rs.html#1486)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · ### impl PartialOrd<i64> for i64
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1486)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · #### fn partial\_cmp(&self, other: &i64) -> 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#1486)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · #### fn lt(&self, other: &i64) -> 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#1486)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · #### fn le(&self, other: &i64) -> 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#1486)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · #### fn ge(&self, other: &i64) -> 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/cmp.rs.html#1486)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · #### fn gt(&self, other: &i64) -> 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/iter/traits/accum.rs.html#141)1.12.0 · ### impl<'a> Product<&'a i64> for i64
[source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)#### fn product<I>(iter: I) -> i64where I: [Iterator](iter/trait.iterator "trait std::iter::Iterator")<Item = &'a [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.12.0 · ### impl Product<i64> for i64
[source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)#### fn product<I>(iter: I) -> i64where I: [Iterator](iter/trait.iterator "trait std::iter::Iterator")<Item = [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/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
The resulting type after applying the `%` operator.
[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") · #### fn rem(self, other: &i64) -> <i64 as Rem<i64>>::Output
Performs the `%` operation. [Read more](ops/trait.rem#tymethod.rem)
[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
The resulting type after applying the `%` operator.
[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") · #### fn rem(self, other: &i64) -> <i64 as Rem<i64>>::Output
Performs the `%` operation. [Read more](ops/trait.rem#tymethod.rem)
[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
The resulting type after applying the `%` operator.
[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") · #### fn rem(self, other: i64) -> <i64 as Rem<i64>>::Output
Performs the `%` operation. [Read more](ops/trait.rem#tymethod.rem)
[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
The resulting type after applying the `%` operator.
[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") · #### fn rem(self, other: i64) -> i64
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<&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/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/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/ops/arith.rs.html#1029)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/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/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/ops/arith.rs.html#1029)1.8.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/ops/arith.rs.html#1029)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/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i128) -> <i64 as Shl<i128>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i128) -> <i64 as Shl<i128>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i16) -> <i64 as Shl<i16>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i16) -> <i64 as Shl<i16>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i32) -> <i64 as Shl<i32>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i32) -> <i64 as Shl<i32>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i64) -> <i128 as Shl<i64>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i64) -> <i16 as Shl<i64>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i64) -> <i32 as Shl<i64>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i64) -> <i64 as Shl<i64>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i64) -> <i8 as Shl<i64>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i64) -> <isize as Shl<i64>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i64) -> <u128 as Shl<i64>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i64) -> <u16 as Shl<i64>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i64) -> <u32 as Shl<i64>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i64) -> <u64 as Shl<i64>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i64) -> <u8 as Shl<i64>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i64) -> <usize as Shl<i64>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i64) -> <i128 as Shl<i64>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i64) -> <i16 as Shl<i64>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i64) -> <i32 as Shl<i64>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i64) -> <i64 as Shl<i64>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i64) -> <i8 as Shl<i64>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i64) -> <isize as Shl<i64>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i64) -> <u128 as Shl<i64>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i64) -> <u16 as Shl<i64>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i64) -> <u32 as Shl<i64>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i64) -> <u64 as Shl<i64>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i64) -> <u8 as Shl<i64>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i64) -> <usize as Shl<i64>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i8) -> <i64 as Shl<i8>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i8) -> <i64 as Shl<i8>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &isize) -> <i64 as Shl<isize>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &isize) -> <i64 as Shl<isize>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u128) -> <i64 as Shl<u128>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u128) -> <i64 as Shl<u128>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u16) -> <i64 as Shl<u16>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u16) -> <i64 as Shl<u16>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u32) -> <i64 as Shl<u32>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u32) -> <i64 as Shl<u32>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u64) -> <i64 as Shl<u64>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u64) -> <i64 as Shl<u64>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u8) -> <i64 as Shl<u8>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u8) -> <i64 as Shl<u8>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &usize) -> <i64 as Shl<usize>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &usize) -> <i64 as Shl<usize>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i128) -> <i64 as Shl<i128>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i128) -> i64
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i16) -> <i64 as Shl<i16>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i16) -> i64
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i32) -> <i64 as Shl<i32>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i32) -> i64
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i64) -> <i128 as Shl<i64>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i64) -> <i16 as Shl<i64>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i64) -> <i32 as Shl<i64>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i64) -> <i64 as Shl<i64>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i64) -> <i8 as Shl<i64>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i64) -> <isize as Shl<i64>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i64) -> <u128 as Shl<i64>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i64) -> <u16 as Shl<i64>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i64) -> <u32 as Shl<i64>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i64) -> <u64 as Shl<i64>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i64) -> <u8 as Shl<i64>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i64) -> <usize as Shl<i64>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i64) -> i128
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i64) -> i16
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i64) -> i32
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i64) -> i64
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i64) -> i8
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i64) -> isize
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i64) -> u128
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i64) -> u16
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i64) -> u32
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i64) -> u64
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i64) -> u8
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i64) -> usize
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i8) -> <i64 as Shl<i8>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i8) -> i64
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: isize) -> <i64 as Shl<isize>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: isize) -> i64
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u128) -> <i64 as Shl<u128>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u128) -> i64
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u16) -> <i64 as Shl<u16>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u16) -> i64
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u32) -> <i64 as Shl<u32>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u32) -> i64
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u64) -> <i64 as Shl<u64>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u64) -> i64
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u8) -> <i64 as Shl<u8>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u8) -> i64
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: usize) -> <i64 as Shl<usize>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: usize) -> i64
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &i128)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &i16)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &i32)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &i64)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &i64)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &i64)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &i64)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &i64)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &i64)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &i64)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &i64)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &i64)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &i64)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &i64)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &i64)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &i8)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &isize)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &u128)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &u16)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &u32)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &u64)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &u8)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)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/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: i128)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: i16)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: i32)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: i64)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: i64)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: i64)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: i64)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: i64)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: i64)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: i64)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: i64)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: i64)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: i64)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: i64)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: i64)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: i8)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: isize)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: u128)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: u16)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: u32)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: u64)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: u8)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)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/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i128) -> <i64 as Shr<i128>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i128) -> <i64 as Shr<i128>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i16) -> <i64 as Shr<i16>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i16) -> <i64 as Shr<i16>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i32) -> <i64 as Shr<i32>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i32) -> <i64 as Shr<i32>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i64) -> <i128 as Shr<i64>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i64) -> <i16 as Shr<i64>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i64) -> <i32 as Shr<i64>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i64) -> <i64 as Shr<i64>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i64) -> <i8 as Shr<i64>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i64) -> <isize as Shr<i64>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i64) -> <u128 as Shr<i64>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i64) -> <u16 as Shr<i64>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i64) -> <u32 as Shr<i64>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i64) -> <u64 as Shr<i64>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i64) -> <u8 as Shr<i64>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i64) -> <usize as Shr<i64>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i64) -> <i128 as Shr<i64>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i64) -> <i16 as Shr<i64>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i64) -> <i32 as Shr<i64>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i64) -> <i64 as Shr<i64>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i64) -> <i8 as Shr<i64>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i64) -> <isize as Shr<i64>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i64) -> <u128 as Shr<i64>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i64) -> <u16 as Shr<i64>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i64) -> <u32 as Shr<i64>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i64) -> <u64 as Shr<i64>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i64) -> <u8 as Shr<i64>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i64) -> <usize as Shr<i64>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i8) -> <i64 as Shr<i8>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i8) -> <i64 as Shr<i8>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &isize) -> <i64 as Shr<isize>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &isize) -> <i64 as Shr<isize>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u128) -> <i64 as Shr<u128>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u128) -> <i64 as Shr<u128>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u16) -> <i64 as Shr<u16>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u16) -> <i64 as Shr<u16>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u32) -> <i64 as Shr<u32>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u32) -> <i64 as Shr<u32>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u64) -> <i64 as Shr<u64>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u64) -> <i64 as Shr<u64>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u8) -> <i64 as Shr<u8>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u8) -> <i64 as Shr<u8>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &usize) -> <i64 as Shr<usize>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &usize) -> <i64 as Shr<usize>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i128) -> <i64 as Shr<i128>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i128) -> i64
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i16) -> <i64 as Shr<i16>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i16) -> i64
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i32) -> <i64 as Shr<i32>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i32) -> i64
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i64) -> <i128 as Shr<i64>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i64) -> <i16 as Shr<i64>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i64) -> <i32 as Shr<i64>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i64) -> <i64 as Shr<i64>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i64) -> <i8 as Shr<i64>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i64) -> <isize as Shr<i64>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i64) -> <u128 as Shr<i64>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i64) -> <u16 as Shr<i64>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i64) -> <u32 as Shr<i64>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i64) -> <u64 as Shr<i64>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i64) -> <u8 as Shr<i64>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i64) -> <usize as Shr<i64>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i64) -> i128
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i64) -> i16
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i64) -> i32
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i64) -> i64
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i64) -> i8
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i64) -> isize
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i64) -> u128
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i64) -> u16
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i64) -> u32
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i64) -> u64
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i64) -> u8
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i64) -> usize
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i8) -> <i64 as Shr<i8>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i8) -> i64
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: isize) -> <i64 as Shr<isize>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: isize) -> i64
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u128) -> <i64 as Shr<u128>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u128) -> i64
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u16) -> <i64 as Shr<u16>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u16) -> i64
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u32) -> <i64 as Shr<u32>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u32) -> i64
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u64) -> <i64 as Shr<u64>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u64) -> i64
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u8) -> <i64 as Shr<u8>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u8) -> i64
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: usize) -> <i64 as Shr<usize>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: usize) -> i64
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &i128)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &i16)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &i32)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &i64)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &i64)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &i64)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &i64)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &i64)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &i64)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &i64)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &i64)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &i64)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &i64)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &i64)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &i64)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &i8)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &isize)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &u128)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &u16)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &u32)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &u64)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &u8)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)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/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: i128)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: i16)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: i32)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: i64)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: i64)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: i64)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: i64)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: i64)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: i64)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: i64)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: i64)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: i64)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: i64)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: i64)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: i64)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: i8)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: isize)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: u128)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: u16)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: u32)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: u64)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: u8)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)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/up/up/portable-simd/crates/core_simd/src/vector.rs.html#719)### impl SimdElement for i64
#### type Mask = i64
🔬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.
[source](https://doc.rust-lang.org/src/core/iter/range.rs.html#391-394)### impl Step for i64
[source](https://doc.rust-lang.org/src/core/iter/range.rs.html#391-394)#### unsafe fn forward\_unchecked(start: i64, n: usize) -> i64
🔬This is a nightly-only experimental API. (`step_trait` [#42168](https://github.com/rust-lang/rust/issues/42168))
Returns the value that would be obtained by taking the *successor* of `self` `count` times. [Read more](iter/trait.step#method.forward_unchecked)
[source](https://doc.rust-lang.org/src/core/iter/range.rs.html#391-394)#### unsafe fn backward\_unchecked(start: i64, n: usize) -> i64
🔬This is a nightly-only experimental API. (`step_trait` [#42168](https://github.com/rust-lang/rust/issues/42168))
Returns the value that would be obtained by taking the *predecessor* of `self` `count` times. [Read more](iter/trait.step#method.backward_unchecked)
[source](https://doc.rust-lang.org/src/core/iter/range.rs.html#391-394)#### fn forward(start: i64, n: usize) -> i64
🔬This is a nightly-only experimental API. (`step_trait` [#42168](https://github.com/rust-lang/rust/issues/42168))
Returns the value that would be obtained by taking the *successor* of `self` `count` times. [Read more](iter/trait.step#method.forward)
[source](https://doc.rust-lang.org/src/core/iter/range.rs.html#391-394)#### fn backward(start: i64, n: usize) -> i64
🔬This is a nightly-only experimental API. (`step_trait` [#42168](https://github.com/rust-lang/rust/issues/42168))
Returns the value that would be obtained by taking the *predecessor* of `self` `count` times. [Read more](iter/trait.step#method.backward)
[source](https://doc.rust-lang.org/src/core/iter/range.rs.html#391-394)#### fn steps\_between(start: &i64, end: &i64) -> Option<usize>
🔬This is a nightly-only experimental API. (`step_trait` [#42168](https://github.com/rust-lang/rust/issues/42168))
Returns the number of *successor* steps required to get from `start` to `end`. [Read more](iter/trait.step#tymethod.steps_between)
[source](https://doc.rust-lang.org/src/core/iter/range.rs.html#391-394)#### fn forward\_checked(start: i64, n: usize) -> Option<i64>
🔬This is a nightly-only experimental API. (`step_trait` [#42168](https://github.com/rust-lang/rust/issues/42168))
Returns the value that would be obtained by taking the *successor* of `self` `count` times. [Read more](iter/trait.step#tymethod.forward_checked)
[source](https://doc.rust-lang.org/src/core/iter/range.rs.html#391-394)#### fn backward\_checked(start: i64, n: usize) -> Option<i64>
🔬This is a nightly-only experimental API. (`step_trait` [#42168](https://github.com/rust-lang/rust/issues/42168))
Returns the value that would be obtained by taking the *predecessor* of `self` `count` times. [Read more](iter/trait.step#tymethod.backward_checked)
[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
The resulting type after applying the `-` operator.
[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") · #### fn sub(self, other: &i64) -> <i64 as Sub<i64>>::Output
Performs the `-` operation. [Read more](ops/trait.sub#tymethod.sub)
[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
The resulting type after applying the `-` operator.
[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") · #### fn sub(self, other: &i64) -> <i64 as Sub<i64>>::Output
Performs the `-` operation. [Read more](ops/trait.sub#tymethod.sub)
[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
The resulting type after applying the `-` operator.
[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") · #### fn sub(self, other: i64) -> <i64 as Sub<i64>>::Output
Performs the `-` operation. [Read more](ops/trait.sub#tymethod.sub)
[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
The resulting type after applying the `-` operator.
[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") · #### fn sub(self, other: i64) -> i64
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<&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/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/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/ops/arith.rs.html#853)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/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/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/ops/arith.rs.html#853)1.8.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/ops/arith.rs.html#853)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/iter/traits/accum.rs.html#141)1.12.0 · ### impl<'a> Sum<&'a i64> for i64
[source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)#### fn sum<I>(iter: I) -> i64where I: [Iterator](iter/trait.iterator "trait std::iter::Iterator")<Item = &'a [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.12.0 · ### impl Sum<i64> for i64
[source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)#### fn sum<I>(iter: I) -> i64where I: [Iterator](iter/trait.iterator "trait std::iter::Iterator")<Item = [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/convert/num.rs.html#276)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<i128> for i64
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#276)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: i128) -> Result<i64, <i64 as TryFrom<i128>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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/convert/num.rs.html#275)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<i64> for i16
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#275)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: i64) -> Result<i16, <i16 as TryFrom<i64>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#275)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<i64> for i32
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#275)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: i64) -> Result<i32, <i32 as TryFrom<i64>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#275)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<i64> for i8
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#275)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: i64) -> Result<i8, <i8 as TryFrom<i64>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#371)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<i64> for isize
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#371)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(value: i64) -> Result<isize, <isize as TryFrom<i64>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#289)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<i64> for u128
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#289)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: i64) -> Result<u128, <u128 as TryFrom<i64>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#293)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<i64> for u16
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#293)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: i64) -> Result<u16, <u16 as TryFrom<i64>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#293)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<i64> for u32
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#293)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: i64) -> Result<u32, <u32 as TryFrom<i64>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#289)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<i64> for u64
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#289)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: i64) -> Result<u64, <u64 as TryFrom<i64>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#293)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<i64> for u8
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#293)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: i64) -> Result<u8, <u8 as TryFrom<i64>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#366)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<i64> for usize
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#366)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: i64) -> Result<usize, <usize as TryFrom<i64>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#362)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<isize> for i64
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#362)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(value: isize) -> Result<i64, <i64 as TryFrom<isize>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#283)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<u128> for i64
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#283)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: u128) -> Result<i64, <i64 as TryFrom<u128>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#282)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<u64> for i64
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#282)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: u64) -> Result<i64, <i64 as TryFrom<u64>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#356)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<usize> for i64
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#356)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: usize) -> Result<i64, <i64 as TryFrom<usize>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### type Error = TryFromIntError
The type returned in the event of a conversion error.
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#465-468)1.42.0 · ### impl UpperExp for i64
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#465-468)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error>
Formats the value using the given formatter.
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#178)### impl UpperHex for i64
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#178)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error>
Formats the value using the given formatter.
[source](https://doc.rust-lang.org/src/core/marker.rs.html#830-835)### impl Copy for i64
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1377)### impl Eq for i64
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#38)### impl FloatToInt<i64> for f32
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#39)### impl FloatToInt<i64> for f64
[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/iter/range.rs.html#17)### impl TrustedStep for i64
Auto Trait Implementations
--------------------------
### impl RefUnwindSafe for i64
### impl Send for i64
### impl Sync for i64
### impl Unpin for i64
### impl UnwindSafe for i64
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 Keyword false Keyword false
=============
A value of type [`bool`](primitive.bool "bool") representing logical **false**.
`false` is the logical opposite of [`true`](keyword.true).
See the documentation for [`true`](keyword.true) for more information.
rust Keyword let Keyword let
===========
Bind a value to a variable.
The primary use for the `let` keyword is in `let` statements, which are used to introduce a new set of variables into the current scope, as given by a pattern.
```
let thing1: i32 = 100;
let thing2 = 200 + thing1;
let mut changing_thing = true;
changing_thing = false;
let (part1, part2) = ("first", "second");
struct Example {
a: bool,
b: u64,
}
let Example { a, b: _ } = Example {
a: true,
b: 10004,
};
assert!(a);
```
The pattern is most commonly a single variable, which means no pattern matching is done and the expression given is bound to the variable. Apart from that, patterns used in `let` bindings can be as complicated as needed, given that the pattern is exhaustive. See the [Rust book](../book/ch06-02-match) for more information on pattern matching. The type of the pattern is optionally given afterwards, but if left blank is automatically inferred by the compiler if possible.
Variables in Rust are immutable by default, and require the `mut` keyword to be made mutable.
Multiple variables can be defined with the same name, known as shadowing. This doesn’t affect the original variable in any way beyond being unable to directly access it beyond the point of shadowing. It continues to remain in scope, getting dropped only when it falls out of scope. Shadowed variables don’t need to have the same type as the variables shadowing them.
```
let shadowing_example = true;
let shadowing_example = 123.4;
let shadowing_example = shadowing_example as u32;
let mut shadowing_example = format!("cool! {shadowing_example}");
shadowing_example += " something else!"; // not shadowing
```
Other places the `let` keyword is used include along with [`if`](keyword.if), in the form of `if let` expressions. They’re useful if the pattern being matched isn’t exhaustive, such as with enumerations. `while let` also exists, which runs a loop with a pattern matched value until that pattern can’t be matched.
For more information on the `let` keyword, see the [Rust book](../book/ch18-01-all-the-places-for-patterns#let-statements) or the [Reference](../reference/statements#let-statements)
rust Macro std::include_bytes Macro std::include\_bytes
=========================
```
macro_rules! include_bytes {
($file:expr $(,)?) => { ... };
}
```
Includes a file as a reference to a byte array.
The file is located relative to the current file (similarly to how modules are found). The provided path is interpreted in a platform-specific way at compile time. So, for instance, an invocation with a Windows path containing backslashes `\` would not compile correctly on Unix.
This macro will yield an expression of type `&'static [u8; N]` which is the contents of the file.
Examples
--------
Assume there are two files in the same directory with the following contents:
File ‘spanish.in’:
```
adiós
```
File ‘main.rs’:
ⓘ
```
fn main() {
let bytes = include_bytes!("spanish.in");
assert_eq!(bytes, b"adi\xc3\xb3s\n");
print!("{}", String::from_utf8_lossy(bytes));
}
```
Compiling ‘main.rs’ and running the resulting binary will print “adiós”.
rust Macro std::format Macro std::format
=================
```
macro_rules! format {
($($arg:tt)*) => { ... };
}
```
Creates a `String` using interpolation of runtime expressions.
The first argument `format!` receives is a format string. This must be a string literal. The power of the formatting string is in the `{}`s contained.
Additional parameters passed to `format!` replace the `{}`s within the formatting string in the order given unless named or positional parameters are used; see [`std::fmt`](fmt/index) for more information.
A common use for `format!` is concatenation and interpolation of strings. The same convention is used with [`print!`](macro.print) and [`write!`](macro.write) macros, depending on the intended destination of the string.
To convert a single value to a string, use the [`to_string`](string/trait.tostring) method. This will use the [`Display`](fmt/trait.display) formatting trait.
Panics
------
`format!` panics if a formatting trait implementation returns an error. This indicates an incorrect implementation since `fmt::Write for String` never returns an error itself.
Examples
--------
```
format!("test");
format!("hello {}", "world!");
format!("x = {}, y = {y}", 10, y = 30);
let (x, y) = (1, 2);
format!("{x} + {y} = 3");
```
rust Keyword union Keyword union
=============
The [Rust equivalent of a C-style union](../reference/items/unions).
A `union` looks like a [`struct`](keyword.struct) in terms of declaration, but all of its fields exist in the same memory, superimposed over one another. For instance, if we wanted some bits in memory that we sometimes interpret as a `u32` and sometimes as an `f32`, we could write:
```
union IntOrFloat {
i: u32,
f: f32,
}
let mut u = IntOrFloat { f: 1.0 };
// Reading the fields of a union is always unsafe
assert_eq!(unsafe { u.i }, 1065353216);
// Updating through any of the field will modify all of them
u.i = 1073741824;
assert_eq!(unsafe { u.f }, 2.0);
```
Matching on unions
------------------
It is possible to use pattern matching on `union`s. A single field name must be used and it must match the name of one of the `union`’s field. Like reading from a `union`, pattern matching on a `union` requires `unsafe`.
```
union IntOrFloat {
i: u32,
f: f32,
}
let u = IntOrFloat { f: 1.0 };
unsafe {
match u {
IntOrFloat { i: 10 } => println!("Found exactly ten!"),
// Matching the field `f` provides an `f32`.
IntOrFloat { f } => println!("Found f = {f} !"),
}
}
```
References to union fields
--------------------------
All fields in a `union` are all at the same place in memory which means borrowing one borrows the entire `union`, for the same lifetime:
ⓘ
```
union IntOrFloat {
i: u32,
f: f32,
}
let mut u = IntOrFloat { f: 1.0 };
let f = unsafe { &u.f };
// This will not compile because the field has already been borrowed, even
// if only immutably
let i = unsafe { &mut u.i };
*i = 10;
println!("f = {f} and i = {i}");
```
See the [Reference](../reference/items/unions) for more information on `union`s.
rust Macro std::format_args Macro std::format\_args
=======================
```
macro_rules! format_args {
($fmt:expr) => { ... };
($fmt:expr, $($args:tt)*) => { ... };
}
```
Constructs parameters for the other string-formatting macros.
This macro functions by taking a formatting string literal containing `{}` for each additional argument passed. `format_args!` prepares the additional parameters to ensure the output can be interpreted as a string and canonicalizes the arguments into a single type. Any value that implements the [`Display`](fmt/trait.display) trait can be passed to `format_args!`, as can any [`Debug`](fmt/trait.debug) implementation be passed to a `{:?}` within the formatting string.
This macro produces a value of type [`fmt::Arguments`](fmt/struct.arguments). This value can be passed to the macros within [`std::fmt`](fmt/index) for performing useful redirection. All other formatting macros ([`format!`](macro.format), [`write!`](macro.write "write!"), [`println!`](macro.println), etc) are proxied through this one. `format_args!`, unlike its derived macros, avoids heap allocations.
You can use the [`fmt::Arguments`](fmt/struct.arguments) value that `format_args!` returns in `Debug` and `Display` contexts as seen below. The example also shows that `Debug` and `Display` format to the same thing: the interpolated format string in `format_args!`.
```
let debug = format!("{:?}", format_args!("{} foo {:?}", 1, 2));
let display = format!("{}", format_args!("{} foo {:?}", 1, 2));
assert_eq!("1 foo 2", display);
assert_eq!(display, debug);
```
For more information, see the documentation in [`std::fmt`](fmt/index).
Examples
--------
```
use std::fmt;
let s = fmt::format(format_args!("hello {}", "world"));
assert_eq!(s, format!("hello {}", "world"));
```
rust Macro std::cfg Macro std::cfg
==============
```
macro_rules! cfg {
($($cfg:tt)*) => { ... };
}
```
Evaluates boolean combinations of configuration flags at compile-time.
In addition to the `#[cfg]` attribute, this macro is provided to allow boolean expression evaluation of configuration flags. This frequently leads to less duplicated code.
The syntax given to this macro is the same syntax as the [`cfg`](../reference/conditional-compilation#the-cfg-attribute) attribute.
`cfg!`, unlike `#[cfg]`, does not remove any code and only evaluates to true or false. For example, all blocks in an if/else expression need to be valid when `cfg!` is used for the condition, regardless of what `cfg!` is evaluating.
Examples
--------
```
let my_directory = if cfg!(windows) {
"windows-specific-directory"
} else {
"unix-directory"
};
```
rust Macro std::eprintln Macro std::eprintln
===================
```
macro_rules! eprintln {
() => { ... };
($($arg:tt)*) => { ... };
}
```
Prints to the standard error, with a newline.
Equivalent to the [`println!`](macro.println) macro, except that output goes to [`io::stderr`](io/fn.stderr) instead of [`io::stdout`](io/fn.stdout). See [`println!`](macro.println) for example usage.
Use `eprintln!` only for error and progress messages. Use `println!` instead for the primary output of your program.
Panics
------
Panics if writing to `io::stderr` fails.
Writing to non-blocking stdout can cause an error, which will lead this macro to panic.
Examples
--------
```
eprintln!("Error: Could not complete task");
```
rust Keyword ref Keyword ref
===========
Bind by reference during pattern matching.
`ref` annotates pattern bindings to make them borrow rather than move. It is **not** a part of the pattern as far as matching is concerned: it does not affect *whether* a value is matched, only *how* it is matched.
By default, [`match`](keyword.match) statements consume all they can, which can sometimes be a problem, when you don’t really need the value to be moved and owned:
ⓘ
```
let maybe_name = Some(String::from("Alice"));
// The variable 'maybe_name' is consumed here ...
match maybe_name {
Some(n) => println!("Hello, {n}"),
_ => println!("Hello, world"),
}
// ... and is now unavailable.
println!("Hello again, {}", maybe_name.unwrap_or("world".into()));
```
Using the `ref` keyword, the value is only borrowed, not moved, making it available for use after the [`match`](keyword.match) statement:
```
let maybe_name = Some(String::from("Alice"));
// Using `ref`, the value is borrowed, not moved ...
match maybe_name {
Some(ref n) => println!("Hello, {n}"),
_ => println!("Hello, world"),
}
// ... so it's available here!
println!("Hello again, {}", maybe_name.unwrap_or("world".into()));
```
`&` vs `ref`
-------------
* `&` denotes that your pattern expects a reference to an object. Hence `&` is a part of said pattern: `&Foo` matches different objects than `Foo` does.
* `ref` indicates that you want a reference to an unpacked value. It is not matched against: `Foo(ref foo)` matches the same objects as `Foo(foo)`.
See also the [Reference](../reference/patterns#identifier-patterns) for more information.
rust Primitive Type unit Primitive Type unit
===================
The `()` type, also called “unit”.
The `()` type has exactly one value `()`, and is used when there is no other meaningful value that could be returned. `()` is most commonly seen implicitly: functions without a `-> ...` implicitly have return type `()`, that is, these are equivalent:
```
fn long() -> () {}
fn short() {}
```
The semicolon `;` can be used to discard the result of an expression at the end of a block, making the expression (and thus the block) evaluate to `()`. For example,
```
fn returns_i64() -> i64 {
1i64
}
fn returns_unit() {
1i64;
}
let is_i64 = {
returns_i64()
};
let is_unit = {
returns_i64();
};
```
Trait Implementations
---------------------
[source](https://doc.rust-lang.org/src/std/primitive_docs.rs.html#450-454)### impl Clone for ()
[source](https://doc.rust-lang.org/src/std/primitive_docs.rs.html#451-453)#### 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/core/fmt/mod.rs.html#2597)### impl Debug for ()
[source](https://doc.rust-lang.org/src/core/fmt/mod.rs.html#2599)#### 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/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#203)const: [unstable](https://github.com/rust-lang/rust/issues/87864 "Tracking issue for const_default_impls") · #### fn default()
Returns the default value of `()`
[source](https://doc.rust-lang.org/src/core/iter/traits/collect.rs.html#385)1.28.0 · ### impl Extend<()> for ()
[source](https://doc.rust-lang.org/src/core/iter/traits/collect.rs.html#386)#### fn extend<T>(&mut self, iter: T)where T: [IntoIterator](iter/trait.intoiterator "trait std::iter::IntoIterator")<Item = [()](primitive.unit)>,
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#389)#### fn extend\_one(&mut self, \_item: ())
🔬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/core/unit.rs.html#17)1.23.0 · ### impl FromIterator<()> for ()
Collapses all unit items from an iterator into one.
This is more useful when combined with higher-level abstractions, like collecting to a `Result<(), E>` where you only care about errors:
```
use std::io::*;
let data = vec![1, 2, 3, 4, 5];
let res: Result<()> = data.iter()
.map(|x| writeln!(stdout(), "{x}"))
.collect();
assert!(res.is_ok());
```
[source](https://doc.rust-lang.org/src/core/unit.rs.html#18)#### fn from\_iter<I>(iter: I)where I: [IntoIterator](iter/trait.intoiterator "trait std::iter::IntoIterator")<Item = [()](primitive.unit)>,
Creates a value from an iterator. [Read more](iter/trait.fromiterator#tymethod.from_iter)
[source](https://doc.rust-lang.org/src/core/hash/mod.rs.html#920)### impl Hash for ()
[source](https://doc.rust-lang.org/src/core/hash/mod.rs.html#920)#### 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/cmp.rs.html#1461)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · ### impl Ord for ()
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1463)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · #### fn cmp(&self, \_other: &()) -> 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/cmp.rs.html#1355)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · ### impl PartialEq<()> for ()
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1357)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · #### fn eq(&self, \_other: &()) -> 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#1361)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · #### fn ne(&self, \_other: &()) -> 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/cmp.rs.html#1407)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · ### impl PartialOrd<()> for ()
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1409)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · #### fn partial\_cmp(&self, &()) -> 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/process.rs.html#2168-2173)1.61.0 · ### impl Termination for ()
[source](https://doc.rust-lang.org/src/std/process.rs.html#2170-2172)#### fn report(self) -> ExitCode
Is called to get the representation of the value as status code. This status code is returned to the operating system. [Read more](process/trait.termination#tymethod.report)
[source](https://doc.rust-lang.org/src/std/primitive_docs.rs.html#459-461)### impl Copy for ()
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1377)### impl Eq for ()
Auto Trait Implementations
--------------------------
### impl RefUnwindSafe for ()
### impl Send for ()
### impl Sync for ()
### impl Unpin for ()
### impl UnwindSafe for ()
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 Macro std::matches Macro std::matches
==================
```
macro_rules! matches {
($expression:expr, $(|)? $($pattern:pat_param)|+ $(if $guard:expr)? $(,)?) => { ... };
}
```
Returns whether the given expression matches any of the given patterns.
Like in a `match` expression, the pattern can be optionally followed by `if` and a guard expression that has access to names bound by the pattern.
Examples
--------
```
let foo = 'f';
assert!(matches!(foo, 'A'..='Z' | 'a'..='z'));
let bar = Some(4);
assert!(matches!(bar, Some(x) if x > 2));
```
rust Primitive Type tuple Primitive Type tuple
====================
A finite heterogeneous sequence, `(T, U, ..)`.
Let’s cover each of those in turn:
Tuples are *finite*. In other words, a tuple has a length. Here’s a tuple of length `3`:
```
("hello", 5, 'c');
```
‘Length’ is also sometimes called ‘arity’ here; each tuple of a different length is a different, distinct type.
Tuples are *heterogeneous*. This means that each element of the tuple can have a different type. In that tuple above, it has the type:
```
(&'static str, i32, char)
```
Tuples are a *sequence*. This means that they can be accessed by position; this is called ‘tuple indexing’, and it looks like this:
```
let tuple = ("hello", 5, 'c');
assert_eq!(tuple.0, "hello");
assert_eq!(tuple.1, 5);
assert_eq!(tuple.2, 'c');
```
The sequential nature of the tuple applies to its implementations of various traits. For example, in [`PartialOrd`](cmp/trait.partialord "PartialOrd") and [`Ord`](cmp/trait.ord "Ord"), the elements are compared sequentially until the first non-equal set is found.
For more about tuples, see [the book](../book/ch03-02-data-types#the-tuple-type).
Trait implementations
---------------------
In this documentation the shorthand `(T₁, T₂, …, Tₙ)` is used to represent tuples of varying length. When that is used, any trait bound expressed on `T` applies to each element of the tuple independently. Note that this is a convenience notation to avoid repetitive documentation, not valid Rust syntax.
Due to a temporary restriction in Rust’s type system, the following traits are only implemented on tuples of arity 12 or less. In the future, this may change:
* [`PartialEq`](cmp/trait.partialeq "PartialEq")
* [`Eq`](cmp/trait.eq "Eq")
* [`PartialOrd`](cmp/trait.partialord "PartialOrd")
* [`Ord`](cmp/trait.ord "Ord")
* [`Debug`](fmt/trait.debug)
* [`Default`](default/trait.default "Default")
* [`Hash`](hash/trait.hash)
The following traits are implemented for tuples of any length. These traits have implementations that are automatically generated by the compiler, so are not limited by missing language features.
* [`Clone`](clone/trait.clone "Clone")
* [`Copy`](marker/trait.copy "Copy")
* [`Send`](marker/trait.send "Send")
* [`Sync`](marker/trait.sync "Sync")
* [`Unpin`](marker/trait.unpin)
* [`UnwindSafe`](panic/trait.unwindsafe)
* [`RefUnwindSafe`](panic/trait.refunwindsafe)
Examples
--------
Basic usage:
```
let tuple = ("hello", 5, 'c');
assert_eq!(tuple.0, "hello");
```
Tuples are often used as a return type when you want to return more than one value:
```
fn calculate_point() -> (i32, i32) {
// Don't do a calculation, that's not the point of the example
(4, 5)
}
let point = calculate_point();
assert_eq!(point.0, 4);
assert_eq!(point.1, 5);
// Combining this with patterns can be nicer.
let (x, y) = calculate_point();
assert_eq!(x, 4);
assert_eq!(y, 5);
```
Trait Implementations
---------------------
[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/primitive_docs.rs.html#1047-1049)#### 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/core/fmt/mod.rs.html#2587)### impl<T> Debug for (T₁, T₂, …, Tₙ)where T: [Debug](fmt/trait.debug "trait std::fmt::Debug") + ?[Sized](marker/trait.sized "trait std::marker::Sized"),
This trait is implemented for tuples up to twelve items long.
[source](https://doc.rust-lang.org/src/core/fmt/mod.rs.html#2587)#### 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/tuple.rs.html#159)### impl<T> Default for (T₁, T₂, …, Tₙ)where T: [Default](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/core/tuple.rs.html#159)#### fn default() -> (T,)
Returns the “default value” for a type. [Read more](default/trait.default#tymethod.default)
[source](https://doc.rust-lang.org/src/alloc/collections/btree/map.rs.html#2140-2141)1.2.0 · ### impl<'a, K, V, A> Extend<(&'a K, &'a V)> for BTreeMap<K, V, A>where K: [Ord](cmp/trait.ord "trait std::cmp::Ord") + [Copy](marker/trait.copy "trait std::marker::Copy"), V: [Copy](marker/trait.copy "trait std::marker::Copy"), 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#2143)#### fn extend<I>(&mut self, iter: I)where I: [IntoIterator](iter/trait.intoiterator "trait std::iter::IntoIterator")<Item = ([&'a](primitive.reference) K, [&'a](primitive.reference) V)>,
Extends a collection with the contents of an iterator. [Read more](iter/trait.extend#tymethod.extend)
[source](https://doc.rust-lang.org/src/alloc/collections/btree/map.rs.html#2148)#### fn extend\_one(&mut self, (&'a K, &'a V))
🔬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/collections/hash/map.rs.html#3053-3073)1.4.0 · ### impl<'a, K, V, S> Extend<(&'a K, &'a V)> for HashMap<K, V, S>where K: [Eq](cmp/trait.eq "trait std::cmp::Eq") + [Hash](hash/trait.hash "trait std::hash::Hash") + [Copy](marker/trait.copy "trait std::marker::Copy"), V: [Copy](marker/trait.copy "trait std::marker::Copy"), S: [BuildHasher](hash/trait.buildhasher "trait std::hash::BuildHasher"),
[source](https://doc.rust-lang.org/src/std/collections/hash/map.rs.html#3060-3062)#### fn extend<T: IntoIterator<Item = (&'a K, &'a V)>>(&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/std/collections/hash/map.rs.html#3065-3067)#### fn extend\_one(&mut self, (k, v): (&'a K, &'a V))
🔬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/std/collections/hash/map.rs.html#3070-3072)#### 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/core/iter/traits/collect.rs.html#393)1.56.0 · ### impl<A, B, ExtendA, ExtendB> Extend<(A, B)> for (ExtendA, ExtendB)where ExtendA: [Extend](iter/trait.extend "trait std::iter::Extend")<A>, ExtendB: [Extend](iter/trait.extend "trait std::iter::Extend")<B>,
[source](https://doc.rust-lang.org/src/core/iter/traits/collect.rs.html#418)#### fn extend<T>(&mut self, into\_iter: T)where T: [IntoIterator](iter/trait.intoiterator "trait std::iter::IntoIterator")<Item = [(A, B)](primitive.tuple)>,
Allows to `extend` a tuple of collections that also implement `Extend`.
See also: [`Iterator::unzip`](iter/trait.iterator#method.unzip "Iterator::unzip")
##### Examples
```
let mut tuple = (vec![0], vec![1]);
tuple.extend([(2, 3), (4, 5), (6, 7)]);
assert_eq!(tuple.0, [0, 2, 4, 6]);
assert_eq!(tuple.1, [1, 3, 5, 7]);
// also allows for arbitrarily nested tuples as elements
let mut nested_tuple = (vec![1], (vec![2], vec![3]));
nested_tuple.extend([(4, (5, 6)), (7, (8, 9))]);
let (a, (b, c)) = nested_tuple;
assert_eq!(a, [1, 4, 7]);
assert_eq!(b, [2, 5, 8]);
assert_eq!(c, [3, 6, 9]);
```
[source](https://doc.rust-lang.org/src/core/iter/traits/collect.rs.html#441)#### fn extend\_one(&mut self, item: (A, B))
🔬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#446)#### 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/collections/btree/map.rs.html#2125)### impl<K, V, A> Extend<(K, V)> for BTreeMap<K, V, A>where K: [Ord](cmp/trait.ord "trait std::cmp::Ord"), 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#2127)#### fn extend<T>(&mut self, iter: T)where T: [IntoIterator](iter/trait.intoiterator "trait std::iter::IntoIterator")<Item = [(K, V)](primitive.tuple)>,
Extends a collection with the contents of an iterator. [Read more](iter/trait.extend#tymethod.extend)
[source](https://doc.rust-lang.org/src/alloc/collections/btree/map.rs.html#2134)#### fn extend\_one(&mut self, (K, V))
🔬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/collections/hash/map.rs.html#3031-3050)### impl<K, V, S> Extend<(K, V)> for HashMap<K, V, S>where K: [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"),
Inserts all new key-values from the iterator and replaces values with existing keys with new values returned from the iterator.
[source](https://doc.rust-lang.org/src/std/collections/hash/map.rs.html#3037-3039)#### fn extend<T: IntoIterator<Item = (K, V)>>(&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/std/collections/hash/map.rs.html#3042-3044)#### fn extend\_one(&mut self, (k, v): (K, V))
🔬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/std/collections/hash/map.rs.html#3047-3049)#### 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/net/socket_addr.rs.html#589-599)1.17.0 · ### impl<I: Into<IpAddr>> From<(I, u16)> for SocketAddr
[source](https://doc.rust-lang.org/src/std/net/socket_addr.rs.html#596-598)#### fn from(pieces: (I, u16)) -> SocketAddr
Converts a tuple struct (Into<[`IpAddr`](net/enum.ipaddr "IpAddr")>, `u16`) into a [`SocketAddr`](net/enum.socketaddr "SocketAddr").
This conversion creates a [`SocketAddr::V4`](net/enum.socketaddr#variant.V4 "SocketAddr::V4") for an [`IpAddr::V4`](net/enum.ipaddr#variant.V4 "IpAddr::V4") and creates a [`SocketAddr::V6`](net/enum.socketaddr#variant.V6 "SocketAddr::V6") for an [`IpAddr::V6`](net/enum.ipaddr#variant.V6 "IpAddr::V6").
`u16` is treated as port of the newly created [`SocketAddr`](net/enum.socketaddr "SocketAddr").
[source](https://doc.rust-lang.org/src/alloc/collections/btree/map.rs.html#2110)### impl<K, V> FromIterator<(K, V)> for BTreeMap<K, V, Global>where K: [Ord](cmp/trait.ord "trait std::cmp::Ord"),
[source](https://doc.rust-lang.org/src/alloc/collections/btree/map.rs.html#2111)#### fn from\_iter<T>(iter: T) -> BTreeMap<K, V, Global>where T: [IntoIterator](iter/trait.intoiterator "trait std::iter::IntoIterator")<Item = [(K, V)](primitive.tuple)>,
Creates a value from an iterator. [Read more](iter/trait.fromiterator#tymethod.from_iter)
[source](https://doc.rust-lang.org/src/std/collections/hash/map.rs.html#3016-3026)### impl<K, V, S> FromIterator<(K, V)> for HashMap<K, V, S>where K: [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") + [Default](default/trait.default "trait std::default::Default"),
[source](https://doc.rust-lang.org/src/std/collections/hash/map.rs.html#3021-3025)#### fn from\_iter<T: IntoIterator<Item = (K, V)>>(iter: T) -> HashMap<K, V, S>
Creates a value from an iterator. [Read more](iter/trait.fromiterator#tymethod.from_iter)
[source](https://doc.rust-lang.org/src/core/hash/mod.rs.html#921)### impl<T> Hash for (T₁, T₂, …, Tₙ)where T: [Hash](hash/trait.hash "trait std::hash::Hash") + ?[Sized](marker/trait.sized "trait std::marker::Sized"),
This trait is implemented for tuples up to twelve items long.
[source](https://doc.rust-lang.org/src/core/hash/mod.rs.html#921)#### fn hash<S>(&self, state: &mut S)where S: [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/tuple.rs.html#159)### impl<T> Ord for (T₁, T₂, …, Tₙ)where T: [Ord](cmp/trait.ord "trait std::cmp::Ord") + ?[Sized](marker/trait.sized "trait std::marker::Sized"),
This trait is implemented for tuples up to twelve items long.
[source](https://doc.rust-lang.org/src/core/tuple.rs.html#159)#### fn cmp(&self, other: &(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/tuple.rs.html#159)### impl<T> PartialEq<(T,)> for (T₁, T₂, …, Tₙ)where T: [PartialEq](cmp/trait.partialeq "trait std::cmp::PartialEq")<T> + ?[Sized](marker/trait.sized "trait std::marker::Sized"),
This trait is implemented for tuples up to twelve items long.
[source](https://doc.rust-lang.org/src/core/tuple.rs.html#159)#### fn eq(&self, other: &(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/tuple.rs.html#159)#### fn ne(&self, other: &(T,)) -> 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/tuple.rs.html#159)### impl<T> PartialOrd<(T,)> for (T₁, T₂, …, Tₙ)where T: [PartialOrd](cmp/trait.partialord "trait std::cmp::PartialOrd")<T> + [PartialEq](cmp/trait.partialeq "trait std::cmp::PartialEq")<T> + ?[Sized](marker/trait.sized "trait std::marker::Sized"),
This trait is implemented for tuples up to twelve items long.
[source](https://doc.rust-lang.org/src/core/tuple.rs.html#159)#### fn partial\_cmp(&self, other: &(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/tuple.rs.html#159)#### fn lt(&self, other: &(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/tuple.rs.html#159)#### fn le(&self, other: &(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/tuple.rs.html#159)#### fn ge(&self, other: &(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/tuple.rs.html#159)#### fn gt(&self, other: &(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/ops/range.rs.html#915)1.28.0 · ### 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#916)#### fn start\_bound(&self) -> Bound<&T>
Start index bound. [Read more](ops/trait.rangebounds#tymethod.start_bound)
[source](https://doc.rust-lang.org/src/core/ops/range.rs.html#920)#### fn end\_bound(&self) -> Bound<&T>
End index bound. [Read more](ops/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](ops/trait.rangebounds#method.contains)
[source](https://doc.rust-lang.org/src/core/ops/range.rs.html#896)1.28.0 · ### impl<T> RangeBounds<T> for (Bound<T>, Bound<T>)
[source](https://doc.rust-lang.org/src/core/ops/range.rs.html#897)#### fn start\_bound(&self) -> Bound<&T>
Start index bound. [Read more](ops/trait.rangebounds#tymethod.start_bound)
[source](https://doc.rust-lang.org/src/core/ops/range.rs.html#905)#### fn end\_bound(&self) -> Bound<&T>
End index bound. [Read more](ops/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](ops/trait.rangebounds#method.contains)
[source](https://doc.rust-lang.org/src/core/slice/index.rs.html#708)1.53.0 · ### impl<T> SliceIndex<[T]> for (Bound<usize>, Bound<usize>)
#### type Output = [T]
The output type returned by methods.
[source](https://doc.rust-lang.org/src/core/slice/index.rs.html#712)#### fn get( self, slice: &[T]) -> Option<&<(Bound<usize>, Bound<usize>) as SliceIndex<[T]>>::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/slice/index.rs.html#717)#### fn get\_mut( self, slice: &mut [T]) -> Option<&mut <(Bound<usize>, Bound<usize>) as SliceIndex<[T]>>::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/slice/index.rs.html#722)#### unsafe fn get\_unchecked( self, slice: \*const [T]) -> \*const <(Bound<usize>, Bound<usize>) as SliceIndex<[T]>>::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/slice/index.rs.html#728)#### unsafe fn get\_unchecked\_mut( self, slice: \*mut [T]) -> \*mut <(Bound<usize>, Bound<usize>) as SliceIndex<[T]>>::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/slice/index.rs.html#734)#### fn index( self, slice: &[T]) -> &<(Bound<usize>, Bound<usize>) as SliceIndex<[T]>>::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/slice/index.rs.html#739)#### fn index\_mut( self, slice: &mut [T]) -> &mut <(Bound<usize>, Bound<usize>) as SliceIndex<[T]>>::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/std/net/socket_addr.rs.html#910-927)### impl ToSocketAddrs for (&str, u16)
#### type Iter = IntoIter<SocketAddr, Global>
Returned iterator over socket addresses which this type may correspond to. [Read more](net/trait.tosocketaddrs#associatedtype.Iter)
[source](https://doc.rust-lang.org/src/std/net/socket_addr.rs.html#912-926)#### fn to\_socket\_addrs(&self) -> Result<IntoIter<SocketAddr>>
Converts this object to an iterator of resolved [`SocketAddr`](net/enum.socketaddr "SocketAddr")s. [Read more](net/trait.tosocketaddrs#tymethod.to_socket_addrs)
[source](https://doc.rust-lang.org/src/std/net/socket_addr.rs.html#869-878)### impl ToSocketAddrs for (IpAddr, u16)
#### type Iter = IntoIter<SocketAddr>
Returned iterator over socket addresses which this type may correspond to. [Read more](net/trait.tosocketaddrs#associatedtype.Iter)
[source](https://doc.rust-lang.org/src/std/net/socket_addr.rs.html#871-877)#### fn to\_socket\_addrs(&self) -> Result<IntoIter<SocketAddr>>
Converts this object to an iterator of resolved [`SocketAddr`](net/enum.socketaddr "SocketAddr")s. [Read more](net/trait.tosocketaddrs#tymethod.to_socket_addrs)
[source](https://doc.rust-lang.org/src/std/net/socket_addr.rs.html#881-887)### impl ToSocketAddrs for (Ipv4Addr, u16)
#### type Iter = IntoIter<SocketAddr>
Returned iterator over socket addresses which this type may correspond to. [Read more](net/trait.tosocketaddrs#associatedtype.Iter)
[source](https://doc.rust-lang.org/src/std/net/socket_addr.rs.html#883-886)#### fn to\_socket\_addrs(&self) -> Result<IntoIter<SocketAddr>>
Converts this object to an iterator of resolved [`SocketAddr`](net/enum.socketaddr "SocketAddr")s. [Read more](net/trait.tosocketaddrs#tymethod.to_socket_addrs)
[source](https://doc.rust-lang.org/src/std/net/socket_addr.rs.html#890-896)### impl ToSocketAddrs for (Ipv6Addr, u16)
#### type Iter = IntoIter<SocketAddr>
Returned iterator over socket addresses which this type may correspond to. [Read more](net/trait.tosocketaddrs#associatedtype.Iter)
[source](https://doc.rust-lang.org/src/std/net/socket_addr.rs.html#892-895)#### fn to\_socket\_addrs(&self) -> Result<IntoIter<SocketAddr>>
Converts this object to an iterator of resolved [`SocketAddr`](net/enum.socketaddr "SocketAddr")s. [Read more](net/trait.tosocketaddrs#tymethod.to_socket_addrs)
[source](https://doc.rust-lang.org/src/std/net/socket_addr.rs.html#930-935)1.46.0 · ### impl ToSocketAddrs for (String, u16)
#### type Iter = IntoIter<SocketAddr, Global>
Returned iterator over socket addresses which this type may correspond to. [Read more](net/trait.tosocketaddrs#associatedtype.Iter)
[source](https://doc.rust-lang.org/src/std/net/socket_addr.rs.html#932-934)#### fn to\_socket\_addrs(&self) -> Result<IntoIter<SocketAddr>>
Converts this object to an iterator of resolved [`SocketAddr`](net/enum.socketaddr "SocketAddr")s. [Read more](net/trait.tosocketaddrs#tymethod.to_socket_addrs)
[source](https://doc.rust-lang.org/src/std/primitive_docs.rs.html#1057-1059)### impl<T: Copy> Copy for (T₁, T₂, …, Tₙ)
This trait is implemented on arbitrary-length tuples.
[source](https://doc.rust-lang.org/src/core/tuple.rs.html#159)### impl<T> Eq for (T₁, T₂, …, Tₙ)where T: [Eq](cmp/trait.eq "trait std::cmp::Eq") + ?[Sized](marker/trait.sized "trait std::marker::Sized"),
This trait is implemented for tuples up to twelve items long.
Auto Trait Implementations
--------------------------
### impl<T> RefUnwindSafe for (T₁, T₂, …, Tₙ)where T: [RefUnwindSafe](panic/trait.refunwindsafe "trait std::panic::RefUnwindSafe"),
### impl<T> Send for (T₁, T₂, …, Tₙ)where T: [Send](marker/trait.send "trait std::marker::Send"),
### impl<T> Sync for (T₁, T₂, …, Tₙ)where T: [Sync](marker/trait.sync "trait std::marker::Sync"),
### impl<T> Unpin for (T₁, T₂, …, Tₙ)where T: [Unpin](marker/trait.unpin "trait std::marker::Unpin"),
### impl<T> UnwindSafe for (T₁, T₂, …, 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 Keyword in Keyword in
==========
Iterate over a series of values with [`for`](keyword.for).
The expression immediately following `in` must implement the [`IntoIterator`](../book/ch13-04-performance) trait.
### Literal Examples:
* `for _ in 1..3 {}` - Iterate over an exclusive range up to but excluding 3.
* `for _ in 1..=3 {}` - Iterate over an inclusive range up to and including 3.
(Read more about [range patterns](../reference/patterns?highlight=range#range-patterns))
The other use of `in` is with the keyword `pub`. It allows users to declare an item as visible only within a given scope.
### Literal Example:
* `pub(in crate::outer_mod) fn outer_mod_visible_fn() {}` - fn is visible in `outer_mod`
Starting with the 2018 edition, paths for `pub(in path)` must start with `crate`, `self` or `super`. The 2015 edition may also use paths starting with `::` or modules from the crate root.
For more information, see the [Reference](../reference/visibility-and-privacy#pubin-path-pubcrate-pubsuper-and-pubself).
rust Primitive Type i8 Primitive Type i8
=================
The 8-bit signed integer type.
Implementations
---------------
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#209)### impl i8
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#210-211)1.43.0 · #### pub const MIN: i8 = -128i8
The smallest value that can be represented by this integer type (−27)
##### Examples
Basic usage:
```
assert_eq!(i8::MIN, -128);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#210-211)1.43.0 · #### pub const MAX: i8 = 127i8
The largest value that can be represented by this integer type (27 − 1)
##### Examples
Basic usage:
```
assert_eq!(i8::MAX, 127);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#210-211)1.53.0 · #### pub const BITS: u32 = 8u32
The size of this integer type in bits.
##### Examples
```
assert_eq!(i8::BITS, 8);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#210-211)#### pub fn from\_str\_radix(src: &str, radix: u32) -> Result<i8, ParseIntError>
Converts a string slice in a given base to an integer.
The string is expected to be an optional `+` or `-` sign followed by digits. Leading and trailing whitespace represent an error. Digits are a subset of these characters, depending on `radix`:
* `0-9`
* `a-z`
* `A-Z`
##### Panics
This function panics if `radix` is not in the range from 2 to 36.
##### Examples
Basic usage:
```
assert_eq!(i8::from_str_radix("A", 16), Ok(10));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#210-211)const: 1.32.0 · #### pub const fn count\_ones(self) -> u32
Returns the number of ones in the binary representation of `self`.
##### Examples
Basic usage:
```
let n = 0b100_0000i8;
assert_eq!(n.count_ones(), 1);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#210-211)const: 1.32.0 · #### pub const fn count\_zeros(self) -> u32
Returns the number of zeros in the binary representation of `self`.
##### Examples
Basic usage:
```
assert_eq!(i8::MAX.count_zeros(), 1);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#210-211)const: 1.32.0 · #### pub const fn leading\_zeros(self) -> u32
Returns the number of leading zeros in the binary representation of `self`.
##### Examples
Basic usage:
```
let n = -1i8;
assert_eq!(n.leading_zeros(), 0);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#210-211)const: 1.32.0 · #### pub const fn trailing\_zeros(self) -> u32
Returns the number of trailing zeros in the binary representation of `self`.
##### Examples
Basic usage:
```
let n = -4i8;
assert_eq!(n.trailing_zeros(), 2);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#210-211)1.46.0 (const: 1.46.0) · #### pub const fn leading\_ones(self) -> u32
Returns the number of leading ones in the binary representation of `self`.
##### Examples
Basic usage:
```
let n = -1i8;
assert_eq!(n.leading_ones(), 8);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#210-211)1.46.0 (const: 1.46.0) · #### pub const fn trailing\_ones(self) -> u32
Returns the number of trailing ones in the binary representation of `self`.
##### Examples
Basic usage:
```
let n = 3i8;
assert_eq!(n.trailing_ones(), 2);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#210-211)const: 1.32.0 · #### pub const fn rotate\_left(self, n: u32) -> i8
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:
```
let n = -0x7ei8;
let m = 0xa;
assert_eq!(n.rotate_left(2), m);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#210-211)const: 1.32.0 · #### pub const fn rotate\_right(self, n: u32) -> i8
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:
```
let n = 0xai8;
let m = -0x7e;
assert_eq!(n.rotate_right(2), m);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#210-211)const: 1.32.0 · #### pub const fn swap\_bytes(self) -> i8
Reverses the byte order of the integer.
##### Examples
Basic usage:
```
let n = 0x12i8;
let m = n.swap_bytes();
assert_eq!(m, 0x12);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#210-211)1.37.0 (const: 1.37.0) · #### pub const fn reverse\_bits(self) -> i8
Reverses the order of bits in the integer. The least significant bit becomes the most significant bit, second least-significant bit becomes second most-significant bit, etc.
##### Examples
Basic usage:
```
let n = 0x12i8;
let m = n.reverse_bits();
assert_eq!(m, 0x48);
assert_eq!(0, 0i8.reverse_bits());
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#210-211)const: 1.32.0 · #### pub const fn from\_be(x: i8) -> i8
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:
```
let n = 0x1Ai8;
if cfg!(target_endian = "big") {
assert_eq!(i8::from_be(n), n)
} else {
assert_eq!(i8::from_be(n), n.swap_bytes())
}
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#210-211)const: 1.32.0 · #### pub const fn from\_le(x: i8) -> i8
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:
```
let n = 0x1Ai8;
if cfg!(target_endian = "little") {
assert_eq!(i8::from_le(n), n)
} else {
assert_eq!(i8::from_le(n), n.swap_bytes())
}
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#210-211)const: 1.32.0 · #### pub const fn to\_be(self) -> i8
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:
```
let n = 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/mod.rs.html#210-211)const: 1.32.0 · #### pub const fn to\_le(self) -> i8
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:
```
let n = 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/mod.rs.html#210-211)const: 1.47.0 · #### pub const fn checked\_add(self, rhs: i8) -> Option<i8>
Checked integer addition. Computes `self + rhs`, returning `None` if overflow occurred.
##### Examples
Basic usage:
```
assert_eq!((i8::MAX - 2).checked_add(1), Some(i8::MAX - 1));
assert_eq!((i8::MAX - 2).checked_add(3), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#210-211)const: [unstable](https://github.com/rust-lang/rust/issues/85122 "Tracking issue for const_inherent_unchecked_arith") · #### pub unsafe fn unchecked\_add(self, rhs: i8) -> i8
🔬This is a nightly-only experimental API. (`unchecked_math` [#85122](https://github.com/rust-lang/rust/issues/85122))
Unchecked integer addition. Computes `self + rhs`, assuming overflow cannot occur.
##### Safety
This results in undefined behavior when `self + rhs > i8::MAX` or `self + rhs < i8::MIN`, i.e. when [`checked_add`](primitive.i8#method.checked_add) would return `None`.
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#210-211)const: [unstable](https://github.com/rust-lang/rust/issues/87840 "Tracking issue for mixed_integer_ops") · #### pub fn checked\_add\_unsigned(self, rhs: u8) -> Option<i8>
🔬This is a nightly-only experimental API. (`mixed_integer_ops` [#87840](https://github.com/rust-lang/rust/issues/87840))
Checked addition with an unsigned integer. Computes `self + rhs`, returning `None` if overflow occurred.
##### Examples
Basic usage:
```
assert_eq!(1i8.checked_add_unsigned(2), Some(3));
assert_eq!((i8::MAX - 2).checked_add_unsigned(3), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#210-211)const: 1.47.0 · #### pub const fn checked\_sub(self, rhs: i8) -> Option<i8>
Checked integer subtraction. Computes `self - rhs`, returning `None` if overflow occurred.
##### Examples
Basic usage:
```
assert_eq!((i8::MIN + 2).checked_sub(1), Some(i8::MIN + 1));
assert_eq!((i8::MIN + 2).checked_sub(3), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#210-211)const: [unstable](https://github.com/rust-lang/rust/issues/85122 "Tracking issue for const_inherent_unchecked_arith") · #### pub unsafe fn unchecked\_sub(self, rhs: i8) -> i8
🔬This is a nightly-only experimental API. (`unchecked_math` [#85122](https://github.com/rust-lang/rust/issues/85122))
Unchecked integer subtraction. Computes `self - rhs`, assuming overflow cannot occur.
##### Safety
This results in undefined behavior when `self - rhs > i8::MAX` or `self - rhs < i8::MIN`, i.e. when [`checked_sub`](primitive.i8#method.checked_sub) would return `None`.
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#210-211)const: [unstable](https://github.com/rust-lang/rust/issues/87840 "Tracking issue for mixed_integer_ops") · #### pub fn checked\_sub\_unsigned(self, rhs: u8) -> Option<i8>
🔬This is a nightly-only experimental API. (`mixed_integer_ops` [#87840](https://github.com/rust-lang/rust/issues/87840))
Checked subtraction with an unsigned integer. Computes `self - rhs`, returning `None` if overflow occurred.
##### Examples
Basic usage:
```
assert_eq!(1i8.checked_sub_unsigned(2), Some(-1));
assert_eq!((i8::MIN + 2).checked_sub_unsigned(3), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#210-211)const: 1.47.0 · #### pub const fn checked\_mul(self, rhs: i8) -> Option<i8>
Checked integer multiplication. Computes `self * rhs`, returning `None` if overflow occurred.
##### Examples
Basic usage:
```
assert_eq!(i8::MAX.checked_mul(1), Some(i8::MAX));
assert_eq!(i8::MAX.checked_mul(2), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#210-211)const: [unstable](https://github.com/rust-lang/rust/issues/85122 "Tracking issue for const_inherent_unchecked_arith") · #### pub unsafe fn unchecked\_mul(self, rhs: i8) -> i8
🔬This is a nightly-only experimental API. (`unchecked_math` [#85122](https://github.com/rust-lang/rust/issues/85122))
Unchecked integer multiplication. Computes `self * rhs`, assuming overflow cannot occur.
##### Safety
This results in undefined behavior when `self * rhs > i8::MAX` or `self * rhs < i8::MIN`, i.e. when [`checked_mul`](primitive.i8#method.checked_mul) would return `None`.
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#210-211)const: 1.52.0 · #### pub const fn checked\_div(self, rhs: i8) -> Option<i8>
Checked integer division. Computes `self / rhs`, returning `None` if `rhs == 0` or the division results in overflow.
##### Examples
Basic usage:
```
assert_eq!((i8::MIN + 1).checked_div(-1), Some(127));
assert_eq!(i8::MIN.checked_div(-1), None);
assert_eq!((1i8).checked_div(0), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#210-211)1.38.0 (const: 1.52.0) · #### pub const fn checked\_div\_euclid(self, rhs: i8) -> Option<i8>
Checked Euclidean division. Computes `self.div_euclid(rhs)`, returning `None` if `rhs == 0` or the division results in overflow.
##### Examples
Basic usage:
```
assert_eq!((i8::MIN + 1).checked_div_euclid(-1), Some(127));
assert_eq!(i8::MIN.checked_div_euclid(-1), None);
assert_eq!((1i8).checked_div_euclid(0), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#210-211)1.7.0 (const: 1.52.0) · #### pub const fn checked\_rem(self, rhs: i8) -> Option<i8>
Checked integer remainder. Computes `self % rhs`, returning `None` if `rhs == 0` or the division results in overflow.
##### Examples
Basic usage:
```
assert_eq!(5i8.checked_rem(2), Some(1));
assert_eq!(5i8.checked_rem(0), None);
assert_eq!(i8::MIN.checked_rem(-1), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#210-211)1.38.0 (const: 1.52.0) · #### pub const fn checked\_rem\_euclid(self, rhs: i8) -> Option<i8>
Checked Euclidean remainder. Computes `self.rem_euclid(rhs)`, returning `None` if `rhs == 0` or the division results in overflow.
##### Examples
Basic usage:
```
assert_eq!(5i8.checked_rem_euclid(2), Some(1));
assert_eq!(5i8.checked_rem_euclid(0), None);
assert_eq!(i8::MIN.checked_rem_euclid(-1), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#210-211)1.7.0 (const: 1.47.0) · #### pub const fn checked\_neg(self) -> Option<i8>
Checked negation. Computes `-self`, returning `None` if `self == MIN`.
##### Examples
Basic usage:
```
assert_eq!(5i8.checked_neg(), Some(-5));
assert_eq!(i8::MIN.checked_neg(), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#210-211)1.7.0 (const: 1.47.0) · #### pub const fn checked\_shl(self, rhs: u32) -> Option<i8>
Checked shift left. Computes `self << rhs`, returning `None` if `rhs` is larger than or equal to the number of bits in `self`.
##### Examples
Basic usage:
```
assert_eq!(0x1i8.checked_shl(4), Some(0x10));
assert_eq!(0x1i8.checked_shl(129), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#210-211)const: [unstable](https://github.com/rust-lang/rust/issues/85122 "Tracking issue for const_inherent_unchecked_arith") · #### pub unsafe fn unchecked\_shl(self, rhs: i8) -> i8
🔬This is a nightly-only experimental API. (`unchecked_math` [#85122](https://github.com/rust-lang/rust/issues/85122))
Unchecked shift left. Computes `self << rhs`, assuming that `rhs` is less than the number of bits in `self`.
##### Safety
This results in undefined behavior if `rhs` is larger than or equal to the number of bits in `self`, i.e. when [`checked_shl`](primitive.i8#method.checked_shl) would return `None`.
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#210-211)1.7.0 (const: 1.47.0) · #### pub const fn checked\_shr(self, rhs: u32) -> Option<i8>
Checked shift right. Computes `self >> rhs`, returning `None` if `rhs` is larger than or equal to the number of bits in `self`.
##### Examples
Basic usage:
```
assert_eq!(0x10i8.checked_shr(4), Some(0x1));
assert_eq!(0x10i8.checked_shr(128), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#210-211)const: [unstable](https://github.com/rust-lang/rust/issues/85122 "Tracking issue for const_inherent_unchecked_arith") · #### pub unsafe fn unchecked\_shr(self, rhs: i8) -> i8
🔬This is a nightly-only experimental API. (`unchecked_math` [#85122](https://github.com/rust-lang/rust/issues/85122))
Unchecked shift right. Computes `self >> rhs`, assuming that `rhs` is less than the number of bits in `self`.
##### Safety
This results in undefined behavior if `rhs` is larger than or equal to the number of bits in `self`, i.e. when [`checked_shr`](primitive.i8#method.checked_shr) would return `None`.
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#210-211)1.13.0 (const: 1.47.0) · #### pub const fn checked\_abs(self) -> Option<i8>
Checked absolute value. Computes `self.abs()`, returning `None` if `self == MIN`.
##### Examples
Basic usage:
```
assert_eq!((-5i8).checked_abs(), Some(5));
assert_eq!(i8::MIN.checked_abs(), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#210-211)1.34.0 (const: 1.50.0) · #### pub const fn checked\_pow(self, exp: u32) -> Option<i8>
Checked exponentiation. Computes `self.pow(exp)`, returning `None` if overflow occurred.
##### Examples
Basic usage:
```
assert_eq!(8i8.checked_pow(2), Some(64));
assert_eq!(i8::MAX.checked_pow(2), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#210-211)const: 1.47.0 · #### pub const fn saturating\_add(self, rhs: i8) -> i8
Saturating integer addition. Computes `self + rhs`, saturating at the numeric bounds instead of overflowing.
##### Examples
Basic usage:
```
assert_eq!(100i8.saturating_add(1), 101);
assert_eq!(i8::MAX.saturating_add(100), i8::MAX);
assert_eq!(i8::MIN.saturating_add(-1), i8::MIN);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#210-211)const: [unstable](https://github.com/rust-lang/rust/issues/87840 "Tracking issue for mixed_integer_ops") · #### pub fn saturating\_add\_unsigned(self, rhs: u8) -> i8
🔬This is a nightly-only experimental API. (`mixed_integer_ops` [#87840](https://github.com/rust-lang/rust/issues/87840))
Saturating addition with an unsigned integer. Computes `self + rhs`, saturating at the numeric bounds instead of overflowing.
##### Examples
Basic usage:
```
assert_eq!(1i8.saturating_add_unsigned(2), 3);
assert_eq!(i8::MAX.saturating_add_unsigned(100), i8::MAX);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#210-211)const: 1.47.0 · #### pub const fn saturating\_sub(self, rhs: i8) -> i8
Saturating integer subtraction. Computes `self - rhs`, saturating at the numeric bounds instead of overflowing.
##### Examples
Basic usage:
```
assert_eq!(100i8.saturating_sub(127), -27);
assert_eq!(i8::MIN.saturating_sub(100), i8::MIN);
assert_eq!(i8::MAX.saturating_sub(-1), i8::MAX);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#210-211)const: [unstable](https://github.com/rust-lang/rust/issues/87840 "Tracking issue for mixed_integer_ops") · #### pub fn saturating\_sub\_unsigned(self, rhs: u8) -> i8
🔬This is a nightly-only experimental API. (`mixed_integer_ops` [#87840](https://github.com/rust-lang/rust/issues/87840))
Saturating subtraction with an unsigned integer. Computes `self - rhs`, saturating at the numeric bounds instead of overflowing.
##### Examples
Basic usage:
```
assert_eq!(100i8.saturating_sub_unsigned(127), -27);
assert_eq!(i8::MIN.saturating_sub_unsigned(100), i8::MIN);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#210-211)1.45.0 (const: 1.47.0) · #### pub const fn saturating\_neg(self) -> i8
Saturating integer negation. Computes `-self`, returning `MAX` if `self == MIN` instead of overflowing.
##### Examples
Basic usage:
```
assert_eq!(100i8.saturating_neg(), -100);
assert_eq!((-100i8).saturating_neg(), 100);
assert_eq!(i8::MIN.saturating_neg(), i8::MAX);
assert_eq!(i8::MAX.saturating_neg(), i8::MIN + 1);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#210-211)1.45.0 (const: 1.47.0) · #### pub const fn saturating\_abs(self) -> i8
Saturating absolute value. Computes `self.abs()`, returning `MAX` if `self == MIN` instead of overflowing.
##### Examples
Basic usage:
```
assert_eq!(100i8.saturating_abs(), 100);
assert_eq!((-100i8).saturating_abs(), 100);
assert_eq!(i8::MIN.saturating_abs(), i8::MAX);
assert_eq!((i8::MIN + 1).saturating_abs(), i8::MAX);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#210-211)1.7.0 (const: 1.47.0) · #### pub const fn saturating\_mul(self, rhs: i8) -> i8
Saturating integer multiplication. Computes `self * rhs`, saturating at the numeric bounds instead of overflowing.
##### Examples
Basic usage:
```
assert_eq!(10i8.saturating_mul(12), 120);
assert_eq!(i8::MAX.saturating_mul(10), i8::MAX);
assert_eq!(i8::MIN.saturating_mul(10), i8::MIN);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#210-211)1.58.0 (const: 1.58.0) · #### pub const fn saturating\_div(self, rhs: i8) -> i8
Saturating integer division. Computes `self / rhs`, saturating at the numeric bounds instead of overflowing.
##### Examples
Basic usage:
```
assert_eq!(5i8.saturating_div(2), 2);
assert_eq!(i8::MAX.saturating_div(-1), i8::MIN + 1);
assert_eq!(i8::MIN.saturating_div(-1), i8::MAX);
```
ⓘ
```
let _ = 1i8.saturating_div(0);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#210-211)1.34.0 (const: 1.50.0) · #### pub const fn saturating\_pow(self, exp: u32) -> i8
Saturating integer exponentiation. Computes `self.pow(exp)`, saturating at the numeric bounds instead of overflowing.
##### Examples
Basic usage:
```
assert_eq!((-4i8).saturating_pow(3), -64);
assert_eq!(i8::MIN.saturating_pow(2), i8::MAX);
assert_eq!(i8::MIN.saturating_pow(3), i8::MIN);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#210-211)const: 1.32.0 · #### pub const fn wrapping\_add(self, rhs: i8) -> i8
Wrapping (modular) addition. Computes `self + rhs`, wrapping around at the boundary of the type.
##### Examples
Basic usage:
```
assert_eq!(100i8.wrapping_add(27), 127);
assert_eq!(i8::MAX.wrapping_add(2), i8::MIN + 1);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#210-211)const: [unstable](https://github.com/rust-lang/rust/issues/87840 "Tracking issue for mixed_integer_ops") · #### pub fn wrapping\_add\_unsigned(self, rhs: u8) -> i8
🔬This is a nightly-only experimental API. (`mixed_integer_ops` [#87840](https://github.com/rust-lang/rust/issues/87840))
Wrapping (modular) addition with an unsigned integer. Computes `self + rhs`, wrapping around at the boundary of the type.
##### Examples
Basic usage:
```
assert_eq!(100i8.wrapping_add_unsigned(27), 127);
assert_eq!(i8::MAX.wrapping_add_unsigned(2), i8::MIN + 1);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#210-211)const: 1.32.0 · #### pub const fn wrapping\_sub(self, rhs: i8) -> i8
Wrapping (modular) subtraction. Computes `self - rhs`, wrapping around at the boundary of the type.
##### Examples
Basic usage:
```
assert_eq!(0i8.wrapping_sub(127), -127);
assert_eq!((-2i8).wrapping_sub(i8::MAX), i8::MAX);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#210-211)const: [unstable](https://github.com/rust-lang/rust/issues/87840 "Tracking issue for mixed_integer_ops") · #### pub fn wrapping\_sub\_unsigned(self, rhs: u8) -> i8
🔬This is a nightly-only experimental API. (`mixed_integer_ops` [#87840](https://github.com/rust-lang/rust/issues/87840))
Wrapping (modular) subtraction with an unsigned integer. Computes `self - rhs`, wrapping around at the boundary of the type.
##### Examples
Basic usage:
```
assert_eq!(0i8.wrapping_sub_unsigned(127), -127);
assert_eq!((-2i8).wrapping_sub_unsigned(u8::MAX), -1);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#210-211)const: 1.32.0 · #### pub const fn wrapping\_mul(self, rhs: i8) -> i8
Wrapping (modular) multiplication. Computes `self * rhs`, wrapping around at the boundary of the type.
##### Examples
Basic usage:
```
assert_eq!(10i8.wrapping_mul(12), 120);
assert_eq!(11i8.wrapping_mul(12), -124);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#210-211)1.2.0 (const: 1.52.0) · #### pub const fn wrapping\_div(self, rhs: i8) -> i8
Wrapping (modular) division. Computes `self / rhs`, wrapping around at the boundary of the type.
The only case where such wrapping can occur is when one divides `MIN / -1` on a signed type (where `MIN` is the negative minimal value for the type); this is equivalent to `-MIN`, a positive value that is too large to represent in the type. In such a case, this function returns `MIN` itself.
##### Panics
This function will panic if `rhs` is 0.
##### Examples
Basic usage:
```
assert_eq!(100i8.wrapping_div(10), 10);
assert_eq!((-128i8).wrapping_div(-1), -128);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#210-211)1.38.0 (const: 1.52.0) · #### pub const fn wrapping\_div\_euclid(self, rhs: i8) -> i8
Wrapping Euclidean division. Computes `self.div_euclid(rhs)`, wrapping around at the boundary of the type.
Wrapping will only occur in `MIN / -1` on a signed type (where `MIN` is the negative minimal value for the type). This is equivalent to `-MIN`, a positive value that is too large to represent in the type. In this case, this method returns `MIN` itself.
##### Panics
This function will panic if `rhs` is 0.
##### Examples
Basic usage:
```
assert_eq!(100i8.wrapping_div_euclid(10), 10);
assert_eq!((-128i8).wrapping_div_euclid(-1), -128);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#210-211)1.2.0 (const: 1.52.0) · #### pub const fn wrapping\_rem(self, rhs: i8) -> i8
Wrapping (modular) remainder. Computes `self % rhs`, wrapping around at the boundary of the type.
Such wrap-around never actually occurs mathematically; implementation artifacts make `x % y` invalid for `MIN / -1` on a signed type (where `MIN` is the negative minimal value). In such a case, this function returns `0`.
##### Panics
This function will panic if `rhs` is 0.
##### Examples
Basic usage:
```
assert_eq!(100i8.wrapping_rem(10), 0);
assert_eq!((-128i8).wrapping_rem(-1), 0);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#210-211)1.38.0 (const: 1.52.0) · #### pub const fn wrapping\_rem\_euclid(self, rhs: i8) -> i8
Wrapping Euclidean remainder. Computes `self.rem_euclid(rhs)`, wrapping around at the boundary of the type.
Wrapping will only occur in `MIN % -1` on a signed type (where `MIN` is the negative minimal value for the type). In this case, this method returns 0.
##### Panics
This function will panic if `rhs` is 0.
##### Examples
Basic usage:
```
assert_eq!(100i8.wrapping_rem_euclid(10), 0);
assert_eq!((-128i8).wrapping_rem_euclid(-1), 0);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#210-211)1.2.0 (const: 1.32.0) · #### pub const fn wrapping\_neg(self) -> i8
Wrapping (modular) negation. Computes `-self`, wrapping around at the boundary of the type.
The only case where such wrapping can occur is when one negates `MIN` on a signed type (where `MIN` is 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:
```
assert_eq!(100i8.wrapping_neg(), -100);
assert_eq!(i8::MIN.wrapping_neg(), i8::MIN);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#210-211)1.2.0 (const: 1.32.0) · #### pub const fn wrapping\_shl(self, rhs: u32) -> i8
Panic-free bitwise shift-left; yields `self << mask(rhs)`, where `mask` removes any high-order bits of `rhs` that would cause the shift to exceed the bitwidth of the type.
Note that this is *not* the same as a rotate-left; the RHS of a wrapping shift-left is restricted to the range of the type, rather than the bits shifted out of the LHS being returned to the other end. The primitive integer types all implement a [`rotate_left`](primitive.i8#method.rotate_left) function, which may be what you want instead.
##### Examples
Basic usage:
```
assert_eq!((-1i8).wrapping_shl(7), -128);
assert_eq!((-1i8).wrapping_shl(128), -1);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#210-211)1.2.0 (const: 1.32.0) · #### pub const fn wrapping\_shr(self, rhs: u32) -> i8
Panic-free bitwise shift-right; yields `self >> mask(rhs)`, where `mask` removes any high-order bits of `rhs` that would cause the shift to exceed the bitwidth of the type.
Note that this is *not* the same as a rotate-right; the RHS of a wrapping shift-right is restricted to the range of the type, rather than the bits shifted out of the LHS being returned to the other end. The primitive integer types all implement a [`rotate_right`](primitive.i8#method.rotate_right) function, which may be what you want instead.
##### Examples
Basic usage:
```
assert_eq!((-128i8).wrapping_shr(7), -1);
assert_eq!((-128i16).wrapping_shr(64), -128);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#210-211)1.13.0 (const: 1.32.0) · #### pub const fn wrapping\_abs(self) -> i8
Wrapping (modular) absolute value. Computes `self.abs()`, 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:
```
assert_eq!(100i8.wrapping_abs(), 100);
assert_eq!((-100i8).wrapping_abs(), 100);
assert_eq!(i8::MIN.wrapping_abs(), i8::MIN);
assert_eq!((-128i8).wrapping_abs() as u8, 128);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#210-211)1.51.0 (const: 1.51.0) · #### pub const fn unsigned\_abs(self) -> u8
Computes the absolute value of `self` without any wrapping or panicking.
##### Examples
Basic usage:
```
assert_eq!(100i8.unsigned_abs(), 100u8);
assert_eq!((-100i8).unsigned_abs(), 100u8);
assert_eq!((-128i8).unsigned_abs(), 128u8);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#210-211)1.34.0 (const: 1.50.0) · #### pub const fn wrapping\_pow(self, exp: u32) -> i8
Wrapping (modular) exponentiation. Computes `self.pow(exp)`, wrapping around at the boundary of the type.
##### Examples
Basic usage:
```
assert_eq!(3i8.wrapping_pow(4), 81);
assert_eq!(3i8.wrapping_pow(5), -13);
assert_eq!(3i8.wrapping_pow(6), -39);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#210-211)1.7.0 (const: 1.32.0) · #### pub const fn overflowing\_add(self, rhs: i8) -> (i8, bool)
Calculates `self` + `rhs`
Returns a tuple of the addition along with a boolean indicating whether an arithmetic overflow would occur. If an overflow would have occurred then the wrapped value is returned.
##### Examples
Basic usage:
```
assert_eq!(5i8.overflowing_add(2), (7, false));
assert_eq!(i8::MAX.overflowing_add(1), (i8::MIN, true));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#210-211)const: [unstable](https://github.com/rust-lang/rust/issues/85532 "Tracking issue for const_bigint_helper_methods") · #### pub fn carrying\_add(self, rhs: i8, carry: bool) -> (i8, bool)
🔬This is a nightly-only experimental API. (`bigint_helper_methods` [#85532](https://github.com/rust-lang/rust/issues/85532))
Calculates `self + rhs + carry` without the ability to overflow.
Performs “signed ternary addition” which takes in an extra bit to add, and may return an additional bit of overflow. This signed function is used only on the highest-ordered data, for which the signed overflow result indicates whether the big integer overflowed or not.
##### Examples
Basic usage:
```
#![feature(bigint_helper_methods)]
assert_eq!(5i8.carrying_add(2, false), (7, false));
assert_eq!(5i8.carrying_add(2, true), (8, false));
assert_eq!(i8::MAX.carrying_add(1, false), (i8::MIN, true));
assert_eq!(i8::MAX.carrying_add(0, true), (i8::MIN, true));
assert_eq!(i8::MAX.carrying_add(1, true), (i8::MIN + 1, true));
assert_eq!(i8::MAX.carrying_add(i8::MAX, true), (-1, true));
assert_eq!(i8::MIN.carrying_add(-1, true), (i8::MIN, false));
assert_eq!(0i8.carrying_add(i8::MAX, true), (i8::MIN, true));
```
If `carry` is false, this method is equivalent to [`overflowing_add`](primitive.i8#method.overflowing_add):
```
#![feature(bigint_helper_methods)]
assert_eq!(5_i8.carrying_add(2, false), 5_i8.overflowing_add(2));
assert_eq!(i8::MAX.carrying_add(1, false), i8::MAX.overflowing_add(1));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#210-211)const: [unstable](https://github.com/rust-lang/rust/issues/87840 "Tracking issue for mixed_integer_ops") · #### pub fn overflowing\_add\_unsigned(self, rhs: u8) -> (i8, bool)
🔬This is a nightly-only experimental API. (`mixed_integer_ops` [#87840](https://github.com/rust-lang/rust/issues/87840))
Calculates `self` + `rhs` with an unsigned `rhs`
Returns a tuple of the addition along with a boolean indicating whether an arithmetic overflow would occur. If an overflow would have occurred then the wrapped value is returned.
##### Examples
Basic usage:
```
assert_eq!(1i8.overflowing_add_unsigned(2), (3, false));
assert_eq!((i8::MIN).overflowing_add_unsigned(u8::MAX), (i8::MAX, false));
assert_eq!((i8::MAX - 2).overflowing_add_unsigned(3), (i8::MIN, true));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#210-211)1.7.0 (const: 1.32.0) · #### pub const fn overflowing\_sub(self, rhs: i8) -> (i8, bool)
Calculates `self` - `rhs`
Returns a tuple of the subtraction along with a boolean indicating whether an arithmetic overflow would occur. If an overflow would have occurred then the wrapped value is returned.
##### Examples
Basic usage:
```
assert_eq!(5i8.overflowing_sub(2), (3, false));
assert_eq!(i8::MIN.overflowing_sub(1), (i8::MAX, true));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#210-211)const: [unstable](https://github.com/rust-lang/rust/issues/85532 "Tracking issue for const_bigint_helper_methods") · #### pub fn borrowing\_sub(self, rhs: i8, borrow: bool) -> (i8, bool)
🔬This is a nightly-only experimental API. (`bigint_helper_methods` [#85532](https://github.com/rust-lang/rust/issues/85532))
Calculates `self - rhs - borrow` without the ability to overflow.
Performs “signed ternary subtraction” which takes in an extra bit to subtract, and may return an additional bit of overflow. This signed function is used only on the highest-ordered data, for which the signed overflow result indicates whether the big integer overflowed or not.
##### Examples
Basic usage:
```
#![feature(bigint_helper_methods)]
assert_eq!(5i8.borrowing_sub(2, false), (3, false));
assert_eq!(5i8.borrowing_sub(2, true), (2, false));
assert_eq!(0i8.borrowing_sub(1, false), (-1, false));
assert_eq!(0i8.borrowing_sub(1, true), (-2, false));
assert_eq!(i8::MIN.borrowing_sub(1, true), (i8::MAX - 1, true));
assert_eq!(i8::MAX.borrowing_sub(-1, false), (i8::MIN, true));
assert_eq!(i8::MAX.borrowing_sub(-1, true), (i8::MAX, false));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#210-211)const: [unstable](https://github.com/rust-lang/rust/issues/87840 "Tracking issue for mixed_integer_ops") · #### pub fn overflowing\_sub\_unsigned(self, rhs: u8) -> (i8, bool)
🔬This is a nightly-only experimental API. (`mixed_integer_ops` [#87840](https://github.com/rust-lang/rust/issues/87840))
Calculates `self` - `rhs` with an unsigned `rhs`
Returns a tuple of the subtraction along with a boolean indicating whether an arithmetic overflow would occur. If an overflow would have occurred then the wrapped value is returned.
##### Examples
Basic usage:
```
assert_eq!(1i8.overflowing_sub_unsigned(2), (-1, false));
assert_eq!((i8::MAX).overflowing_sub_unsigned(u8::MAX), (i8::MIN, false));
assert_eq!((i8::MIN + 2).overflowing_sub_unsigned(3), (i8::MAX, true));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#210-211)1.7.0 (const: 1.32.0) · #### pub const fn overflowing\_mul(self, rhs: i8) -> (i8, bool)
Calculates the multiplication of `self` and `rhs`.
Returns a tuple of the multiplication along with a boolean indicating whether an arithmetic overflow would occur. If an overflow would have occurred then the wrapped value is returned.
##### Examples
Basic usage:
```
assert_eq!(5i8.overflowing_mul(2), (10, false));
assert_eq!(1_000_000_000i32.overflowing_mul(10), (1410065408, true));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#210-211)1.7.0 (const: 1.52.0) · #### pub const fn overflowing\_div(self, rhs: i8) -> (i8, bool)
Calculates the divisor when `self` is divided by `rhs`.
Returns a tuple of the divisor along with a boolean indicating whether an arithmetic overflow would occur. If an overflow would occur then self is returned.
##### Panics
This function will panic if `rhs` is 0.
##### Examples
Basic usage:
```
assert_eq!(5i8.overflowing_div(2), (2, false));
assert_eq!(i8::MIN.overflowing_div(-1), (i8::MIN, true));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#210-211)1.38.0 (const: 1.52.0) · #### pub const fn overflowing\_div\_euclid(self, rhs: i8) -> (i8, bool)
Calculates the quotient of Euclidean division `self.div_euclid(rhs)`.
Returns a tuple of the divisor along with a boolean indicating whether an arithmetic overflow would occur. If an overflow would occur then `self` is returned.
##### Panics
This function will panic if `rhs` is 0.
##### Examples
Basic usage:
```
assert_eq!(5i8.overflowing_div_euclid(2), (2, false));
assert_eq!(i8::MIN.overflowing_div_euclid(-1), (i8::MIN, true));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#210-211)1.7.0 (const: 1.52.0) · #### pub const fn overflowing\_rem(self, rhs: i8) -> (i8, bool)
Calculates the remainder when `self` is divided by `rhs`.
Returns a tuple of the remainder after dividing along with a boolean indicating whether an arithmetic overflow would occur. If an overflow would occur then 0 is returned.
##### Panics
This function will panic if `rhs` is 0.
##### Examples
Basic usage:
```
assert_eq!(5i8.overflowing_rem(2), (1, false));
assert_eq!(i8::MIN.overflowing_rem(-1), (0, true));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#210-211)1.38.0 (const: 1.52.0) · #### pub const fn overflowing\_rem\_euclid(self, rhs: i8) -> (i8, bool)
Overflowing Euclidean remainder. Calculates `self.rem_euclid(rhs)`.
Returns a tuple of the remainder after dividing along with a boolean indicating whether an arithmetic overflow would occur. If an overflow would occur then 0 is returned.
##### Panics
This function will panic if `rhs` is 0.
##### Examples
Basic usage:
```
assert_eq!(5i8.overflowing_rem_euclid(2), (1, false));
assert_eq!(i8::MIN.overflowing_rem_euclid(-1), (0, true));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#210-211)1.7.0 (const: 1.32.0) · #### pub const fn overflowing\_neg(self) -> (i8, bool)
Negates self, overflowing if this is equal to the minimum value.
Returns a tuple of the negated version of self along with a boolean indicating whether an overflow happened. If `self` is the minimum value (e.g., `i32::MIN` for values of type `i32`), then the minimum value will be returned again and `true` will be returned for an overflow happening.
##### Examples
Basic usage:
```
assert_eq!(2i8.overflowing_neg(), (-2, false));
assert_eq!(i8::MIN.overflowing_neg(), (i8::MIN, true));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#210-211)1.7.0 (const: 1.32.0) · #### pub const fn overflowing\_shl(self, rhs: u32) -> (i8, bool)
Shifts self left by `rhs` bits.
Returns a tuple of the shifted version of self along with a boolean indicating whether the shift value was larger than or equal to the number of bits. If the shift value is too large, then value is masked (N-1) where N is the number of bits, and this value is then used to perform the shift.
##### Examples
Basic usage:
```
assert_eq!(0x1i8.overflowing_shl(4), (0x10, false));
assert_eq!(0x1i32.overflowing_shl(36), (0x10, true));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#210-211)1.7.0 (const: 1.32.0) · #### pub const fn overflowing\_shr(self, rhs: u32) -> (i8, bool)
Shifts self right by `rhs` bits.
Returns a tuple of the shifted version of self along with a boolean indicating whether the shift value was larger than or equal to the number of bits. If the shift value is too large, then value is masked (N-1) where N is the number of bits, and this value is then used to perform the shift.
##### Examples
Basic usage:
```
assert_eq!(0x10i8.overflowing_shr(4), (0x1, false));
assert_eq!(0x10i32.overflowing_shr(36), (0x1, true));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#210-211)1.13.0 (const: 1.32.0) · #### pub const fn overflowing\_abs(self) -> (i8, bool)
Computes the absolute value of `self`.
Returns a tuple of the absolute version of self along with a boolean indicating whether an overflow happened. If self is the minimum value (e.g., i8::MIN for values of type i8), then the minimum value will be returned again and true will be returned for an overflow happening.
##### Examples
Basic usage:
```
assert_eq!(10i8.overflowing_abs(), (10, false));
assert_eq!((-10i8).overflowing_abs(), (10, false));
assert_eq!((i8::MIN).overflowing_abs(), (i8::MIN, true));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#210-211)1.34.0 (const: 1.50.0) · #### pub const fn overflowing\_pow(self, exp: u32) -> (i8, bool)
Raises self to the power of `exp`, using exponentiation by squaring.
Returns a tuple of the exponentiation along with a bool indicating whether an overflow happened.
##### Examples
Basic usage:
```
assert_eq!(3i8.overflowing_pow(4), (81, false));
assert_eq!(3i8.overflowing_pow(5), (-13, true));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#210-211)const: 1.50.0 · #### pub const fn pow(self, exp: u32) -> i8
Raises self to the power of `exp`, using exponentiation by squaring.
##### Examples
Basic usage:
```
let x: i8 = 2; // or any other integer type
assert_eq!(x.pow(5), 32);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#210-211)1.38.0 (const: 1.52.0) · #### pub const fn div\_euclid(self, rhs: i8) -> i8
Calculates the quotient of Euclidean division of `self` by `rhs`.
This computes the integer `q` such that `self = q * rhs + r`, with `r = self.rem_euclid(rhs)` and `0 <= r < abs(rhs)`.
In other words, the result is `self / rhs` rounded to the integer `q` such that `self >= q * rhs`. If `self > 0`, this is equal to round towards zero (the default in Rust); if `self < 0`, this is equal to round towards +/- infinity.
##### Panics
This function will panic if `rhs` is 0 or the division results in overflow.
##### Examples
Basic usage:
```
let a: i8 = 7; // or any other integer type
let b = 4;
assert_eq!(a.div_euclid(b), 1); // 7 >= 4 * 1
assert_eq!(a.div_euclid(-b), -1); // 7 >= -4 * -1
assert_eq!((-a).div_euclid(b), -2); // -7 >= 4 * -2
assert_eq!((-a).div_euclid(-b), 2); // -7 >= -4 * 2
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#210-211)1.38.0 (const: 1.52.0) · #### pub const fn rem\_euclid(self, rhs: i8) -> i8
Calculates the least nonnegative remainder of `self (mod rhs)`.
This is done as if by the Euclidean division algorithm – given `r = self.rem_euclid(rhs)`, `self = rhs * self.div_euclid(rhs) + r`, and `0 <= r < abs(rhs)`.
##### Panics
This function will panic if `rhs` is 0 or the division results in overflow.
##### Examples
Basic usage:
```
let a: i8 = 7; // or any other integer type
let b = 4;
assert_eq!(a.rem_euclid(b), 3);
assert_eq!((-a).rem_euclid(b), 1);
assert_eq!(a.rem_euclid(-b), 3);
assert_eq!((-a).rem_euclid(-b), 1);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#210-211)#### pub const fn div\_floor(self, rhs: i8) -> i8
🔬This is a nightly-only experimental API. (`int_roundings` [#88581](https://github.com/rust-lang/rust/issues/88581))
Calculates the quotient of `self` and `rhs`, rounding the result towards negative infinity.
##### Panics
This function will panic if `rhs` is zero.
###### [Overflow behavior](#overflow-behavior)
On overflow, this function will panic if overflow checks are enabled (default in debug mode) and wrap if overflow checks are disabled (default in release mode).
##### Examples
Basic usage:
```
#![feature(int_roundings)]
let a: i8 = 8;
let b = 3;
assert_eq!(a.div_floor(b), 2);
assert_eq!(a.div_floor(-b), -3);
assert_eq!((-a).div_floor(b), -3);
assert_eq!((-a).div_floor(-b), 2);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#210-211)#### pub const fn div\_ceil(self, rhs: i8) -> i8
🔬This is a nightly-only experimental API. (`int_roundings` [#88581](https://github.com/rust-lang/rust/issues/88581))
Calculates the quotient of `self` and `rhs`, rounding the result towards positive infinity.
##### Panics
This function will panic if `rhs` is zero.
###### [Overflow behavior](#overflow-behavior-1)
On overflow, this function will panic if overflow checks are enabled (default in debug mode) and wrap if overflow checks are disabled (default in release mode).
##### Examples
Basic usage:
```
#![feature(int_roundings)]
let a: i8 = 8;
let b = 3;
assert_eq!(a.div_ceil(b), 3);
assert_eq!(a.div_ceil(-b), -2);
assert_eq!((-a).div_ceil(b), -2);
assert_eq!((-a).div_ceil(-b), 3);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#210-211)#### pub const fn next\_multiple\_of(self, rhs: i8) -> i8
🔬This is a nightly-only experimental API. (`int_roundings` [#88581](https://github.com/rust-lang/rust/issues/88581))
If `rhs` is positive, calculates the smallest value greater than or equal to `self` that is a multiple of `rhs`. If `rhs` is negative, calculates the largest value less than or equal to `self` that is a multiple of `rhs`.
##### Panics
This function will panic if `rhs` is zero.
###### [Overflow behavior](#overflow-behavior-2)
On overflow, this function will panic if overflow checks are enabled (default in debug mode) and wrap if overflow checks are disabled (default in release mode).
##### Examples
Basic usage:
```
#![feature(int_roundings)]
assert_eq!(16_i8.next_multiple_of(8), 16);
assert_eq!(23_i8.next_multiple_of(8), 24);
assert_eq!(16_i8.next_multiple_of(-8), 16);
assert_eq!(23_i8.next_multiple_of(-8), 16);
assert_eq!((-16_i8).next_multiple_of(8), -16);
assert_eq!((-23_i8).next_multiple_of(8), -16);
assert_eq!((-16_i8).next_multiple_of(-8), -16);
assert_eq!((-23_i8).next_multiple_of(-8), -24);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#210-211)#### pub const fn checked\_next\_multiple\_of(self, rhs: i8) -> Option<i8>
🔬This is a nightly-only experimental API. (`int_roundings` [#88581](https://github.com/rust-lang/rust/issues/88581))
If `rhs` is positive, calculates the smallest value greater than or equal to `self` that is a multiple of `rhs`. If `rhs` is negative, calculates the largest value less than or equal to `self` that is a multiple of `rhs`. Returns `None` if `rhs` is zero or the operation would result in overflow.
##### Examples
Basic usage:
```
#![feature(int_roundings)]
assert_eq!(16_i8.checked_next_multiple_of(8), Some(16));
assert_eq!(23_i8.checked_next_multiple_of(8), Some(24));
assert_eq!(16_i8.checked_next_multiple_of(-8), Some(16));
assert_eq!(23_i8.checked_next_multiple_of(-8), Some(16));
assert_eq!((-16_i8).checked_next_multiple_of(8), Some(-16));
assert_eq!((-23_i8).checked_next_multiple_of(8), Some(-16));
assert_eq!((-16_i8).checked_next_multiple_of(-8), Some(-16));
assert_eq!((-23_i8).checked_next_multiple_of(-8), Some(-24));
assert_eq!(1_i8.checked_next_multiple_of(0), None);
assert_eq!(i8::MAX.checked_next_multiple_of(2), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#210-211)#### pub const fn ilog(self, base: i8) -> u32
🔬This is a nightly-only experimental API. (`int_log` [#70887](https://github.com/rust-lang/rust/issues/70887))
Returns the logarithm of the number with respect to an arbitrary base, rounded down.
This method might not be optimized owing to implementation details; `ilog2` can produce results more efficiently for base 2, and `ilog10` can produce results more efficiently for base 10.
##### Panics
When the number is negative, zero, or if the base is not at least 2; it panics in debug mode and the return value is 0 in release mode.
##### Examples
```
#![feature(int_log)]
assert_eq!(5i8.ilog(5), 1);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#210-211)#### 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.
##### Panics
When the number is negative or zero it panics in debug mode and the return value is 0 in release mode.
##### Examples
```
#![feature(int_log)]
assert_eq!(2i8.ilog2(), 1);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#210-211)#### 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.
##### Panics
When the number is negative or zero it panics in debug mode and the return value is 0 in release mode.
##### Example
```
#![feature(int_log)]
assert_eq!(10i8.ilog10(), 1);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#210-211)#### pub const fn checked\_ilog(self, base: i8) -> Option<u32>
🔬This is a nightly-only experimental API. (`int_log` [#70887](https://github.com/rust-lang/rust/issues/70887))
Returns the logarithm of the number with respect to an arbitrary base, rounded down.
Returns `None` if the number is negative or zero, or if the base is not at least 2.
This method might not be optimized owing to implementation details; `checked_ilog2` can produce results more efficiently for base 2, and `checked_ilog10` can produce results more efficiently for base 10.
##### Examples
```
#![feature(int_log)]
assert_eq!(5i8.checked_ilog(5), Some(1));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#210-211)#### pub const fn checked\_ilog2(self) -> Option<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.
Returns `None` if the number is negative or zero.
##### Examples
```
#![feature(int_log)]
assert_eq!(2i8.checked_ilog2(), Some(1));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#210-211)#### pub const fn checked\_ilog10(self) -> Option<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.
Returns `None` if the number is negative or zero.
##### Example
```
#![feature(int_log)]
assert_eq!(10i8.checked_ilog10(), Some(1));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#210-211)const: 1.32.0 · #### pub const fn abs(self) -> i8
Computes the absolute value of `self`.
##### Overflow behavior
The absolute value of `i8::MIN` cannot be represented as an `i8`, and attempting to calculate it will cause an overflow. This means that code in debug mode will trigger a panic on this case and optimized code will return `i8::MIN` without a panic.
##### Examples
Basic usage:
```
assert_eq!(10i8.abs(), 10);
assert_eq!((-10i8).abs(), 10);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#210-211)1.60.0 (const: 1.60.0) · #### pub const fn abs\_diff(self, other: i8) -> u8
Computes the absolute difference between `self` and `other`.
This function always returns the correct answer without overflow or panics by returning an unsigned integer.
##### Examples
Basic usage:
```
assert_eq!(100i8.abs_diff(80), 20u8);
assert_eq!(100i8.abs_diff(110), 10u8);
assert_eq!((-100i8).abs_diff(80), 180u8);
assert_eq!((-100i8).abs_diff(-120), 20u8);
assert_eq!(i8::MIN.abs_diff(i8::MAX), u8::MAX);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#210-211)const: 1.47.0 · #### pub const fn signum(self) -> i8
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:
```
assert_eq!(10i8.signum(), 1);
assert_eq!(0i8.signum(), 0);
assert_eq!((-10i8).signum(), -1);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#210-211)const: 1.32.0 · #### pub const fn is\_positive(self) -> bool
Returns `true` if `self` is positive and `false` if the number is zero or negative.
##### Examples
Basic usage:
```
assert!(10i8.is_positive());
assert!(!(-10i8).is_positive());
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#210-211)const: 1.32.0 · #### pub const fn is\_negative(self) -> bool
Returns `true` if `self` is negative and `false` if the number is zero or positive.
##### Examples
Basic usage:
```
assert!((-10i8).is_negative());
assert!(!10i8.is_negative());
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#210-211)1.32.0 (const: 1.44.0) · #### pub const fn to\_be\_bytes(self) -> [u8; 1]
Return the memory representation of this integer as a byte array in big-endian (network) byte order.
##### Examples
```
let bytes = 0x12i8.to_be_bytes();
assert_eq!(bytes, [0x12]);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#210-211)1.32.0 (const: 1.44.0) · #### pub const fn to\_le\_bytes(self) -> [u8; 1]
Return the memory representation of this integer as a byte array in little-endian byte order.
##### Examples
```
let bytes = 0x12i8.to_le_bytes();
assert_eq!(bytes, [0x12]);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#210-211)1.32.0 (const: 1.44.0) · #### pub const fn to\_ne\_bytes(self) -> [u8; 1]
Return the memory representation of this integer as a byte array in native byte order.
As the target platform’s native endianness is used, portable code should use [`to_be_bytes`](primitive.i8#method.to_be_bytes) or [`to_le_bytes`](primitive.i8#method.to_le_bytes), as appropriate, instead.
##### Examples
```
let bytes = 0x12i8.to_ne_bytes();
assert_eq!(
bytes,
if cfg!(target_endian = "big") {
[0x12]
} else {
[0x12]
}
);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#210-211)1.32.0 (const: 1.44.0) · #### pub const fn from\_be\_bytes(bytes: [u8; 1]) -> i8
Create an integer value from its representation as a byte array in big endian.
##### Examples
```
let value = i8::from_be_bytes([0x12]);
assert_eq!(value, 0x12);
```
When starting from a slice rather than an array, fallible conversion APIs can be used:
```
fn read_be_i8(input: &mut &[u8]) -> i8 {
let (int_bytes, rest) = input.split_at(std::mem::size_of::<i8>());
*input = rest;
i8::from_be_bytes(int_bytes.try_into().unwrap())
}
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#210-211)1.32.0 (const: 1.44.0) · #### pub const fn from\_le\_bytes(bytes: [u8; 1]) -> i8
Create an integer value from its representation as a byte array in little endian.
##### Examples
```
let value = i8::from_le_bytes([0x12]);
assert_eq!(value, 0x12);
```
When starting from a slice rather than an array, fallible conversion APIs can be used:
```
fn read_le_i8(input: &mut &[u8]) -> i8 {
let (int_bytes, rest) = input.split_at(std::mem::size_of::<i8>());
*input = rest;
i8::from_le_bytes(int_bytes.try_into().unwrap())
}
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#210-211)1.32.0 (const: 1.44.0) · #### pub const fn from\_ne\_bytes(bytes: [u8; 1]) -> i8
Create an integer value from its memory representation as a byte array in native endianness.
As the target platform’s native endianness is used, portable code likely wants to use [`from_be_bytes`](primitive.i8#method.from_be_bytes) or [`from_le_bytes`](primitive.i8#method.from_le_bytes), as appropriate instead.
##### Examples
```
let value = i8::from_ne_bytes(if cfg!(target_endian = "big") {
[0x12]
} else {
[0x12]
});
assert_eq!(value, 0x12);
```
When starting from a slice rather than an array, fallible conversion APIs can be used:
```
fn read_ne_i8(input: &mut &[u8]) -> i8 {
let (int_bytes, rest) = input.split_at(std::mem::size_of::<i8>());
*input = rest;
i8::from_ne_bytes(int_bytes.try_into().unwrap())
}
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#210-211)const: 1.32.0 · #### pub const fn min\_value() -> i8
👎Deprecating in a future Rust version: replaced by the `MIN` associated constant on this type
New code should prefer to use [`i8::MIN`](primitive.i8#associatedconstant.MIN "i8::MIN") instead.
Returns the smallest value that can be represented by this integer type.
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#210-211)const: 1.32.0 · #### pub const fn max\_value() -> i8
👎Deprecating in a future Rust version: replaced by the `MAX` associated constant on this type
New code should prefer to use [`i8::MAX`](primitive.i8#associatedconstant.MAX "i8::MAX") instead.
Returns the largest value that can be represented by this integer type.
Trait Implementations
---------------------
[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
The resulting type after applying the `+` operator.
[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") · #### fn add(self, other: &i8) -> <i8 as Add<i8>>::Output
Performs the `+` operation. [Read more](ops/trait.add#tymethod.add)
[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
The resulting type after applying the `+` operator.
[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") · #### fn add(self, other: &i8) -> <i8 as Add<i8>>::Output
Performs the `+` operation. [Read more](ops/trait.add#tymethod.add)
[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
The resulting type after applying the `+` operator.
[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") · #### fn add(self, other: i8) -> <i8 as Add<i8>>::Output
Performs the `+` operation. [Read more](ops/trait.add#tymethod.add)
[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
The resulting type after applying the `+` operator.
[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") · #### fn add(self, other: i8) -> i8
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<&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/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/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/ops/arith.rs.html#786)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/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/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/ops/arith.rs.html#786)1.8.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/ops/arith.rs.html#786)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/fmt/num.rs.html#175)### impl Binary for i8
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#175)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error>
Formats the value using the given formatter.
[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
The resulting type after applying the `&` operator.
[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") · #### fn bitand(self, other: &i8) -> <i8 as BitAnd<i8>>::Output
Performs the `&` operation. [Read more](ops/trait.bitand#tymethod.bitand)
[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
The resulting type after applying the `&` operator.
[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") · #### fn bitand(self, other: &i8) -> <i8 as BitAnd<i8>>::Output
Performs the `&` operation. [Read more](ops/trait.bitand#tymethod.bitand)
[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
The resulting type after applying the `&` operator.
[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") · #### fn bitand(self, other: i8) -> <i8 as BitAnd<i8>>::Output
Performs the `&` operation. [Read more](ops/trait.bitand#tymethod.bitand)
[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
The resulting type after applying the `&` operator.
[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") · #### fn bitand(self, rhs: i8) -> i8
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<&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/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/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/ops/bit.rs.html#734)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/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/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/ops/bit.rs.html#734)1.8.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/ops/bit.rs.html#734)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/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
The resulting type after applying the `|` operator.
[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") · #### fn bitor(self, other: &i8) -> <i8 as BitOr<i8>>::Output
Performs the `|` operation. [Read more](ops/trait.bitor#tymethod.bitor)
[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
The resulting type after applying the `|` operator.
[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") · #### fn bitor(self, other: &i8) -> <i8 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 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/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
The resulting type after applying the `|` operator.
[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") · #### fn bitor(self, other: i8) -> <i8 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 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/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
The resulting type after applying the `|` operator.
[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") · #### fn bitor(self, rhs: i8) -> i8
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<&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/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/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/ops/bit.rs.html#806)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/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/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/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/ops/bit.rs.html#806)1.8.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/ops/bit.rs.html#806)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/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
The resulting type after applying the `^` operator.
[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") · #### fn bitxor(self, other: &i8) -> <i8 as BitXor<i8>>::Output
Performs the `^` operation. [Read more](ops/trait.bitxor#tymethod.bitxor)
[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
The resulting type after applying the `^` operator.
[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") · #### fn bitxor(self, other: &i8) -> <i8 as BitXor<i8>>::Output
Performs the `^` operation. [Read more](ops/trait.bitxor#tymethod.bitxor)
[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
The resulting type after applying the `^` operator.
[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") · #### fn bitxor(self, other: i8) -> <i8 as BitXor<i8>>::Output
Performs the `^` operation. [Read more](ops/trait.bitxor#tymethod.bitxor)
[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
The resulting type after applying the `^` operator.
[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") · #### fn bitxor(self, other: i8) -> i8
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<&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/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/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/ops/bit.rs.html#878)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/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/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/ops/bit.rs.html#878)1.8.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/ops/bit.rs.html#878)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/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") · #### fn clone(&self) -> i8
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/num.rs.html#197-200)### impl Debug for i8
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#197-200)#### 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/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#215)const: [unstable](https://github.com/rust-lang/rust/issues/87864 "Tracking issue for const_default_impls") · #### fn default() -> i8
Returns the default value of `0`
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#461-464)### impl Display for i8
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#461-464)#### 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/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
The resulting type after applying the `/` operator.
[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") · #### fn div(self, other: &i8) -> <i8 as Div<i8>>::Output
Performs the `/` operation. [Read more](ops/trait.div#tymethod.div)
[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
The resulting type after applying the `/` operator.
[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") · #### fn div(self, other: &i8) -> <i8 as Div<i8>>::Output
Performs the `/` operation. [Read more](ops/trait.div#tymethod.div)
[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
The resulting type after applying the `/` operator.
[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") · #### fn div(self, other: i8) -> <i8 as Div<i8>>::Output
Performs the `/` operation. [Read more](ops/trait.div#tymethod.div)
[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
The resulting type after applying the `/` operator.
[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") · #### fn div(self, other: i8) -> i8
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<&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/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/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/ops/arith.rs.html#968)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/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/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/ops/arith.rs.html#968)1.8.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/ops/arith.rs.html#968)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/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/convert/num.rs.html#92)1.28.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<bool> for i8
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#92)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: bool) -> i8
Converts a `bool` to a `i8`. The resulting value is `0` for `false` and `1` for `true` values.
##### Examples
```
assert_eq!(i8::from(true), 1);
assert_eq!(i8::from(false), 0);
```
[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/87852 "Tracking issue for const_num_from_num")) · ### impl From<i8> for AtomicI8
[source](https://doc.rust-lang.org/src/core/sync/atomic.rs.html#2675-2693)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(v: i8) -> AtomicI8
Converts an `i8` into an `AtomicI8`.
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#155)1.6.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<i8> for f32
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#155)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: i8) -> f32
Converts `i8` to `f32` losslessly.
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#156)1.6.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<i8> for f64
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#156)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: i8) -> f64
Converts `i8` to `f64` losslessly.
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#116)1.26.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<i8> for i128
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#116)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: i8) -> i128
Converts `i8` to `i128` losslessly.
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#113)1.5.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<i8> for i16
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#113)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: i8) -> i16
Converts `i8` to `i16` losslessly.
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#114)1.5.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<i8> for i32
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#114)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: i8) -> i32
Converts `i8` to `i32` losslessly.
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#115)1.5.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<i8> for i64
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#115)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: i8) -> i64
Converts `i8` to `i64` losslessly.
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#117)1.5.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<i8> for isize
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#117)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: i8) -> isize
Converts `i8` to `isize` losslessly.
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#1018)### impl FromStr for i8
#### type Err = ParseIntError
The associated error which can be returned from parsing.
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#1018)#### fn from\_str(src: &str) -> Result<i8, ParseIntError>
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/hash/mod.rs.html#829-842)### impl Hash for i8
[source](https://doc.rust-lang.org/src/core/hash/mod.rs.html#829-842)#### 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#829-842)#### fn hash\_slice<H>(data: &[i8], 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/fmt/num.rs.html#465-468)1.42.0 · ### impl LowerExp for i8
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#465-468)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error>
Formats the value using the given formatter.
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#175)### impl LowerHex for i8
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#175)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error>
Formats the value using the given formatter.
[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
The resulting type after applying the `*` operator.
[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") · #### fn mul(self, other: &i8) -> <i8 as Mul<i8>>::Output
Performs the `*` operation. [Read more](ops/trait.mul#tymethod.mul)
[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
The resulting type after applying the `*` operator.
[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") · #### fn mul(self, other: &i8) -> <i8 as Mul<i8>>::Output
Performs the `*` operation. [Read more](ops/trait.mul#tymethod.mul)
[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
The resulting type after applying the `*` operator.
[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") · #### fn mul(self, other: i8) -> <i8 as Mul<i8>>::Output
Performs the `*` operation. [Read more](ops/trait.mul#tymethod.mul)
[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
The resulting type after applying the `*` operator.
[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") · #### fn mul(self, other: i8) -> i8
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<&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/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/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/ops/arith.rs.html#911)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/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/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/ops/arith.rs.html#911)1.8.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/ops/arith.rs.html#911)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/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
The resulting type after applying the `-` operator.
[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") · #### fn neg(self) -> <i8 as Neg>::Output
Performs the unary `-` operation. [Read more](ops/trait.neg#tymethod.neg)
[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
The resulting type after applying the `-` operator.
[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") · #### fn neg(self) -> i8
Performs the unary `-` operation. [Read more](ops/trait.neg#tymethod.neg)
[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
The resulting type after applying the `!` operator.
[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") · #### fn not(self) -> <i8 as Not>::Output
Performs the unary `!` operation. [Read more](ops/trait.not#tymethod.not)
[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
The resulting type after applying the `!` operator.
[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") · #### fn not(self) -> i8
Performs the unary `!` operation. [Read more](ops/trait.not#tymethod.not)
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#175)### impl Octal for i8
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#175)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error>
Formats the value using the given formatter.
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1486)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · ### impl Ord for i8
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1486)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · #### fn cmp(&self, other: &i8) -> 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/cmp.rs.html#1366-1368)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · ### impl PartialEq<i8> for i8
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1366-1368)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · #### fn eq(&self, other: &i8) -> 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#1366-1368)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · #### fn ne(&self, other: &i8) -> 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/cmp.rs.html#1486)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · ### impl PartialOrd<i8> for i8
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1486)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · #### fn partial\_cmp(&self, other: &i8) -> 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#1486)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · #### fn lt(&self, other: &i8) -> 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#1486)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · #### fn le(&self, other: &i8) -> 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#1486)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · #### fn ge(&self, other: &i8) -> 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/cmp.rs.html#1486)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · #### fn gt(&self, other: &i8) -> 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/iter/traits/accum.rs.html#141)1.12.0 · ### impl<'a> Product<&'a i8> for i8
[source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)#### fn product<I>(iter: I) -> i8where I: [Iterator](iter/trait.iterator "trait std::iter::Iterator")<Item = &'a [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.12.0 · ### impl Product<i8> for i8
[source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)#### fn product<I>(iter: I) -> i8where I: [Iterator](iter/trait.iterator "trait std::iter::Iterator")<Item = [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/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
The resulting type after applying the `%` operator.
[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") · #### fn rem(self, other: &i8) -> <i8 as Rem<i8>>::Output
Performs the `%` operation. [Read more](ops/trait.rem#tymethod.rem)
[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
The resulting type after applying the `%` operator.
[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") · #### fn rem(self, other: &i8) -> <i8 as Rem<i8>>::Output
Performs the `%` operation. [Read more](ops/trait.rem#tymethod.rem)
[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
The resulting type after applying the `%` operator.
[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") · #### fn rem(self, other: i8) -> <i8 as Rem<i8>>::Output
Performs the `%` operation. [Read more](ops/trait.rem#tymethod.rem)
[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
The resulting type after applying the `%` operator.
[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") · #### fn rem(self, other: i8) -> i8
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<&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/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/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/ops/arith.rs.html#1029)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/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/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/ops/arith.rs.html#1029)1.8.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/ops/arith.rs.html#1029)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/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i128) -> <i8 as Shl<i128>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i128) -> <i8 as Shl<i128>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i16) -> <i8 as Shl<i16>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i16) -> <i8 as Shl<i16>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i32) -> <i8 as Shl<i32>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i32) -> <i8 as Shl<i32>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i64) -> <i8 as Shl<i64>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i64) -> <i8 as Shl<i64>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i8) -> <i128 as Shl<i8>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i8) -> <i16 as Shl<i8>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i8) -> <i32 as Shl<i8>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i8) -> <i64 as Shl<i8>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i8) -> <i8 as Shl<i8>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i8) -> <isize as Shl<i8>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i8) -> <u128 as Shl<i8>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i8) -> <u16 as Shl<i8>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i8) -> <u32 as Shl<i8>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i8) -> <u64 as Shl<i8>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i8) -> <u8 as Shl<i8>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i8) -> <usize as Shl<i8>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i8) -> <i128 as Shl<i8>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i8) -> <i16 as Shl<i8>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i8) -> <i32 as Shl<i8>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i8) -> <i64 as Shl<i8>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i8) -> <i8 as Shl<i8>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i8) -> <isize as Shl<i8>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i8) -> <u128 as Shl<i8>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i8) -> <u16 as Shl<i8>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i8) -> <u32 as Shl<i8>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i8) -> <u64 as Shl<i8>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i8) -> <u8 as Shl<i8>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i8) -> <usize as Shl<i8>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &isize) -> <i8 as Shl<isize>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &isize) -> <i8 as Shl<isize>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u128) -> <i8 as Shl<u128>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u128) -> <i8 as Shl<u128>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u16) -> <i8 as Shl<u16>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u16) -> <i8 as Shl<u16>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u32) -> <i8 as Shl<u32>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u32) -> <i8 as Shl<u32>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u64) -> <i8 as Shl<u64>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u64) -> <i8 as Shl<u64>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u8) -> <i8 as Shl<u8>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u8) -> <i8 as Shl<u8>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &usize) -> <i8 as Shl<usize>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &usize) -> <i8 as Shl<usize>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i128) -> <i8 as Shl<i128>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i128) -> i8
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i16) -> <i8 as Shl<i16>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i16) -> i8
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i32) -> <i8 as Shl<i32>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i32) -> i8
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i64) -> <i8 as Shl<i64>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i64) -> i8
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i8) -> <i128 as Shl<i8>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i8) -> <i16 as Shl<i8>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i8) -> <i32 as Shl<i8>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i8) -> <i64 as Shl<i8>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i8) -> <i8 as Shl<i8>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i8) -> <isize as Shl<i8>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i8) -> <u128 as Shl<i8>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i8) -> <u16 as Shl<i8>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i8) -> <u32 as Shl<i8>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i8) -> <u64 as Shl<i8>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i8) -> <u8 as Shl<i8>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i8) -> <usize as Shl<i8>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i8) -> i128
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i8) -> i16
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i8) -> i32
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i8) -> i64
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i8) -> i8
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i8) -> isize
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i8) -> u128
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i8) -> u16
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i8) -> u32
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i8) -> u64
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i8) -> u8
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i8) -> usize
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: isize) -> <i8 as Shl<isize>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: isize) -> i8
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u128) -> <i8 as Shl<u128>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u128) -> i8
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u16) -> <i8 as Shl<u16>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u16) -> i8
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u32) -> <i8 as Shl<u32>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u32) -> i8
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u64) -> <i8 as Shl<u64>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u64) -> i8
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u8) -> <i8 as Shl<u8>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u8) -> i8
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: usize) -> <i8 as Shl<usize>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: usize) -> i8
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &i128)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &i16)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &i32)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &i64)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &i8)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &i8)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &i8)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &i8)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &i8)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &i8)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &i8)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &i8)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &i8)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &i8)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &i8)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &i8)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &isize)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &u128)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &u16)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &u32)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &u64)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &u8)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)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/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: i128)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: i16)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: i32)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: i64)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: i8)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: i8)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: i8)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: i8)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: i8)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: i8)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: i8)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: i8)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: i8)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: i8)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: i8)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: i8)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: isize)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: u128)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: u16)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: u32)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: u64)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: u8)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)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/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i128) -> <i8 as Shr<i128>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i128) -> <i8 as Shr<i128>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i16) -> <i8 as Shr<i16>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i16) -> <i8 as Shr<i16>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i32) -> <i8 as Shr<i32>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i32) -> <i8 as Shr<i32>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i64) -> <i8 as Shr<i64>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i64) -> <i8 as Shr<i64>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i8) -> <i128 as Shr<i8>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i8) -> <i16 as Shr<i8>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i8) -> <i32 as Shr<i8>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i8) -> <i64 as Shr<i8>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i8) -> <i8 as Shr<i8>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i8) -> <isize as Shr<i8>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i8) -> <u128 as Shr<i8>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i8) -> <u16 as Shr<i8>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i8) -> <u32 as Shr<i8>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i8) -> <u64 as Shr<i8>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i8) -> <u8 as Shr<i8>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i8) -> <usize as Shr<i8>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i8) -> <i128 as Shr<i8>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i8) -> <i16 as Shr<i8>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i8) -> <i32 as Shr<i8>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i8) -> <i64 as Shr<i8>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i8) -> <i8 as Shr<i8>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i8) -> <isize as Shr<i8>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i8) -> <u128 as Shr<i8>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i8) -> <u16 as Shr<i8>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i8) -> <u32 as Shr<i8>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i8) -> <u64 as Shr<i8>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i8) -> <u8 as Shr<i8>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i8) -> <usize as Shr<i8>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &isize) -> <i8 as Shr<isize>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &isize) -> <i8 as Shr<isize>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u128) -> <i8 as Shr<u128>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u128) -> <i8 as Shr<u128>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u16) -> <i8 as Shr<u16>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u16) -> <i8 as Shr<u16>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u32) -> <i8 as Shr<u32>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u32) -> <i8 as Shr<u32>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u64) -> <i8 as Shr<u64>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u64) -> <i8 as Shr<u64>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u8) -> <i8 as Shr<u8>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u8) -> <i8 as Shr<u8>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &usize) -> <i8 as Shr<usize>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &usize) -> <i8 as Shr<usize>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i128) -> <i8 as Shr<i128>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i128) -> i8
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i16) -> <i8 as Shr<i16>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i16) -> i8
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i32) -> <i8 as Shr<i32>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i32) -> i8
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i64) -> <i8 as Shr<i64>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i64) -> i8
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i8) -> <i128 as Shr<i8>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i8) -> <i16 as Shr<i8>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i8) -> <i32 as Shr<i8>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i8) -> <i64 as Shr<i8>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i8) -> <i8 as Shr<i8>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i8) -> <isize as Shr<i8>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i8) -> <u128 as Shr<i8>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i8) -> <u16 as Shr<i8>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i8) -> <u32 as Shr<i8>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i8) -> <u64 as Shr<i8>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i8) -> <u8 as Shr<i8>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i8) -> <usize as Shr<i8>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i8) -> i128
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i8) -> i16
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i8) -> i32
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i8) -> i64
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i8) -> i8
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i8) -> isize
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i8) -> u128
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i8) -> u16
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i8) -> u32
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i8) -> u64
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i8) -> u8
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i8) -> usize
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: isize) -> <i8 as Shr<isize>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: isize) -> i8
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u128) -> <i8 as Shr<u128>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u128) -> i8
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u16) -> <i8 as Shr<u16>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u16) -> i8
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u32) -> <i8 as Shr<u32>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u32) -> i8
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u64) -> <i8 as Shr<u64>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u64) -> i8
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u8) -> <i8 as Shr<u8>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u8) -> i8
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: usize) -> <i8 as Shr<usize>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: usize) -> i8
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &i128)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &i16)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &i32)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &i64)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &i8)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &i8)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &i8)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &i8)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &i8)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &i8)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &i8)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &i8)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &i8)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &i8)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &i8)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &i8)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &isize)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &u128)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &u16)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &u32)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &u64)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &u8)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)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/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: i128)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: i16)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: i32)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: i64)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: i8)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: i8)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: i8)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: i8)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: i8)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: i8)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: i8)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: i8)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: i8)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: i8)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: i8)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: i8)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: isize)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: u128)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: u16)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: u32)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: u64)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: u8)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)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/up/up/portable-simd/crates/core_simd/src/vector.rs.html#698)### impl SimdElement for i8
#### type Mask = i8
🔬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.
[source](https://doc.rust-lang.org/src/core/iter/range.rs.html#391-394)### impl Step for i8
[source](https://doc.rust-lang.org/src/core/iter/range.rs.html#391-394)#### unsafe fn forward\_unchecked(start: i8, n: usize) -> i8
🔬This is a nightly-only experimental API. (`step_trait` [#42168](https://github.com/rust-lang/rust/issues/42168))
Returns the value that would be obtained by taking the *successor* of `self` `count` times. [Read more](iter/trait.step#method.forward_unchecked)
[source](https://doc.rust-lang.org/src/core/iter/range.rs.html#391-394)#### unsafe fn backward\_unchecked(start: i8, n: usize) -> i8
🔬This is a nightly-only experimental API. (`step_trait` [#42168](https://github.com/rust-lang/rust/issues/42168))
Returns the value that would be obtained by taking the *predecessor* of `self` `count` times. [Read more](iter/trait.step#method.backward_unchecked)
[source](https://doc.rust-lang.org/src/core/iter/range.rs.html#391-394)#### fn forward(start: i8, n: usize) -> i8
🔬This is a nightly-only experimental API. (`step_trait` [#42168](https://github.com/rust-lang/rust/issues/42168))
Returns the value that would be obtained by taking the *successor* of `self` `count` times. [Read more](iter/trait.step#method.forward)
[source](https://doc.rust-lang.org/src/core/iter/range.rs.html#391-394)#### fn backward(start: i8, n: usize) -> i8
🔬This is a nightly-only experimental API. (`step_trait` [#42168](https://github.com/rust-lang/rust/issues/42168))
Returns the value that would be obtained by taking the *predecessor* of `self` `count` times. [Read more](iter/trait.step#method.backward)
[source](https://doc.rust-lang.org/src/core/iter/range.rs.html#391-394)#### fn steps\_between(start: &i8, end: &i8) -> Option<usize>
🔬This is a nightly-only experimental API. (`step_trait` [#42168](https://github.com/rust-lang/rust/issues/42168))
Returns the number of *successor* steps required to get from `start` to `end`. [Read more](iter/trait.step#tymethod.steps_between)
[source](https://doc.rust-lang.org/src/core/iter/range.rs.html#391-394)#### fn forward\_checked(start: i8, n: usize) -> Option<i8>
🔬This is a nightly-only experimental API. (`step_trait` [#42168](https://github.com/rust-lang/rust/issues/42168))
Returns the value that would be obtained by taking the *successor* of `self` `count` times. [Read more](iter/trait.step#tymethod.forward_checked)
[source](https://doc.rust-lang.org/src/core/iter/range.rs.html#391-394)#### fn backward\_checked(start: i8, n: usize) -> Option<i8>
🔬This is a nightly-only experimental API. (`step_trait` [#42168](https://github.com/rust-lang/rust/issues/42168))
Returns the value that would be obtained by taking the *predecessor* of `self` `count` times. [Read more](iter/trait.step#tymethod.backward_checked)
[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
The resulting type after applying the `-` operator.
[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") · #### fn sub(self, other: &i8) -> <i8 as Sub<i8>>::Output
Performs the `-` operation. [Read more](ops/trait.sub#tymethod.sub)
[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
The resulting type after applying the `-` operator.
[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") · #### fn sub(self, other: &i8) -> <i8 as Sub<i8>>::Output
Performs the `-` operation. [Read more](ops/trait.sub#tymethod.sub)
[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
The resulting type after applying the `-` operator.
[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") · #### fn sub(self, other: i8) -> <i8 as Sub<i8>>::Output
Performs the `-` operation. [Read more](ops/trait.sub#tymethod.sub)
[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
The resulting type after applying the `-` operator.
[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") · #### fn sub(self, other: i8) -> i8
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<&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/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/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/ops/arith.rs.html#853)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/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/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/ops/arith.rs.html#853)1.8.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/ops/arith.rs.html#853)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/iter/traits/accum.rs.html#141)1.12.0 · ### impl<'a> Sum<&'a i8> for i8
[source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)#### fn sum<I>(iter: I) -> i8where I: [Iterator](iter/trait.iterator "trait std::iter::Iterator")<Item = &'a [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.12.0 · ### impl Sum<i8> for i8
[source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)#### fn sum<I>(iter: I) -> i8where I: [Iterator](iter/trait.iterator "trait std::iter::Iterator")<Item = [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/alloc/string.rs.html#2547)1.54.0 · ### impl ToString for i8
[source](https://doc.rust-lang.org/src/alloc/string.rs.html#2549)#### 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/num.rs.html#276)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<i128> for i8
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#276)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: i128) -> Result<i8, <i8 as TryFrom<i128>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#273)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<i16> for i8
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#273)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: i16) -> Result<i8, <i8 as TryFrom<i16>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#274)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<i32> for i8
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#274)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: i32) -> Result<i8, <i8 as TryFrom<i32>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#275)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<i64> for i8
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#275)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: i64) -> Result<i8, <i8 as TryFrom<i64>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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/convert/num.rs.html#286)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<i8> for u128
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#286)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: i8) -> Result<u128, <u128 as TryFrom<i8>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#286)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<i8> for u16
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#286)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: i8) -> Result<u16, <u16 as TryFrom<i8>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#286)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<i8> for u32
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#286)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: i8) -> Result<u32, <u32 as TryFrom<i8>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#286)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<i8> for u64
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#286)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: i8) -> Result<u64, <u64 as TryFrom<i8>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#286)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<i8> for u8
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#286)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: i8) -> Result<u8, <u8 as TryFrom<i8>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#366)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<i8> for usize
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#366)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: i8) -> Result<usize, <usize as TryFrom<i8>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#361)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<isize> for i8
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#361)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: isize) -> Result<i8, <i8 as TryFrom<isize>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#283)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<u128> for i8
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#283)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: u128) -> Result<i8, <i8 as TryFrom<u128>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#280)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<u16> for i8
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#280)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: u16) -> Result<i8, <i8 as TryFrom<u16>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#281)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<u32> for i8
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#281)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: u32) -> Result<i8, <i8 as TryFrom<u32>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#282)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<u64> for i8
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#282)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: u64) -> Result<i8, <i8 as TryFrom<u64>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#279)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<u8> for i8
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#279)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: u8) -> Result<i8, <i8 as TryFrom<u8>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#356)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<usize> for i8
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#356)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: usize) -> Result<i8, <i8 as TryFrom<usize>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### type Error = TryFromIntError
The type returned in the event of a conversion error.
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#465-468)1.42.0 · ### impl UpperExp for i8
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#465-468)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error>
Formats the value using the given formatter.
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#175)### impl UpperHex for i8
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#175)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error>
Formats the value using the given formatter.
[source](https://doc.rust-lang.org/src/core/marker.rs.html#830-835)### impl Copy for i8
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1377)### impl Eq for i8
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#38)### impl FloatToInt<i8> for f32
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#39)### impl FloatToInt<i8> for f64
[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/iter/range.rs.html#17)### impl TrustedStep for i8
Auto Trait Implementations
--------------------------
### impl RefUnwindSafe for i8
### impl Send for i8
### impl Sync for i8
### impl Unpin for i8
### impl UnwindSafe for i8
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 Macro std::env Macro std::env
==============
```
macro_rules! env {
($name:expr $(,)?) => { ... };
($name:expr, $error_msg:expr $(,)?) => { ... };
}
```
Inspects an environment variable at compile time.
This macro will expand to the value of the named environment variable at compile time, yielding an expression of type `&'static str`. Use [`std::env::var`](env/fn.var) instead if you want to read the value at runtime.
If the environment variable is not defined, then a compilation error will be emitted. To not emit a compile error, use the [`option_env!`](macro.option_env "option_env!") macro instead.
Examples
--------
```
let path: &'static str = env!("PATH");
println!("the $PATH variable at the time of compiling was: {path}");
```
You can customize the error message by passing a string as the second parameter:
ⓘ
```
let doc: &'static str = env!("documentation", "what's that?!");
```
If the `documentation` environment variable is not defined, you’ll get the following error:
```
error: what's that?!
```
rust Macro std::todo Macro std::todo
===============
```
macro_rules! todo {
() => { ... };
($($arg:tt)+) => { ... };
}
```
Indicates unfinished code.
This can be useful if you are prototyping and are just looking to have your code typecheck.
The difference between [`unimplemented!`](macro.unimplemented "unimplemented!") and `todo!` is that while `todo!` conveys an intent of implementing the functionality later and the message is “not yet implemented”, `unimplemented!` makes no such claims. Its message is “not implemented”. Also some IDEs will mark `todo!`s.
Panics
------
This will always [`panic!`](https://doc.rust-lang.org/core/macro.panic.html "panic!").
Examples
--------
Here’s an example of some in-progress code. We have a trait `Foo`:
```
trait Foo {
fn bar(&self);
fn baz(&self);
}
```
We want to implement `Foo` on one of our types, but we also want to work on just `bar()` first. In order for our code to compile, we need to implement `baz()`, so we can use `todo!`:
```
struct MyStruct;
impl Foo for MyStruct {
fn bar(&self) {
// implementation goes here
}
fn baz(&self) {
// let's not worry about implementing baz() for now
todo!();
}
}
fn main() {
let s = MyStruct;
s.bar();
// we aren't even using baz(), so this is fine.
}
```
rust Primitive Type i32 Primitive Type i32
==================
The 32-bit signed integer type.
Implementations
---------------
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#219)### impl i32
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#220-222)1.43.0 · #### pub const MIN: i32 = -2\_147\_483\_648i32
The smallest value that can be represented by this integer type (−231)
##### Examples
Basic usage:
```
assert_eq!(i32::MIN, -2147483648);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#220-222)1.43.0 · #### pub const MAX: i32 = 2\_147\_483\_647i32
The largest value that can be represented by this integer type (231 − 1)
##### Examples
Basic usage:
```
assert_eq!(i32::MAX, 2147483647);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#220-222)1.53.0 · #### pub const BITS: u32 = 32u32
The size of this integer type in bits.
##### Examples
```
assert_eq!(i32::BITS, 32);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#220-222)#### pub fn from\_str\_radix(src: &str, radix: u32) -> Result<i32, ParseIntError>
Converts a string slice in a given base to an integer.
The string is expected to be an optional `+` or `-` sign followed by digits. Leading and trailing whitespace represent an error. Digits are a subset of these characters, depending on `radix`:
* `0-9`
* `a-z`
* `A-Z`
##### Panics
This function panics if `radix` is not in the range from 2 to 36.
##### Examples
Basic usage:
```
assert_eq!(i32::from_str_radix("A", 16), Ok(10));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#220-222)const: 1.32.0 · #### pub const fn count\_ones(self) -> u32
Returns the number of ones in the binary representation of `self`.
##### Examples
Basic usage:
```
let n = 0b100_0000i32;
assert_eq!(n.count_ones(), 1);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#220-222)const: 1.32.0 · #### pub const fn count\_zeros(self) -> u32
Returns the number of zeros in the binary representation of `self`.
##### Examples
Basic usage:
```
assert_eq!(i32::MAX.count_zeros(), 1);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#220-222)const: 1.32.0 · #### pub const fn leading\_zeros(self) -> u32
Returns the number of leading zeros in the binary representation of `self`.
##### Examples
Basic usage:
```
let n = -1i32;
assert_eq!(n.leading_zeros(), 0);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#220-222)const: 1.32.0 · #### pub const fn trailing\_zeros(self) -> u32
Returns the number of trailing zeros in the binary representation of `self`.
##### Examples
Basic usage:
```
let n = -4i32;
assert_eq!(n.trailing_zeros(), 2);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#220-222)1.46.0 (const: 1.46.0) · #### pub const fn leading\_ones(self) -> u32
Returns the number of leading ones in the binary representation of `self`.
##### Examples
Basic usage:
```
let n = -1i32;
assert_eq!(n.leading_ones(), 32);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#220-222)1.46.0 (const: 1.46.0) · #### pub const fn trailing\_ones(self) -> u32
Returns the number of trailing ones in the binary representation of `self`.
##### Examples
Basic usage:
```
let n = 3i32;
assert_eq!(n.trailing_ones(), 2);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#220-222)const: 1.32.0 · #### pub const fn rotate\_left(self, n: u32) -> i32
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:
```
let n = 0x10000b3i32;
let m = 0xb301;
assert_eq!(n.rotate_left(8), m);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#220-222)const: 1.32.0 · #### pub const fn rotate\_right(self, n: u32) -> i32
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:
```
let n = 0xb301i32;
let m = 0x10000b3;
assert_eq!(n.rotate_right(8), m);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#220-222)const: 1.32.0 · #### pub const fn swap\_bytes(self) -> i32
Reverses the byte order of the integer.
##### Examples
Basic usage:
```
let n = 0x12345678i32;
let m = n.swap_bytes();
assert_eq!(m, 0x78563412);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#220-222)1.37.0 (const: 1.37.0) · #### pub const fn reverse\_bits(self) -> i32
Reverses the order of bits in the integer. The least significant bit becomes the most significant bit, second least-significant bit becomes second most-significant bit, etc.
##### Examples
Basic usage:
```
let n = 0x12345678i32;
let m = n.reverse_bits();
assert_eq!(m, 0x1e6a2c48);
assert_eq!(0, 0i32.reverse_bits());
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#220-222)const: 1.32.0 · #### pub const fn from\_be(x: i32) -> i32
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:
```
let n = 0x1Ai32;
if cfg!(target_endian = "big") {
assert_eq!(i32::from_be(n), n)
} else {
assert_eq!(i32::from_be(n), n.swap_bytes())
}
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#220-222)const: 1.32.0 · #### pub const fn from\_le(x: i32) -> i32
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:
```
let n = 0x1Ai32;
if cfg!(target_endian = "little") {
assert_eq!(i32::from_le(n), n)
} else {
assert_eq!(i32::from_le(n), n.swap_bytes())
}
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#220-222)const: 1.32.0 · #### pub const fn to\_be(self) -> i32
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:
```
let n = 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/mod.rs.html#220-222)const: 1.32.0 · #### pub const fn to\_le(self) -> i32
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:
```
let n = 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/mod.rs.html#220-222)const: 1.47.0 · #### pub const fn checked\_add(self, rhs: i32) -> Option<i32>
Checked integer addition. Computes `self + rhs`, returning `None` if overflow occurred.
##### Examples
Basic usage:
```
assert_eq!((i32::MAX - 2).checked_add(1), Some(i32::MAX - 1));
assert_eq!((i32::MAX - 2).checked_add(3), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#220-222)const: [unstable](https://github.com/rust-lang/rust/issues/85122 "Tracking issue for const_inherent_unchecked_arith") · #### pub unsafe fn unchecked\_add(self, rhs: i32) -> i32
🔬This is a nightly-only experimental API. (`unchecked_math` [#85122](https://github.com/rust-lang/rust/issues/85122))
Unchecked integer addition. Computes `self + rhs`, assuming overflow cannot occur.
##### Safety
This results in undefined behavior when `self + rhs > i32::MAX` or `self + rhs < i32::MIN`, i.e. when [`checked_add`](primitive.i32#method.checked_add) would return `None`.
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#220-222)const: [unstable](https://github.com/rust-lang/rust/issues/87840 "Tracking issue for mixed_integer_ops") · #### pub fn checked\_add\_unsigned(self, rhs: u32) -> Option<i32>
🔬This is a nightly-only experimental API. (`mixed_integer_ops` [#87840](https://github.com/rust-lang/rust/issues/87840))
Checked addition with an unsigned integer. Computes `self + rhs`, returning `None` if overflow occurred.
##### Examples
Basic usage:
```
assert_eq!(1i32.checked_add_unsigned(2), Some(3));
assert_eq!((i32::MAX - 2).checked_add_unsigned(3), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#220-222)const: 1.47.0 · #### pub const fn checked\_sub(self, rhs: i32) -> Option<i32>
Checked integer subtraction. Computes `self - rhs`, returning `None` if overflow occurred.
##### Examples
Basic usage:
```
assert_eq!((i32::MIN + 2).checked_sub(1), Some(i32::MIN + 1));
assert_eq!((i32::MIN + 2).checked_sub(3), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#220-222)const: [unstable](https://github.com/rust-lang/rust/issues/85122 "Tracking issue for const_inherent_unchecked_arith") · #### pub unsafe fn unchecked\_sub(self, rhs: i32) -> i32
🔬This is a nightly-only experimental API. (`unchecked_math` [#85122](https://github.com/rust-lang/rust/issues/85122))
Unchecked integer subtraction. Computes `self - rhs`, assuming overflow cannot occur.
##### Safety
This results in undefined behavior when `self - rhs > i32::MAX` or `self - rhs < i32::MIN`, i.e. when [`checked_sub`](primitive.i32#method.checked_sub) would return `None`.
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#220-222)const: [unstable](https://github.com/rust-lang/rust/issues/87840 "Tracking issue for mixed_integer_ops") · #### pub fn checked\_sub\_unsigned(self, rhs: u32) -> Option<i32>
🔬This is a nightly-only experimental API. (`mixed_integer_ops` [#87840](https://github.com/rust-lang/rust/issues/87840))
Checked subtraction with an unsigned integer. Computes `self - rhs`, returning `None` if overflow occurred.
##### Examples
Basic usage:
```
assert_eq!(1i32.checked_sub_unsigned(2), Some(-1));
assert_eq!((i32::MIN + 2).checked_sub_unsigned(3), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#220-222)const: 1.47.0 · #### pub const fn checked\_mul(self, rhs: i32) -> Option<i32>
Checked integer multiplication. Computes `self * rhs`, returning `None` if overflow occurred.
##### Examples
Basic usage:
```
assert_eq!(i32::MAX.checked_mul(1), Some(i32::MAX));
assert_eq!(i32::MAX.checked_mul(2), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#220-222)const: [unstable](https://github.com/rust-lang/rust/issues/85122 "Tracking issue for const_inherent_unchecked_arith") · #### pub unsafe fn unchecked\_mul(self, rhs: i32) -> i32
🔬This is a nightly-only experimental API. (`unchecked_math` [#85122](https://github.com/rust-lang/rust/issues/85122))
Unchecked integer multiplication. Computes `self * rhs`, assuming overflow cannot occur.
##### Safety
This results in undefined behavior when `self * rhs > i32::MAX` or `self * rhs < i32::MIN`, i.e. when [`checked_mul`](primitive.i32#method.checked_mul) would return `None`.
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#220-222)const: 1.52.0 · #### pub const fn checked\_div(self, rhs: i32) -> Option<i32>
Checked integer division. Computes `self / rhs`, returning `None` if `rhs == 0` or the division results in overflow.
##### Examples
Basic usage:
```
assert_eq!((i32::MIN + 1).checked_div(-1), Some(2147483647));
assert_eq!(i32::MIN.checked_div(-1), None);
assert_eq!((1i32).checked_div(0), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#220-222)1.38.0 (const: 1.52.0) · #### pub const fn checked\_div\_euclid(self, rhs: i32) -> Option<i32>
Checked Euclidean division. Computes `self.div_euclid(rhs)`, returning `None` if `rhs == 0` or the division results in overflow.
##### Examples
Basic usage:
```
assert_eq!((i32::MIN + 1).checked_div_euclid(-1), Some(2147483647));
assert_eq!(i32::MIN.checked_div_euclid(-1), None);
assert_eq!((1i32).checked_div_euclid(0), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#220-222)1.7.0 (const: 1.52.0) · #### pub const fn checked\_rem(self, rhs: i32) -> Option<i32>
Checked integer remainder. Computes `self % rhs`, returning `None` if `rhs == 0` or the division results in overflow.
##### Examples
Basic usage:
```
assert_eq!(5i32.checked_rem(2), Some(1));
assert_eq!(5i32.checked_rem(0), None);
assert_eq!(i32::MIN.checked_rem(-1), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#220-222)1.38.0 (const: 1.52.0) · #### pub const fn checked\_rem\_euclid(self, rhs: i32) -> Option<i32>
Checked Euclidean remainder. Computes `self.rem_euclid(rhs)`, returning `None` if `rhs == 0` or the division results in overflow.
##### Examples
Basic usage:
```
assert_eq!(5i32.checked_rem_euclid(2), Some(1));
assert_eq!(5i32.checked_rem_euclid(0), None);
assert_eq!(i32::MIN.checked_rem_euclid(-1), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#220-222)1.7.0 (const: 1.47.0) · #### pub const fn checked\_neg(self) -> Option<i32>
Checked negation. Computes `-self`, returning `None` if `self == MIN`.
##### Examples
Basic usage:
```
assert_eq!(5i32.checked_neg(), Some(-5));
assert_eq!(i32::MIN.checked_neg(), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#220-222)1.7.0 (const: 1.47.0) · #### pub const fn checked\_shl(self, rhs: u32) -> Option<i32>
Checked shift left. Computes `self << rhs`, returning `None` if `rhs` is larger than or equal to the number of bits in `self`.
##### Examples
Basic usage:
```
assert_eq!(0x1i32.checked_shl(4), Some(0x10));
assert_eq!(0x1i32.checked_shl(129), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#220-222)const: [unstable](https://github.com/rust-lang/rust/issues/85122 "Tracking issue for const_inherent_unchecked_arith") · #### pub unsafe fn unchecked\_shl(self, rhs: i32) -> i32
🔬This is a nightly-only experimental API. (`unchecked_math` [#85122](https://github.com/rust-lang/rust/issues/85122))
Unchecked shift left. Computes `self << rhs`, assuming that `rhs` is less than the number of bits in `self`.
##### Safety
This results in undefined behavior if `rhs` is larger than or equal to the number of bits in `self`, i.e. when [`checked_shl`](primitive.i32#method.checked_shl) would return `None`.
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#220-222)1.7.0 (const: 1.47.0) · #### pub const fn checked\_shr(self, rhs: u32) -> Option<i32>
Checked shift right. Computes `self >> rhs`, returning `None` if `rhs` is larger than or equal to the number of bits in `self`.
##### Examples
Basic usage:
```
assert_eq!(0x10i32.checked_shr(4), Some(0x1));
assert_eq!(0x10i32.checked_shr(128), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#220-222)const: [unstable](https://github.com/rust-lang/rust/issues/85122 "Tracking issue for const_inherent_unchecked_arith") · #### pub unsafe fn unchecked\_shr(self, rhs: i32) -> i32
🔬This is a nightly-only experimental API. (`unchecked_math` [#85122](https://github.com/rust-lang/rust/issues/85122))
Unchecked shift right. Computes `self >> rhs`, assuming that `rhs` is less than the number of bits in `self`.
##### Safety
This results in undefined behavior if `rhs` is larger than or equal to the number of bits in `self`, i.e. when [`checked_shr`](primitive.i32#method.checked_shr) would return `None`.
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#220-222)1.13.0 (const: 1.47.0) · #### pub const fn checked\_abs(self) -> Option<i32>
Checked absolute value. Computes `self.abs()`, returning `None` if `self == MIN`.
##### Examples
Basic usage:
```
assert_eq!((-5i32).checked_abs(), Some(5));
assert_eq!(i32::MIN.checked_abs(), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#220-222)1.34.0 (const: 1.50.0) · #### pub const fn checked\_pow(self, exp: u32) -> Option<i32>
Checked exponentiation. Computes `self.pow(exp)`, returning `None` if overflow occurred.
##### Examples
Basic usage:
```
assert_eq!(8i32.checked_pow(2), Some(64));
assert_eq!(i32::MAX.checked_pow(2), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#220-222)const: 1.47.0 · #### pub const fn saturating\_add(self, rhs: i32) -> i32
Saturating integer addition. Computes `self + rhs`, saturating at the numeric bounds instead of overflowing.
##### Examples
Basic usage:
```
assert_eq!(100i32.saturating_add(1), 101);
assert_eq!(i32::MAX.saturating_add(100), i32::MAX);
assert_eq!(i32::MIN.saturating_add(-1), i32::MIN);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#220-222)const: [unstable](https://github.com/rust-lang/rust/issues/87840 "Tracking issue for mixed_integer_ops") · #### pub fn saturating\_add\_unsigned(self, rhs: u32) -> i32
🔬This is a nightly-only experimental API. (`mixed_integer_ops` [#87840](https://github.com/rust-lang/rust/issues/87840))
Saturating addition with an unsigned integer. Computes `self + rhs`, saturating at the numeric bounds instead of overflowing.
##### Examples
Basic usage:
```
assert_eq!(1i32.saturating_add_unsigned(2), 3);
assert_eq!(i32::MAX.saturating_add_unsigned(100), i32::MAX);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#220-222)const: 1.47.0 · #### pub const fn saturating\_sub(self, rhs: i32) -> i32
Saturating integer subtraction. Computes `self - rhs`, saturating at the numeric bounds instead of overflowing.
##### Examples
Basic usage:
```
assert_eq!(100i32.saturating_sub(127), -27);
assert_eq!(i32::MIN.saturating_sub(100), i32::MIN);
assert_eq!(i32::MAX.saturating_sub(-1), i32::MAX);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#220-222)const: [unstable](https://github.com/rust-lang/rust/issues/87840 "Tracking issue for mixed_integer_ops") · #### pub fn saturating\_sub\_unsigned(self, rhs: u32) -> i32
🔬This is a nightly-only experimental API. (`mixed_integer_ops` [#87840](https://github.com/rust-lang/rust/issues/87840))
Saturating subtraction with an unsigned integer. Computes `self - rhs`, saturating at the numeric bounds instead of overflowing.
##### Examples
Basic usage:
```
assert_eq!(100i32.saturating_sub_unsigned(127), -27);
assert_eq!(i32::MIN.saturating_sub_unsigned(100), i32::MIN);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#220-222)1.45.0 (const: 1.47.0) · #### pub const fn saturating\_neg(self) -> i32
Saturating integer negation. Computes `-self`, returning `MAX` if `self == MIN` instead of overflowing.
##### Examples
Basic usage:
```
assert_eq!(100i32.saturating_neg(), -100);
assert_eq!((-100i32).saturating_neg(), 100);
assert_eq!(i32::MIN.saturating_neg(), i32::MAX);
assert_eq!(i32::MAX.saturating_neg(), i32::MIN + 1);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#220-222)1.45.0 (const: 1.47.0) · #### pub const fn saturating\_abs(self) -> i32
Saturating absolute value. Computes `self.abs()`, returning `MAX` if `self == MIN` instead of overflowing.
##### Examples
Basic usage:
```
assert_eq!(100i32.saturating_abs(), 100);
assert_eq!((-100i32).saturating_abs(), 100);
assert_eq!(i32::MIN.saturating_abs(), i32::MAX);
assert_eq!((i32::MIN + 1).saturating_abs(), i32::MAX);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#220-222)1.7.0 (const: 1.47.0) · #### pub const fn saturating\_mul(self, rhs: i32) -> i32
Saturating integer multiplication. Computes `self * rhs`, saturating at the numeric bounds instead of overflowing.
##### Examples
Basic usage:
```
assert_eq!(10i32.saturating_mul(12), 120);
assert_eq!(i32::MAX.saturating_mul(10), i32::MAX);
assert_eq!(i32::MIN.saturating_mul(10), i32::MIN);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#220-222)1.58.0 (const: 1.58.0) · #### pub const fn saturating\_div(self, rhs: i32) -> i32
Saturating integer division. Computes `self / rhs`, saturating at the numeric bounds instead of overflowing.
##### Examples
Basic usage:
```
assert_eq!(5i32.saturating_div(2), 2);
assert_eq!(i32::MAX.saturating_div(-1), i32::MIN + 1);
assert_eq!(i32::MIN.saturating_div(-1), i32::MAX);
```
ⓘ
```
let _ = 1i32.saturating_div(0);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#220-222)1.34.0 (const: 1.50.0) · #### pub const fn saturating\_pow(self, exp: u32) -> i32
Saturating integer exponentiation. Computes `self.pow(exp)`, saturating at the numeric bounds instead of overflowing.
##### Examples
Basic usage:
```
assert_eq!((-4i32).saturating_pow(3), -64);
assert_eq!(i32::MIN.saturating_pow(2), i32::MAX);
assert_eq!(i32::MIN.saturating_pow(3), i32::MIN);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#220-222)const: 1.32.0 · #### pub const fn wrapping\_add(self, rhs: i32) -> i32
Wrapping (modular) addition. Computes `self + rhs`, wrapping around at the boundary of the type.
##### Examples
Basic usage:
```
assert_eq!(100i32.wrapping_add(27), 127);
assert_eq!(i32::MAX.wrapping_add(2), i32::MIN + 1);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#220-222)const: [unstable](https://github.com/rust-lang/rust/issues/87840 "Tracking issue for mixed_integer_ops") · #### pub fn wrapping\_add\_unsigned(self, rhs: u32) -> i32
🔬This is a nightly-only experimental API. (`mixed_integer_ops` [#87840](https://github.com/rust-lang/rust/issues/87840))
Wrapping (modular) addition with an unsigned integer. Computes `self + rhs`, wrapping around at the boundary of the type.
##### Examples
Basic usage:
```
assert_eq!(100i32.wrapping_add_unsigned(27), 127);
assert_eq!(i32::MAX.wrapping_add_unsigned(2), i32::MIN + 1);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#220-222)const: 1.32.0 · #### pub const fn wrapping\_sub(self, rhs: i32) -> i32
Wrapping (modular) subtraction. Computes `self - rhs`, wrapping around at the boundary of the type.
##### Examples
Basic usage:
```
assert_eq!(0i32.wrapping_sub(127), -127);
assert_eq!((-2i32).wrapping_sub(i32::MAX), i32::MAX);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#220-222)const: [unstable](https://github.com/rust-lang/rust/issues/87840 "Tracking issue for mixed_integer_ops") · #### pub fn wrapping\_sub\_unsigned(self, rhs: u32) -> i32
🔬This is a nightly-only experimental API. (`mixed_integer_ops` [#87840](https://github.com/rust-lang/rust/issues/87840))
Wrapping (modular) subtraction with an unsigned integer. Computes `self - rhs`, wrapping around at the boundary of the type.
##### Examples
Basic usage:
```
assert_eq!(0i32.wrapping_sub_unsigned(127), -127);
assert_eq!((-2i32).wrapping_sub_unsigned(u32::MAX), -1);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#220-222)const: 1.32.0 · #### pub const fn wrapping\_mul(self, rhs: i32) -> i32
Wrapping (modular) multiplication. Computes `self * rhs`, wrapping around at the boundary of the type.
##### Examples
Basic usage:
```
assert_eq!(10i32.wrapping_mul(12), 120);
assert_eq!(11i8.wrapping_mul(12), -124);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#220-222)1.2.0 (const: 1.52.0) · #### pub const fn wrapping\_div(self, rhs: i32) -> i32
Wrapping (modular) division. Computes `self / rhs`, wrapping around at the boundary of the type.
The only case where such wrapping can occur is when one divides `MIN / -1` on a signed type (where `MIN` is the negative minimal value for the type); this is equivalent to `-MIN`, a positive value that is too large to represent in the type. In such a case, this function returns `MIN` itself.
##### Panics
This function will panic if `rhs` is 0.
##### Examples
Basic usage:
```
assert_eq!(100i32.wrapping_div(10), 10);
assert_eq!((-128i8).wrapping_div(-1), -128);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#220-222)1.38.0 (const: 1.52.0) · #### pub const fn wrapping\_div\_euclid(self, rhs: i32) -> i32
Wrapping Euclidean division. Computes `self.div_euclid(rhs)`, wrapping around at the boundary of the type.
Wrapping will only occur in `MIN / -1` on a signed type (where `MIN` is the negative minimal value for the type). This is equivalent to `-MIN`, a positive value that is too large to represent in the type. In this case, this method returns `MIN` itself.
##### Panics
This function will panic if `rhs` is 0.
##### Examples
Basic usage:
```
assert_eq!(100i32.wrapping_div_euclid(10), 10);
assert_eq!((-128i8).wrapping_div_euclid(-1), -128);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#220-222)1.2.0 (const: 1.52.0) · #### pub const fn wrapping\_rem(self, rhs: i32) -> i32
Wrapping (modular) remainder. Computes `self % rhs`, wrapping around at the boundary of the type.
Such wrap-around never actually occurs mathematically; implementation artifacts make `x % y` invalid for `MIN / -1` on a signed type (where `MIN` is the negative minimal value). In such a case, this function returns `0`.
##### Panics
This function will panic if `rhs` is 0.
##### Examples
Basic usage:
```
assert_eq!(100i32.wrapping_rem(10), 0);
assert_eq!((-128i8).wrapping_rem(-1), 0);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#220-222)1.38.0 (const: 1.52.0) · #### pub const fn wrapping\_rem\_euclid(self, rhs: i32) -> i32
Wrapping Euclidean remainder. Computes `self.rem_euclid(rhs)`, wrapping around at the boundary of the type.
Wrapping will only occur in `MIN % -1` on a signed type (where `MIN` is the negative minimal value for the type). In this case, this method returns 0.
##### Panics
This function will panic if `rhs` is 0.
##### Examples
Basic usage:
```
assert_eq!(100i32.wrapping_rem_euclid(10), 0);
assert_eq!((-128i8).wrapping_rem_euclid(-1), 0);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#220-222)1.2.0 (const: 1.32.0) · #### pub const fn wrapping\_neg(self) -> i32
Wrapping (modular) negation. Computes `-self`, wrapping around at the boundary of the type.
The only case where such wrapping can occur is when one negates `MIN` on a signed type (where `MIN` is 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:
```
assert_eq!(100i32.wrapping_neg(), -100);
assert_eq!(i32::MIN.wrapping_neg(), i32::MIN);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#220-222)1.2.0 (const: 1.32.0) · #### pub const fn wrapping\_shl(self, rhs: u32) -> i32
Panic-free bitwise shift-left; yields `self << mask(rhs)`, where `mask` removes any high-order bits of `rhs` that would cause the shift to exceed the bitwidth of the type.
Note that this is *not* the same as a rotate-left; the RHS of a wrapping shift-left is restricted to the range of the type, rather than the bits shifted out of the LHS being returned to the other end. The primitive integer types all implement a [`rotate_left`](primitive.i32#method.rotate_left) function, which may be what you want instead.
##### Examples
Basic usage:
```
assert_eq!((-1i32).wrapping_shl(7), -128);
assert_eq!((-1i32).wrapping_shl(128), -1);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#220-222)1.2.0 (const: 1.32.0) · #### pub const fn wrapping\_shr(self, rhs: u32) -> i32
Panic-free bitwise shift-right; yields `self >> mask(rhs)`, where `mask` removes any high-order bits of `rhs` that would cause the shift to exceed the bitwidth of the type.
Note that this is *not* the same as a rotate-right; the RHS of a wrapping shift-right is restricted to the range of the type, rather than the bits shifted out of the LHS being returned to the other end. The primitive integer types all implement a [`rotate_right`](primitive.i32#method.rotate_right) function, which may be what you want instead.
##### Examples
Basic usage:
```
assert_eq!((-128i32).wrapping_shr(7), -1);
assert_eq!((-128i16).wrapping_shr(64), -128);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#220-222)1.13.0 (const: 1.32.0) · #### pub const fn wrapping\_abs(self) -> i32
Wrapping (modular) absolute value. Computes `self.abs()`, 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:
```
assert_eq!(100i32.wrapping_abs(), 100);
assert_eq!((-100i32).wrapping_abs(), 100);
assert_eq!(i32::MIN.wrapping_abs(), i32::MIN);
assert_eq!((-128i8).wrapping_abs() as u8, 128);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#220-222)1.51.0 (const: 1.51.0) · #### pub const fn unsigned\_abs(self) -> u32
Computes the absolute value of `self` without any wrapping or panicking.
##### Examples
Basic usage:
```
assert_eq!(100i32.unsigned_abs(), 100u32);
assert_eq!((-100i32).unsigned_abs(), 100u32);
assert_eq!((-128i8).unsigned_abs(), 128u8);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#220-222)1.34.0 (const: 1.50.0) · #### pub const fn wrapping\_pow(self, exp: u32) -> i32
Wrapping (modular) exponentiation. Computes `self.pow(exp)`, wrapping around at the boundary of the type.
##### Examples
Basic usage:
```
assert_eq!(3i32.wrapping_pow(4), 81);
assert_eq!(3i8.wrapping_pow(5), -13);
assert_eq!(3i8.wrapping_pow(6), -39);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#220-222)1.7.0 (const: 1.32.0) · #### pub const fn overflowing\_add(self, rhs: i32) -> (i32, bool)
Calculates `self` + `rhs`
Returns a tuple of the addition along with a boolean indicating whether an arithmetic overflow would occur. If an overflow would have occurred then the wrapped value is returned.
##### Examples
Basic usage:
```
assert_eq!(5i32.overflowing_add(2), (7, false));
assert_eq!(i32::MAX.overflowing_add(1), (i32::MIN, true));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#220-222)const: [unstable](https://github.com/rust-lang/rust/issues/85532 "Tracking issue for const_bigint_helper_methods") · #### pub fn carrying\_add(self, rhs: i32, carry: bool) -> (i32, bool)
🔬This is a nightly-only experimental API. (`bigint_helper_methods` [#85532](https://github.com/rust-lang/rust/issues/85532))
Calculates `self + rhs + carry` without the ability to overflow.
Performs “signed ternary addition” which takes in an extra bit to add, and may return an additional bit of overflow. This signed function is used only on the highest-ordered data, for which the signed overflow result indicates whether the big integer overflowed or not.
##### Examples
Basic usage:
```
#![feature(bigint_helper_methods)]
assert_eq!(5i32.carrying_add(2, false), (7, false));
assert_eq!(5i32.carrying_add(2, true), (8, false));
assert_eq!(i32::MAX.carrying_add(1, false), (i32::MIN, true));
assert_eq!(i32::MAX.carrying_add(0, true), (i32::MIN, true));
assert_eq!(i32::MAX.carrying_add(1, true), (i32::MIN + 1, true));
assert_eq!(i32::MAX.carrying_add(i32::MAX, true), (-1, true));
assert_eq!(i32::MIN.carrying_add(-1, true), (i32::MIN, false));
assert_eq!(0i32.carrying_add(i32::MAX, true), (i32::MIN, true));
```
If `carry` is false, this method is equivalent to [`overflowing_add`](primitive.i32#method.overflowing_add):
```
#![feature(bigint_helper_methods)]
assert_eq!(5_i32.carrying_add(2, false), 5_i32.overflowing_add(2));
assert_eq!(i32::MAX.carrying_add(1, false), i32::MAX.overflowing_add(1));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#220-222)const: [unstable](https://github.com/rust-lang/rust/issues/87840 "Tracking issue for mixed_integer_ops") · #### pub fn overflowing\_add\_unsigned(self, rhs: u32) -> (i32, bool)
🔬This is a nightly-only experimental API. (`mixed_integer_ops` [#87840](https://github.com/rust-lang/rust/issues/87840))
Calculates `self` + `rhs` with an unsigned `rhs`
Returns a tuple of the addition along with a boolean indicating whether an arithmetic overflow would occur. If an overflow would have occurred then the wrapped value is returned.
##### Examples
Basic usage:
```
assert_eq!(1i32.overflowing_add_unsigned(2), (3, false));
assert_eq!((i32::MIN).overflowing_add_unsigned(u32::MAX), (i32::MAX, false));
assert_eq!((i32::MAX - 2).overflowing_add_unsigned(3), (i32::MIN, true));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#220-222)1.7.0 (const: 1.32.0) · #### pub const fn overflowing\_sub(self, rhs: i32) -> (i32, bool)
Calculates `self` - `rhs`
Returns a tuple of the subtraction along with a boolean indicating whether an arithmetic overflow would occur. If an overflow would have occurred then the wrapped value is returned.
##### Examples
Basic usage:
```
assert_eq!(5i32.overflowing_sub(2), (3, false));
assert_eq!(i32::MIN.overflowing_sub(1), (i32::MAX, true));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#220-222)const: [unstable](https://github.com/rust-lang/rust/issues/85532 "Tracking issue for const_bigint_helper_methods") · #### pub fn borrowing\_sub(self, rhs: i32, borrow: bool) -> (i32, bool)
🔬This is a nightly-only experimental API. (`bigint_helper_methods` [#85532](https://github.com/rust-lang/rust/issues/85532))
Calculates `self - rhs - borrow` without the ability to overflow.
Performs “signed ternary subtraction” which takes in an extra bit to subtract, and may return an additional bit of overflow. This signed function is used only on the highest-ordered data, for which the signed overflow result indicates whether the big integer overflowed or not.
##### Examples
Basic usage:
```
#![feature(bigint_helper_methods)]
assert_eq!(5i32.borrowing_sub(2, false), (3, false));
assert_eq!(5i32.borrowing_sub(2, true), (2, false));
assert_eq!(0i32.borrowing_sub(1, false), (-1, false));
assert_eq!(0i32.borrowing_sub(1, true), (-2, false));
assert_eq!(i32::MIN.borrowing_sub(1, true), (i32::MAX - 1, true));
assert_eq!(i32::MAX.borrowing_sub(-1, false), (i32::MIN, true));
assert_eq!(i32::MAX.borrowing_sub(-1, true), (i32::MAX, false));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#220-222)const: [unstable](https://github.com/rust-lang/rust/issues/87840 "Tracking issue for mixed_integer_ops") · #### pub fn overflowing\_sub\_unsigned(self, rhs: u32) -> (i32, bool)
🔬This is a nightly-only experimental API. (`mixed_integer_ops` [#87840](https://github.com/rust-lang/rust/issues/87840))
Calculates `self` - `rhs` with an unsigned `rhs`
Returns a tuple of the subtraction along with a boolean indicating whether an arithmetic overflow would occur. If an overflow would have occurred then the wrapped value is returned.
##### Examples
Basic usage:
```
assert_eq!(1i32.overflowing_sub_unsigned(2), (-1, false));
assert_eq!((i32::MAX).overflowing_sub_unsigned(u32::MAX), (i32::MIN, false));
assert_eq!((i32::MIN + 2).overflowing_sub_unsigned(3), (i32::MAX, true));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#220-222)1.7.0 (const: 1.32.0) · #### pub const fn overflowing\_mul(self, rhs: i32) -> (i32, bool)
Calculates the multiplication of `self` and `rhs`.
Returns a tuple of the multiplication along with a boolean indicating whether an arithmetic overflow would occur. If an overflow would have occurred then the wrapped value is returned.
##### Examples
Basic usage:
```
assert_eq!(5i32.overflowing_mul(2), (10, false));
assert_eq!(1_000_000_000i32.overflowing_mul(10), (1410065408, true));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#220-222)1.7.0 (const: 1.52.0) · #### pub const fn overflowing\_div(self, rhs: i32) -> (i32, bool)
Calculates the divisor when `self` is divided by `rhs`.
Returns a tuple of the divisor along with a boolean indicating whether an arithmetic overflow would occur. If an overflow would occur then self is returned.
##### Panics
This function will panic if `rhs` is 0.
##### Examples
Basic usage:
```
assert_eq!(5i32.overflowing_div(2), (2, false));
assert_eq!(i32::MIN.overflowing_div(-1), (i32::MIN, true));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#220-222)1.38.0 (const: 1.52.0) · #### pub const fn overflowing\_div\_euclid(self, rhs: i32) -> (i32, bool)
Calculates the quotient of Euclidean division `self.div_euclid(rhs)`.
Returns a tuple of the divisor along with a boolean indicating whether an arithmetic overflow would occur. If an overflow would occur then `self` is returned.
##### Panics
This function will panic if `rhs` is 0.
##### Examples
Basic usage:
```
assert_eq!(5i32.overflowing_div_euclid(2), (2, false));
assert_eq!(i32::MIN.overflowing_div_euclid(-1), (i32::MIN, true));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#220-222)1.7.0 (const: 1.52.0) · #### pub const fn overflowing\_rem(self, rhs: i32) -> (i32, bool)
Calculates the remainder when `self` is divided by `rhs`.
Returns a tuple of the remainder after dividing along with a boolean indicating whether an arithmetic overflow would occur. If an overflow would occur then 0 is returned.
##### Panics
This function will panic if `rhs` is 0.
##### Examples
Basic usage:
```
assert_eq!(5i32.overflowing_rem(2), (1, false));
assert_eq!(i32::MIN.overflowing_rem(-1), (0, true));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#220-222)1.38.0 (const: 1.52.0) · #### pub const fn overflowing\_rem\_euclid(self, rhs: i32) -> (i32, bool)
Overflowing Euclidean remainder. Calculates `self.rem_euclid(rhs)`.
Returns a tuple of the remainder after dividing along with a boolean indicating whether an arithmetic overflow would occur. If an overflow would occur then 0 is returned.
##### Panics
This function will panic if `rhs` is 0.
##### Examples
Basic usage:
```
assert_eq!(5i32.overflowing_rem_euclid(2), (1, false));
assert_eq!(i32::MIN.overflowing_rem_euclid(-1), (0, true));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#220-222)1.7.0 (const: 1.32.0) · #### pub const fn overflowing\_neg(self) -> (i32, bool)
Negates self, overflowing if this is equal to the minimum value.
Returns a tuple of the negated version of self along with a boolean indicating whether an overflow happened. If `self` is the minimum value (e.g., `i32::MIN` for values of type `i32`), then the minimum value will be returned again and `true` will be returned for an overflow happening.
##### Examples
Basic usage:
```
assert_eq!(2i32.overflowing_neg(), (-2, false));
assert_eq!(i32::MIN.overflowing_neg(), (i32::MIN, true));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#220-222)1.7.0 (const: 1.32.0) · #### pub const fn overflowing\_shl(self, rhs: u32) -> (i32, bool)
Shifts self left by `rhs` bits.
Returns a tuple of the shifted version of self along with a boolean indicating whether the shift value was larger than or equal to the number of bits. If the shift value is too large, then value is masked (N-1) where N is the number of bits, and this value is then used to perform the shift.
##### Examples
Basic usage:
```
assert_eq!(0x1i32.overflowing_shl(4), (0x10, false));
assert_eq!(0x1i32.overflowing_shl(36), (0x10, true));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#220-222)1.7.0 (const: 1.32.0) · #### pub const fn overflowing\_shr(self, rhs: u32) -> (i32, bool)
Shifts self right by `rhs` bits.
Returns a tuple of the shifted version of self along with a boolean indicating whether the shift value was larger than or equal to the number of bits. If the shift value is too large, then value is masked (N-1) where N is the number of bits, and this value is then used to perform the shift.
##### Examples
Basic usage:
```
assert_eq!(0x10i32.overflowing_shr(4), (0x1, false));
assert_eq!(0x10i32.overflowing_shr(36), (0x1, true));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#220-222)1.13.0 (const: 1.32.0) · #### pub const fn overflowing\_abs(self) -> (i32, bool)
Computes the absolute value of `self`.
Returns a tuple of the absolute version of self along with a boolean indicating whether an overflow happened. If self is the minimum value (e.g., i32::MIN for values of type i32), then the minimum value will be returned again and true will be returned for an overflow happening.
##### Examples
Basic usage:
```
assert_eq!(10i32.overflowing_abs(), (10, false));
assert_eq!((-10i32).overflowing_abs(), (10, false));
assert_eq!((i32::MIN).overflowing_abs(), (i32::MIN, true));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#220-222)1.34.0 (const: 1.50.0) · #### pub const fn overflowing\_pow(self, exp: u32) -> (i32, bool)
Raises self to the power of `exp`, using exponentiation by squaring.
Returns a tuple of the exponentiation along with a bool indicating whether an overflow happened.
##### Examples
Basic usage:
```
assert_eq!(3i32.overflowing_pow(4), (81, false));
assert_eq!(3i8.overflowing_pow(5), (-13, true));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#220-222)const: 1.50.0 · #### pub const fn pow(self, exp: u32) -> i32
Raises self to the power of `exp`, using exponentiation by squaring.
##### Examples
Basic usage:
```
let x: i32 = 2; // or any other integer type
assert_eq!(x.pow(5), 32);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#220-222)1.38.0 (const: 1.52.0) · #### pub const fn div\_euclid(self, rhs: i32) -> i32
Calculates the quotient of Euclidean division of `self` by `rhs`.
This computes the integer `q` such that `self = q * rhs + r`, with `r = self.rem_euclid(rhs)` and `0 <= r < abs(rhs)`.
In other words, the result is `self / rhs` rounded to the integer `q` such that `self >= q * rhs`. If `self > 0`, this is equal to round towards zero (the default in Rust); if `self < 0`, this is equal to round towards +/- infinity.
##### Panics
This function will panic if `rhs` is 0 or the division results in overflow.
##### Examples
Basic usage:
```
let a: i32 = 7; // or any other integer type
let b = 4;
assert_eq!(a.div_euclid(b), 1); // 7 >= 4 * 1
assert_eq!(a.div_euclid(-b), -1); // 7 >= -4 * -1
assert_eq!((-a).div_euclid(b), -2); // -7 >= 4 * -2
assert_eq!((-a).div_euclid(-b), 2); // -7 >= -4 * 2
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#220-222)1.38.0 (const: 1.52.0) · #### pub const fn rem\_euclid(self, rhs: i32) -> i32
Calculates the least nonnegative remainder of `self (mod rhs)`.
This is done as if by the Euclidean division algorithm – given `r = self.rem_euclid(rhs)`, `self = rhs * self.div_euclid(rhs) + r`, and `0 <= r < abs(rhs)`.
##### Panics
This function will panic if `rhs` is 0 or the division results in overflow.
##### Examples
Basic usage:
```
let a: i32 = 7; // or any other integer type
let b = 4;
assert_eq!(a.rem_euclid(b), 3);
assert_eq!((-a).rem_euclid(b), 1);
assert_eq!(a.rem_euclid(-b), 3);
assert_eq!((-a).rem_euclid(-b), 1);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#220-222)#### pub const fn div\_floor(self, rhs: i32) -> i32
🔬This is a nightly-only experimental API. (`int_roundings` [#88581](https://github.com/rust-lang/rust/issues/88581))
Calculates the quotient of `self` and `rhs`, rounding the result towards negative infinity.
##### Panics
This function will panic if `rhs` is zero.
###### [Overflow behavior](#overflow-behavior)
On overflow, this function will panic if overflow checks are enabled (default in debug mode) and wrap if overflow checks are disabled (default in release mode).
##### Examples
Basic usage:
```
#![feature(int_roundings)]
let a: i32 = 8;
let b = 3;
assert_eq!(a.div_floor(b), 2);
assert_eq!(a.div_floor(-b), -3);
assert_eq!((-a).div_floor(b), -3);
assert_eq!((-a).div_floor(-b), 2);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#220-222)#### pub const fn div\_ceil(self, rhs: i32) -> i32
🔬This is a nightly-only experimental API. (`int_roundings` [#88581](https://github.com/rust-lang/rust/issues/88581))
Calculates the quotient of `self` and `rhs`, rounding the result towards positive infinity.
##### Panics
This function will panic if `rhs` is zero.
###### [Overflow behavior](#overflow-behavior-1)
On overflow, this function will panic if overflow checks are enabled (default in debug mode) and wrap if overflow checks are disabled (default in release mode).
##### Examples
Basic usage:
```
#![feature(int_roundings)]
let a: i32 = 8;
let b = 3;
assert_eq!(a.div_ceil(b), 3);
assert_eq!(a.div_ceil(-b), -2);
assert_eq!((-a).div_ceil(b), -2);
assert_eq!((-a).div_ceil(-b), 3);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#220-222)#### pub const fn next\_multiple\_of(self, rhs: i32) -> i32
🔬This is a nightly-only experimental API. (`int_roundings` [#88581](https://github.com/rust-lang/rust/issues/88581))
If `rhs` is positive, calculates the smallest value greater than or equal to `self` that is a multiple of `rhs`. If `rhs` is negative, calculates the largest value less than or equal to `self` that is a multiple of `rhs`.
##### Panics
This function will panic if `rhs` is zero.
###### [Overflow behavior](#overflow-behavior-2)
On overflow, this function will panic if overflow checks are enabled (default in debug mode) and wrap if overflow checks are disabled (default in release mode).
##### Examples
Basic usage:
```
#![feature(int_roundings)]
assert_eq!(16_i32.next_multiple_of(8), 16);
assert_eq!(23_i32.next_multiple_of(8), 24);
assert_eq!(16_i32.next_multiple_of(-8), 16);
assert_eq!(23_i32.next_multiple_of(-8), 16);
assert_eq!((-16_i32).next_multiple_of(8), -16);
assert_eq!((-23_i32).next_multiple_of(8), -16);
assert_eq!((-16_i32).next_multiple_of(-8), -16);
assert_eq!((-23_i32).next_multiple_of(-8), -24);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#220-222)#### pub const fn checked\_next\_multiple\_of(self, rhs: i32) -> Option<i32>
🔬This is a nightly-only experimental API. (`int_roundings` [#88581](https://github.com/rust-lang/rust/issues/88581))
If `rhs` is positive, calculates the smallest value greater than or equal to `self` that is a multiple of `rhs`. If `rhs` is negative, calculates the largest value less than or equal to `self` that is a multiple of `rhs`. Returns `None` if `rhs` is zero or the operation would result in overflow.
##### Examples
Basic usage:
```
#![feature(int_roundings)]
assert_eq!(16_i32.checked_next_multiple_of(8), Some(16));
assert_eq!(23_i32.checked_next_multiple_of(8), Some(24));
assert_eq!(16_i32.checked_next_multiple_of(-8), Some(16));
assert_eq!(23_i32.checked_next_multiple_of(-8), Some(16));
assert_eq!((-16_i32).checked_next_multiple_of(8), Some(-16));
assert_eq!((-23_i32).checked_next_multiple_of(8), Some(-16));
assert_eq!((-16_i32).checked_next_multiple_of(-8), Some(-16));
assert_eq!((-23_i32).checked_next_multiple_of(-8), Some(-24));
assert_eq!(1_i32.checked_next_multiple_of(0), None);
assert_eq!(i32::MAX.checked_next_multiple_of(2), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#220-222)#### pub const fn ilog(self, base: i32) -> u32
🔬This is a nightly-only experimental API. (`int_log` [#70887](https://github.com/rust-lang/rust/issues/70887))
Returns the logarithm of the number with respect to an arbitrary base, rounded down.
This method might not be optimized owing to implementation details; `ilog2` can produce results more efficiently for base 2, and `ilog10` can produce results more efficiently for base 10.
##### Panics
When the number is negative, zero, or if the base is not at least 2; it panics in debug mode and the return value is 0 in release mode.
##### Examples
```
#![feature(int_log)]
assert_eq!(5i32.ilog(5), 1);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#220-222)#### 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.
##### Panics
When the number is negative or zero it panics in debug mode and the return value is 0 in release mode.
##### Examples
```
#![feature(int_log)]
assert_eq!(2i32.ilog2(), 1);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#220-222)#### 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.
##### Panics
When the number is negative or zero it panics in debug mode and the return value is 0 in release mode.
##### Example
```
#![feature(int_log)]
assert_eq!(10i32.ilog10(), 1);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#220-222)#### pub const fn checked\_ilog(self, base: i32) -> Option<u32>
🔬This is a nightly-only experimental API. (`int_log` [#70887](https://github.com/rust-lang/rust/issues/70887))
Returns the logarithm of the number with respect to an arbitrary base, rounded down.
Returns `None` if the number is negative or zero, or if the base is not at least 2.
This method might not be optimized owing to implementation details; `checked_ilog2` can produce results more efficiently for base 2, and `checked_ilog10` can produce results more efficiently for base 10.
##### Examples
```
#![feature(int_log)]
assert_eq!(5i32.checked_ilog(5), Some(1));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#220-222)#### pub const fn checked\_ilog2(self) -> Option<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.
Returns `None` if the number is negative or zero.
##### Examples
```
#![feature(int_log)]
assert_eq!(2i32.checked_ilog2(), Some(1));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#220-222)#### pub const fn checked\_ilog10(self) -> Option<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.
Returns `None` if the number is negative or zero.
##### Example
```
#![feature(int_log)]
assert_eq!(10i32.checked_ilog10(), Some(1));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#220-222)const: 1.32.0 · #### pub const fn abs(self) -> i32
Computes the absolute value of `self`.
##### Overflow behavior
The absolute value of `i32::MIN` cannot be represented as an `i32`, and attempting to calculate it will cause an overflow. This means that code in debug mode will trigger a panic on this case and optimized code will return `i32::MIN` without a panic.
##### Examples
Basic usage:
```
assert_eq!(10i32.abs(), 10);
assert_eq!((-10i32).abs(), 10);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#220-222)1.60.0 (const: 1.60.0) · #### pub const fn abs\_diff(self, other: i32) -> u32
Computes the absolute difference between `self` and `other`.
This function always returns the correct answer without overflow or panics by returning an unsigned integer.
##### Examples
Basic usage:
```
assert_eq!(100i32.abs_diff(80), 20u32);
assert_eq!(100i32.abs_diff(110), 10u32);
assert_eq!((-100i32).abs_diff(80), 180u32);
assert_eq!((-100i32).abs_diff(-120), 20u32);
assert_eq!(i32::MIN.abs_diff(i32::MAX), u32::MAX);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#220-222)const: 1.47.0 · #### pub const fn signum(self) -> i32
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:
```
assert_eq!(10i32.signum(), 1);
assert_eq!(0i32.signum(), 0);
assert_eq!((-10i32).signum(), -1);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#220-222)const: 1.32.0 · #### pub const fn is\_positive(self) -> bool
Returns `true` if `self` is positive and `false` if the number is zero or negative.
##### Examples
Basic usage:
```
assert!(10i32.is_positive());
assert!(!(-10i32).is_positive());
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#220-222)const: 1.32.0 · #### pub const fn is\_negative(self) -> bool
Returns `true` if `self` is negative and `false` if the number is zero or positive.
##### Examples
Basic usage:
```
assert!((-10i32).is_negative());
assert!(!10i32.is_negative());
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#220-222)1.32.0 (const: 1.44.0) · #### pub const fn to\_be\_bytes(self) -> [u8; 4]
Return the memory representation of this integer as a byte array in big-endian (network) byte order.
##### Examples
```
let bytes = 0x12345678i32.to_be_bytes();
assert_eq!(bytes, [0x12, 0x34, 0x56, 0x78]);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#220-222)1.32.0 (const: 1.44.0) · #### pub const fn to\_le\_bytes(self) -> [u8; 4]
Return the memory representation of this integer as a byte array in little-endian byte order.
##### Examples
```
let bytes = 0x12345678i32.to_le_bytes();
assert_eq!(bytes, [0x78, 0x56, 0x34, 0x12]);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#220-222)1.32.0 (const: 1.44.0) · #### pub const fn to\_ne\_bytes(self) -> [u8; 4]
Return the memory representation of this integer as a byte array in native byte order.
As the target platform’s native endianness is used, portable code should use [`to_be_bytes`](primitive.i32#method.to_be_bytes) or [`to_le_bytes`](primitive.i32#method.to_le_bytes), as appropriate, instead.
##### Examples
```
let bytes = 0x12345678i32.to_ne_bytes();
assert_eq!(
bytes,
if cfg!(target_endian = "big") {
[0x12, 0x34, 0x56, 0x78]
} else {
[0x78, 0x56, 0x34, 0x12]
}
);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#220-222)1.32.0 (const: 1.44.0) · #### pub const fn from\_be\_bytes(bytes: [u8; 4]) -> i32
Create an integer value from its representation as a byte array in big endian.
##### Examples
```
let value = i32::from_be_bytes([0x12, 0x34, 0x56, 0x78]);
assert_eq!(value, 0x12345678);
```
When starting from a slice rather than an array, fallible conversion APIs can be used:
```
fn read_be_i32(input: &mut &[u8]) -> i32 {
let (int_bytes, rest) = input.split_at(std::mem::size_of::<i32>());
*input = rest;
i32::from_be_bytes(int_bytes.try_into().unwrap())
}
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#220-222)1.32.0 (const: 1.44.0) · #### pub const fn from\_le\_bytes(bytes: [u8; 4]) -> i32
Create an integer value from its representation as a byte array in little endian.
##### Examples
```
let value = i32::from_le_bytes([0x78, 0x56, 0x34, 0x12]);
assert_eq!(value, 0x12345678);
```
When starting from a slice rather than an array, fallible conversion APIs can be used:
```
fn read_le_i32(input: &mut &[u8]) -> i32 {
let (int_bytes, rest) = input.split_at(std::mem::size_of::<i32>());
*input = rest;
i32::from_le_bytes(int_bytes.try_into().unwrap())
}
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#220-222)1.32.0 (const: 1.44.0) · #### pub const fn from\_ne\_bytes(bytes: [u8; 4]) -> i32
Create an integer value from its memory representation as a byte array in native endianness.
As the target platform’s native endianness is used, portable code likely wants to use [`from_be_bytes`](primitive.i32#method.from_be_bytes) or [`from_le_bytes`](primitive.i32#method.from_le_bytes), as appropriate instead.
##### Examples
```
let value = i32::from_ne_bytes(if cfg!(target_endian = "big") {
[0x12, 0x34, 0x56, 0x78]
} else {
[0x78, 0x56, 0x34, 0x12]
});
assert_eq!(value, 0x12345678);
```
When starting from a slice rather than an array, fallible conversion APIs can be used:
```
fn read_ne_i32(input: &mut &[u8]) -> i32 {
let (int_bytes, rest) = input.split_at(std::mem::size_of::<i32>());
*input = rest;
i32::from_ne_bytes(int_bytes.try_into().unwrap())
}
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#220-222)const: 1.32.0 · #### pub const fn min\_value() -> i32
👎Deprecating in a future Rust version: replaced by the `MIN` associated constant on this type
New code should prefer to use [`i32::MIN`](primitive.i32#associatedconstant.MIN "i32::MIN") instead.
Returns the smallest value that can be represented by this integer type.
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#220-222)const: 1.32.0 · #### pub const fn max\_value() -> i32
👎Deprecating in a future Rust version: replaced by the `MAX` associated constant on this type
New code should prefer to use [`i32::MAX`](primitive.i32#associatedconstant.MAX "i32::MAX") instead.
Returns the largest value that can be represented by this integer type.
Trait Implementations
---------------------
[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
The resulting type after applying the `+` operator.
[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") · #### fn add(self, other: &i32) -> <i32 as Add<i32>>::Output
Performs the `+` operation. [Read more](ops/trait.add#tymethod.add)
[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
The resulting type after applying the `+` operator.
[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") · #### fn add(self, other: &i32) -> <i32 as Add<i32>>::Output
Performs the `+` operation. [Read more](ops/trait.add#tymethod.add)
[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
The resulting type after applying the `+` operator.
[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") · #### fn add(self, other: i32) -> <i32 as Add<i32>>::Output
Performs the `+` operation. [Read more](ops/trait.add#tymethod.add)
[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
The resulting type after applying the `+` operator.
[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") · #### fn add(self, other: i32) -> i32
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<&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/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/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/ops/arith.rs.html#786)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/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/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/ops/arith.rs.html#786)1.8.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/ops/arith.rs.html#786)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/fmt/num.rs.html#177)### impl Binary for i32
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#177)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error>
Formats the value using the given formatter.
[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
The resulting type after applying the `&` operator.
[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") · #### fn bitand(self, other: &i32) -> <i32 as BitAnd<i32>>::Output
Performs the `&` operation. [Read more](ops/trait.bitand#tymethod.bitand)
[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
The resulting type after applying the `&` operator.
[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") · #### fn bitand(self, other: &i32) -> <i32 as BitAnd<i32>>::Output
Performs the `&` operation. [Read more](ops/trait.bitand#tymethod.bitand)
[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
The resulting type after applying the `&` operator.
[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") · #### fn bitand(self, other: i32) -> <i32 as BitAnd<i32>>::Output
Performs the `&` operation. [Read more](ops/trait.bitand#tymethod.bitand)
[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
The resulting type after applying the `&` operator.
[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") · #### fn bitand(self, rhs: i32) -> i32
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<&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/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/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/ops/bit.rs.html#734)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/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/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/ops/bit.rs.html#734)1.8.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/ops/bit.rs.html#734)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/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
The resulting type after applying the `|` operator.
[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") · #### fn bitor(self, other: &i32) -> <i32 as BitOr<i32>>::Output
Performs the `|` operation. [Read more](ops/trait.bitor#tymethod.bitor)
[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
The resulting type after applying the `|` operator.
[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") · #### fn bitor(self, other: &i32) -> <i32 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 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/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
The resulting type after applying the `|` operator.
[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") · #### fn bitor(self, other: i32) -> <i32 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 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/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
The resulting type after applying the `|` operator.
[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") · #### fn bitor(self, rhs: i32) -> i32
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<&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/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/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/ops/bit.rs.html#806)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/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/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/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/ops/bit.rs.html#806)1.8.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/ops/bit.rs.html#806)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/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
The resulting type after applying the `^` operator.
[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") · #### fn bitxor(self, other: &i32) -> <i32 as BitXor<i32>>::Output
Performs the `^` operation. [Read more](ops/trait.bitxor#tymethod.bitxor)
[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
The resulting type after applying the `^` operator.
[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") · #### fn bitxor(self, other: &i32) -> <i32 as BitXor<i32>>::Output
Performs the `^` operation. [Read more](ops/trait.bitxor#tymethod.bitxor)
[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
The resulting type after applying the `^` operator.
[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") · #### fn bitxor(self, other: i32) -> <i32 as BitXor<i32>>::Output
Performs the `^` operation. [Read more](ops/trait.bitxor#tymethod.bitxor)
[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
The resulting type after applying the `^` operator.
[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") · #### fn bitxor(self, other: i32) -> i32
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<&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/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/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/ops/bit.rs.html#878)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/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/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/ops/bit.rs.html#878)1.8.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/ops/bit.rs.html#878)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/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") · #### fn clone(&self) -> i32
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/num.rs.html#197-200)### impl Debug for i32
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#197-200)#### 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/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#217)const: [unstable](https://github.com/rust-lang/rust/issues/87864 "Tracking issue for const_default_impls") · #### fn default() -> i32
Returns the default value of `0`
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#461-464)### impl Display for i32
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#461-464)#### 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/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
The resulting type after applying the `/` operator.
[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") · #### fn div(self, other: &i32) -> <i32 as Div<i32>>::Output
Performs the `/` operation. [Read more](ops/trait.div#tymethod.div)
[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
The resulting type after applying the `/` operator.
[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") · #### fn div(self, other: &i32) -> <i32 as Div<i32>>::Output
Performs the `/` operation. [Read more](ops/trait.div#tymethod.div)
[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
The resulting type after applying the `/` operator.
[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") · #### fn div(self, other: i32) -> <i32 as Div<i32>>::Output
Performs the `/` operation. [Read more](ops/trait.div#tymethod.div)
[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
The resulting type after applying the `/` operator.
[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") · #### fn div(self, other: i32) -> i32
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<&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/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/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/ops/arith.rs.html#968)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/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/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/ops/arith.rs.html#968)1.8.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/ops/arith.rs.html#968)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/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#94)1.28.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<bool> for i32
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#94)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: bool) -> i32
Converts a `bool` to a `i32`. The resulting value is `0` for `false` and `1` for `true` values.
##### Examples
```
assert_eq!(i32::from(true), 1);
assert_eq!(i32::from(false), 0);
```
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#118)1.5.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<i16> for i32
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#118)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: i16) -> i32
Converts `i16` to `i32` losslessly.
[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/87852 "Tracking issue for const_num_from_num")) · ### impl From<i32> for AtomicI32
[source](https://doc.rust-lang.org/src/core/sync/atomic.rs.html#2755-2773)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(v: i32) -> AtomicI32
Converts an `i32` into an `AtomicI32`.
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#159)1.6.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<i32> for f64
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#159)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: i32) -> f64
Converts `i32` to `f64` losslessly.
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#122)1.26.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<i32> for i128
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#122)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: i32) -> i128
Converts `i32` to `i128` losslessly.
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#121)1.5.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<i32> for i64
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#121)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: i32) -> i64
Converts `i32` to `i64` losslessly.
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#114)1.5.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<i8> for i32
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#114)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: i8) -> i32
Converts `i8` to `i32` losslessly.
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#130)1.5.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<u16> for i32
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#130)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: u16) -> i32
Converts `u16` to `i32` losslessly.
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#127)1.5.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<u8> for i32
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#127)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: u8) -> i32
Converts `u8` to `i32` losslessly.
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#1018)### impl FromStr for i32
#### type Err = ParseIntError
The associated error which can be returned from parsing.
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#1018)#### fn from\_str(src: &str) -> Result<i32, ParseIntError>
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/hash/mod.rs.html#829-842)### impl Hash for i32
[source](https://doc.rust-lang.org/src/core/hash/mod.rs.html#829-842)#### 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#829-842)#### fn hash\_slice<H>(data: &[i32], 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/fmt/num.rs.html#465-468)1.42.0 · ### impl LowerExp for i32
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#465-468)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error>
Formats the value using the given formatter.
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#177)### impl LowerHex for i32
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#177)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error>
Formats the value using the given formatter.
[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
The resulting type after applying the `*` operator.
[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") · #### fn mul(self, other: &i32) -> <i32 as Mul<i32>>::Output
Performs the `*` operation. [Read more](ops/trait.mul#tymethod.mul)
[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
The resulting type after applying the `*` operator.
[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") · #### fn mul(self, other: &i32) -> <i32 as Mul<i32>>::Output
Performs the `*` operation. [Read more](ops/trait.mul#tymethod.mul)
[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
The resulting type after applying the `*` operator.
[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") · #### fn mul(self, other: i32) -> <i32 as Mul<i32>>::Output
Performs the `*` operation. [Read more](ops/trait.mul#tymethod.mul)
[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
The resulting type after applying the `*` operator.
[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") · #### fn mul(self, other: i32) -> i32
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<&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/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/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/ops/arith.rs.html#911)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/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/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/ops/arith.rs.html#911)1.8.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/ops/arith.rs.html#911)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/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
The resulting type after applying the `-` operator.
[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") · #### fn neg(self) -> <i32 as Neg>::Output
Performs the unary `-` operation. [Read more](ops/trait.neg#tymethod.neg)
[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
The resulting type after applying the `-` operator.
[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") · #### fn neg(self) -> i32
Performs the unary `-` operation. [Read more](ops/trait.neg#tymethod.neg)
[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
The resulting type after applying the `!` operator.
[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") · #### fn not(self) -> <i32 as Not>::Output
Performs the unary `!` operation. [Read more](ops/trait.not#tymethod.not)
[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
The resulting type after applying the `!` operator.
[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") · #### fn not(self) -> i32
Performs the unary `!` operation. [Read more](ops/trait.not#tymethod.not)
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#177)### impl Octal for i32
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#177)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error>
Formats the value using the given formatter.
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1486)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · ### impl Ord for i32
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1486)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · #### fn cmp(&self, other: &i32) -> 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/cmp.rs.html#1366-1368)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · ### impl PartialEq<i32> for i32
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1366-1368)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · #### fn eq(&self, other: &i32) -> 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#1366-1368)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · #### fn ne(&self, other: &i32) -> 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/cmp.rs.html#1486)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · ### impl PartialOrd<i32> for i32
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1486)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · #### fn partial\_cmp(&self, other: &i32) -> 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#1486)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · #### fn lt(&self, other: &i32) -> 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#1486)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · #### fn le(&self, other: &i32) -> 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#1486)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · #### fn ge(&self, other: &i32) -> 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/cmp.rs.html#1486)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · #### fn gt(&self, other: &i32) -> 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/iter/traits/accum.rs.html#141)1.12.0 · ### impl<'a> Product<&'a i32> for i32
[source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)#### fn product<I>(iter: I) -> i32where I: [Iterator](iter/trait.iterator "trait std::iter::Iterator")<Item = &'a [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.12.0 · ### impl Product<i32> for i32
[source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)#### fn product<I>(iter: I) -> i32where I: [Iterator](iter/trait.iterator "trait std::iter::Iterator")<Item = [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/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
The resulting type after applying the `%` operator.
[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") · #### fn rem(self, other: &i32) -> <i32 as Rem<i32>>::Output
Performs the `%` operation. [Read more](ops/trait.rem#tymethod.rem)
[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
The resulting type after applying the `%` operator.
[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") · #### fn rem(self, other: &i32) -> <i32 as Rem<i32>>::Output
Performs the `%` operation. [Read more](ops/trait.rem#tymethod.rem)
[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
The resulting type after applying the `%` operator.
[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") · #### fn rem(self, other: i32) -> <i32 as Rem<i32>>::Output
Performs the `%` operation. [Read more](ops/trait.rem#tymethod.rem)
[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
The resulting type after applying the `%` operator.
[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") · #### fn rem(self, other: i32) -> i32
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<&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/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/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/ops/arith.rs.html#1029)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/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/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/ops/arith.rs.html#1029)1.8.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/ops/arith.rs.html#1029)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/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i128) -> <i32 as Shl<i128>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i128) -> <i32 as Shl<i128>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i16) -> <i32 as Shl<i16>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i16) -> <i32 as Shl<i16>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i32) -> <i128 as Shl<i32>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i32) -> <i16 as Shl<i32>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i32) -> <i32 as Shl<i32>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i32) -> <i64 as Shl<i32>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i32) -> <i8 as Shl<i32>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i32) -> <isize as Shl<i32>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i32) -> <u128 as Shl<i32>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i32) -> <u16 as Shl<i32>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i32) -> <u32 as Shl<i32>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i32) -> <u64 as Shl<i32>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i32) -> <u8 as Shl<i32>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i32) -> <usize as Shl<i32>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i32) -> <i128 as Shl<i32>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i32) -> <i16 as Shl<i32>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i32) -> <i32 as Shl<i32>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i32) -> <i64 as Shl<i32>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i32) -> <i8 as Shl<i32>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i32) -> <isize as Shl<i32>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i32) -> <u128 as Shl<i32>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i32) -> <u16 as Shl<i32>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i32) -> <u32 as Shl<i32>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i32) -> <u64 as Shl<i32>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i32) -> <u8 as Shl<i32>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i32) -> <usize as Shl<i32>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i64) -> <i32 as Shl<i64>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i64) -> <i32 as Shl<i64>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i8) -> <i32 as Shl<i8>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i8) -> <i32 as Shl<i8>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &isize) -> <i32 as Shl<isize>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &isize) -> <i32 as Shl<isize>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u128) -> <i32 as Shl<u128>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u128) -> <i32 as Shl<u128>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u16) -> <i32 as Shl<u16>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u16) -> <i32 as Shl<u16>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u32) -> <i32 as Shl<u32>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u32) -> <i32 as Shl<u32>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u64) -> <i32 as Shl<u64>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u64) -> <i32 as Shl<u64>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u8) -> <i32 as Shl<u8>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u8) -> <i32 as Shl<u8>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &usize) -> <i32 as Shl<usize>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &usize) -> <i32 as Shl<usize>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i128) -> <i32 as Shl<i128>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i128) -> i32
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i16) -> <i32 as Shl<i16>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i16) -> i32
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i32) -> <i128 as Shl<i32>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i32) -> <i16 as Shl<i32>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i32) -> <i32 as Shl<i32>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i32) -> <i64 as Shl<i32>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i32) -> <i8 as Shl<i32>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i32) -> <isize as Shl<i32>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i32) -> <u128 as Shl<i32>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i32) -> <u16 as Shl<i32>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i32) -> <u32 as Shl<i32>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i32) -> <u64 as Shl<i32>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i32) -> <u8 as Shl<i32>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i32) -> <usize as Shl<i32>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i32) -> i128
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i32) -> i16
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i32) -> i32
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i32) -> i64
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i32) -> i8
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i32) -> isize
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i32) -> u128
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i32) -> u16
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i32) -> u32
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i32) -> u64
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i32) -> u8
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i32) -> usize
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i64) -> <i32 as Shl<i64>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i64) -> i32
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i8) -> <i32 as Shl<i8>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i8) -> i32
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: isize) -> <i32 as Shl<isize>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: isize) -> i32
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u128) -> <i32 as Shl<u128>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u128) -> i32
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u16) -> <i32 as Shl<u16>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u16) -> i32
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u32) -> <i32 as Shl<u32>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u32) -> i32
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u64) -> <i32 as Shl<u64>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u64) -> i32
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u8) -> <i32 as Shl<u8>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u8) -> i32
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: usize) -> <i32 as Shl<usize>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: usize) -> i32
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &i128)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &i16)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &i32)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &i32)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &i32)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &i32)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &i32)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &i32)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &i32)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &i32)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &i32)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &i32)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &i32)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &i32)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &i64)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &i8)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &isize)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &u128)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &u16)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &u32)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &u64)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &u8)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)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/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: i128)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: i16)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: i32)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: i32)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: i32)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: i32)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: i32)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: i32)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: i32)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: i32)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: i32)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: i32)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: i32)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: i32)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: i64)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: i8)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: isize)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: u128)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: u16)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: u32)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: u64)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: u8)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)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/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i128) -> <i32 as Shr<i128>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i128) -> <i32 as Shr<i128>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i16) -> <i32 as Shr<i16>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i16) -> <i32 as Shr<i16>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i32) -> <i128 as Shr<i32>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i32) -> <i16 as Shr<i32>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i32) -> <i32 as Shr<i32>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i32) -> <i64 as Shr<i32>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i32) -> <i8 as Shr<i32>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i32) -> <isize as Shr<i32>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i32) -> <u128 as Shr<i32>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i32) -> <u16 as Shr<i32>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i32) -> <u32 as Shr<i32>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i32) -> <u64 as Shr<i32>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i32) -> <u8 as Shr<i32>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i32) -> <usize as Shr<i32>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i32) -> <i128 as Shr<i32>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i32) -> <i16 as Shr<i32>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i32) -> <i32 as Shr<i32>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i32) -> <i64 as Shr<i32>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i32) -> <i8 as Shr<i32>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i32) -> <isize as Shr<i32>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i32) -> <u128 as Shr<i32>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i32) -> <u16 as Shr<i32>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i32) -> <u32 as Shr<i32>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i32) -> <u64 as Shr<i32>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i32) -> <u8 as Shr<i32>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i32) -> <usize as Shr<i32>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i64) -> <i32 as Shr<i64>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i64) -> <i32 as Shr<i64>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i8) -> <i32 as Shr<i8>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i8) -> <i32 as Shr<i8>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &isize) -> <i32 as Shr<isize>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &isize) -> <i32 as Shr<isize>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u128) -> <i32 as Shr<u128>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u128) -> <i32 as Shr<u128>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u16) -> <i32 as Shr<u16>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u16) -> <i32 as Shr<u16>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u32) -> <i32 as Shr<u32>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u32) -> <i32 as Shr<u32>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u64) -> <i32 as Shr<u64>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u64) -> <i32 as Shr<u64>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u8) -> <i32 as Shr<u8>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u8) -> <i32 as Shr<u8>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &usize) -> <i32 as Shr<usize>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &usize) -> <i32 as Shr<usize>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i128) -> <i32 as Shr<i128>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i128) -> i32
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i16) -> <i32 as Shr<i16>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i16) -> i32
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i32) -> <i128 as Shr<i32>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i32) -> <i16 as Shr<i32>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i32) -> <i32 as Shr<i32>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i32) -> <i64 as Shr<i32>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i32) -> <i8 as Shr<i32>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i32) -> <isize as Shr<i32>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i32) -> <u128 as Shr<i32>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i32) -> <u16 as Shr<i32>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i32) -> <u32 as Shr<i32>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i32) -> <u64 as Shr<i32>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i32) -> <u8 as Shr<i32>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i32) -> <usize as Shr<i32>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i32) -> i128
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i32) -> i16
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i32) -> i32
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i32) -> i64
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i32) -> i8
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i32) -> isize
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i32) -> u128
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i32) -> u16
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i32) -> u32
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i32) -> u64
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i32) -> u8
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i32) -> usize
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i64) -> <i32 as Shr<i64>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i64) -> i32
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i8) -> <i32 as Shr<i8>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i8) -> i32
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: isize) -> <i32 as Shr<isize>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: isize) -> i32
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u128) -> <i32 as Shr<u128>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u128) -> i32
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u16) -> <i32 as Shr<u16>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u16) -> i32
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u32) -> <i32 as Shr<u32>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u32) -> i32
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u64) -> <i32 as Shr<u64>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u64) -> i32
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u8) -> <i32 as Shr<u8>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u8) -> i32
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: usize) -> <i32 as Shr<usize>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: usize) -> i32
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &i128)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &i16)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &i32)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &i32)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &i32)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &i32)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &i32)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &i32)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &i32)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &i32)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &i32)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &i32)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &i32)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &i32)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &i64)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &i8)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &isize)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &u128)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &u16)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &u32)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &u64)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &u8)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)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/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: i128)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: i16)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: i32)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: i32)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: i32)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: i32)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: i32)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: i32)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: i32)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: i32)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: i32)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: i32)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: i32)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: i32)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: i64)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: i8)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: isize)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: u128)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: u16)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: u32)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: u64)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: u8)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)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/up/up/portable-simd/crates/core_simd/src/vector.rs.html#712)### impl SimdElement for i32
#### type Mask = i32
🔬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.
[source](https://doc.rust-lang.org/src/core/iter/range.rs.html#391-394)### impl Step for i32
[source](https://doc.rust-lang.org/src/core/iter/range.rs.html#391-394)#### unsafe fn forward\_unchecked(start: i32, n: usize) -> i32
🔬This is a nightly-only experimental API. (`step_trait` [#42168](https://github.com/rust-lang/rust/issues/42168))
Returns the value that would be obtained by taking the *successor* of `self` `count` times. [Read more](iter/trait.step#method.forward_unchecked)
[source](https://doc.rust-lang.org/src/core/iter/range.rs.html#391-394)#### unsafe fn backward\_unchecked(start: i32, n: usize) -> i32
🔬This is a nightly-only experimental API. (`step_trait` [#42168](https://github.com/rust-lang/rust/issues/42168))
Returns the value that would be obtained by taking the *predecessor* of `self` `count` times. [Read more](iter/trait.step#method.backward_unchecked)
[source](https://doc.rust-lang.org/src/core/iter/range.rs.html#391-394)#### fn forward(start: i32, n: usize) -> i32
🔬This is a nightly-only experimental API. (`step_trait` [#42168](https://github.com/rust-lang/rust/issues/42168))
Returns the value that would be obtained by taking the *successor* of `self` `count` times. [Read more](iter/trait.step#method.forward)
[source](https://doc.rust-lang.org/src/core/iter/range.rs.html#391-394)#### fn backward(start: i32, n: usize) -> i32
🔬This is a nightly-only experimental API. (`step_trait` [#42168](https://github.com/rust-lang/rust/issues/42168))
Returns the value that would be obtained by taking the *predecessor* of `self` `count` times. [Read more](iter/trait.step#method.backward)
[source](https://doc.rust-lang.org/src/core/iter/range.rs.html#391-394)#### fn steps\_between(start: &i32, end: &i32) -> Option<usize>
🔬This is a nightly-only experimental API. (`step_trait` [#42168](https://github.com/rust-lang/rust/issues/42168))
Returns the number of *successor* steps required to get from `start` to `end`. [Read more](iter/trait.step#tymethod.steps_between)
[source](https://doc.rust-lang.org/src/core/iter/range.rs.html#391-394)#### fn forward\_checked(start: i32, n: usize) -> Option<i32>
🔬This is a nightly-only experimental API. (`step_trait` [#42168](https://github.com/rust-lang/rust/issues/42168))
Returns the value that would be obtained by taking the *successor* of `self` `count` times. [Read more](iter/trait.step#tymethod.forward_checked)
[source](https://doc.rust-lang.org/src/core/iter/range.rs.html#391-394)#### fn backward\_checked(start: i32, n: usize) -> Option<i32>
🔬This is a nightly-only experimental API. (`step_trait` [#42168](https://github.com/rust-lang/rust/issues/42168))
Returns the value that would be obtained by taking the *predecessor* of `self` `count` times. [Read more](iter/trait.step#tymethod.backward_checked)
[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
The resulting type after applying the `-` operator.
[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") · #### fn sub(self, other: &i32) -> <i32 as Sub<i32>>::Output
Performs the `-` operation. [Read more](ops/trait.sub#tymethod.sub)
[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
The resulting type after applying the `-` operator.
[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") · #### fn sub(self, other: &i32) -> <i32 as Sub<i32>>::Output
Performs the `-` operation. [Read more](ops/trait.sub#tymethod.sub)
[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
The resulting type after applying the `-` operator.
[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") · #### fn sub(self, other: i32) -> <i32 as Sub<i32>>::Output
Performs the `-` operation. [Read more](ops/trait.sub#tymethod.sub)
[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
The resulting type after applying the `-` operator.
[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") · #### fn sub(self, other: i32) -> i32
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<&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/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/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/ops/arith.rs.html#853)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/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/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/ops/arith.rs.html#853)1.8.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/ops/arith.rs.html#853)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/iter/traits/accum.rs.html#141)1.12.0 · ### impl<'a> Sum<&'a i32> for i32
[source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)#### fn sum<I>(iter: I) -> i32where I: [Iterator](iter/trait.iterator "trait std::iter::Iterator")<Item = &'a [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.12.0 · ### impl Sum<i32> for i32
[source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)#### fn sum<I>(iter: I) -> i32where I: [Iterator](iter/trait.iterator "trait std::iter::Iterator")<Item = [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/convert/num.rs.html#276)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<i128> for i32
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#276)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: i128) -> Result<i32, <i32 as TryFrom<i128>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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/convert/num.rs.html#274)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<i32> for i16
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#274)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: i32) -> Result<i16, <i16 as TryFrom<i32>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#274)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<i32> for i8
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#274)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: i32) -> Result<i8, <i8 as TryFrom<i32>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#371)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<i32> for isize
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#371)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(value: i32) -> Result<isize, <isize as TryFrom<i32>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#288)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<i32> for u128
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#288)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: i32) -> Result<u128, <u128 as TryFrom<i32>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#292)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<i32> for u16
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#292)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: i32) -> Result<u16, <u16 as TryFrom<i32>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#288)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<i32> for u32
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#288)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: i32) -> Result<u32, <u32 as TryFrom<i32>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#288)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<i32> for u64
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#288)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: i32) -> Result<u64, <u64 as TryFrom<i32>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#292)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<i32> for u8
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#292)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: i32) -> Result<u8, <u8 as TryFrom<i32>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#366)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<i32> for usize
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#366)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: i32) -> Result<usize, <usize as TryFrom<i32>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#275)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<i64> for i32
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#275)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: i64) -> Result<i32, <i32 as TryFrom<i64>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#361)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<isize> for i32
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#361)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: isize) -> Result<i32, <i32 as TryFrom<isize>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#283)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<u128> for i32
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#283)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: u128) -> Result<i32, <i32 as TryFrom<u128>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#281)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<u32> for i32
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#281)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: u32) -> Result<i32, <i32 as TryFrom<u32>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#282)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<u64> for i32
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#282)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: u64) -> Result<i32, <i32 as TryFrom<u64>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#356)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<usize> for i32
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#356)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: usize) -> Result<i32, <i32 as TryFrom<usize>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### type Error = TryFromIntError
The type returned in the event of a conversion error.
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#465-468)1.42.0 · ### impl UpperExp for i32
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#465-468)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error>
Formats the value using the given formatter.
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#177)### impl UpperHex for i32
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#177)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error>
Formats the value using the given formatter.
[source](https://doc.rust-lang.org/src/core/marker.rs.html#830-835)### impl Copy for i32
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1377)### impl Eq for i32
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#38)### impl FloatToInt<i32> for f32
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#39)### impl FloatToInt<i32> for f64
[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/iter/range.rs.html#17)### impl TrustedStep for i32
Auto Trait Implementations
--------------------------
### impl RefUnwindSafe for i32
### impl Send for i32
### impl Sync for i32
### impl Unpin for i32
### impl UnwindSafe for i32
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 Primitive Type isize Primitive Type isize
====================
The pointer-sized signed integer type.
The size of this primitive is how many bytes it takes to reference any location in memory. For example, on a 32 bit target, this is 4 bytes and on a 64 bit target, this is 8 bytes.
Implementations
---------------
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#261)### impl isize
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#262-267)1.43.0 · #### pub const MIN: isize = -9\_223\_372\_036\_854\_775\_808isize
The smallest value that can be represented by this integer type (−263 on 64-bit targets)
##### Examples
Basic usage:
```
assert_eq!(isize::MIN, -9223372036854775808);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#262-267)1.43.0 · #### pub const MAX: isize = 9\_223\_372\_036\_854\_775\_807isize
The largest value that can be represented by this integer type (263 − 1 on 64-bit targets)
##### Examples
Basic usage:
```
assert_eq!(isize::MAX, 9223372036854775807);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#262-267)1.53.0 · #### pub const BITS: u32 = 64u32
The size of this integer type in bits.
##### Examples
```
assert_eq!(isize::BITS, 64);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#262-267)#### pub fn from\_str\_radix(src: &str, radix: u32) -> Result<isize, ParseIntError>
Converts a string slice in a given base to an integer.
The string is expected to be an optional `+` or `-` sign followed by digits. Leading and trailing whitespace represent an error. Digits are a subset of these characters, depending on `radix`:
* `0-9`
* `a-z`
* `A-Z`
##### Panics
This function panics if `radix` is not in the range from 2 to 36.
##### Examples
Basic usage:
```
assert_eq!(isize::from_str_radix("A", 16), Ok(10));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#262-267)const: 1.32.0 · #### pub const fn count\_ones(self) -> u32
Returns the number of ones in the binary representation of `self`.
##### Examples
Basic usage:
```
let n = 0b100_0000isize;
assert_eq!(n.count_ones(), 1);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#262-267)const: 1.32.0 · #### pub const fn count\_zeros(self) -> u32
Returns the number of zeros in the binary representation of `self`.
##### Examples
Basic usage:
```
assert_eq!(isize::MAX.count_zeros(), 1);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#262-267)const: 1.32.0 · #### pub const fn leading\_zeros(self) -> u32
Returns the number of leading zeros in the binary representation of `self`.
##### Examples
Basic usage:
```
let n = -1isize;
assert_eq!(n.leading_zeros(), 0);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#262-267)const: 1.32.0 · #### pub const fn trailing\_zeros(self) -> u32
Returns the number of trailing zeros in the binary representation of `self`.
##### Examples
Basic usage:
```
let n = -4isize;
assert_eq!(n.trailing_zeros(), 2);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#262-267)1.46.0 (const: 1.46.0) · #### pub const fn leading\_ones(self) -> u32
Returns the number of leading ones in the binary representation of `self`.
##### Examples
Basic usage:
```
let n = -1isize;
assert_eq!(n.leading_ones(), 64);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#262-267)1.46.0 (const: 1.46.0) · #### pub const fn trailing\_ones(self) -> u32
Returns the number of trailing ones in the binary representation of `self`.
##### Examples
Basic usage:
```
let n = 3isize;
assert_eq!(n.trailing_ones(), 2);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#262-267)const: 1.32.0 · #### pub const fn rotate\_left(self, n: u32) -> isize
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:
```
let n = 0xaa00000000006e1isize;
let m = 0x6e10aa;
assert_eq!(n.rotate_left(12), m);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#262-267)const: 1.32.0 · #### pub const fn rotate\_right(self, n: u32) -> isize
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:
```
let n = 0x6e10aaisize;
let m = 0xaa00000000006e1;
assert_eq!(n.rotate_right(12), m);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#262-267)const: 1.32.0 · #### pub const fn swap\_bytes(self) -> isize
Reverses the byte order of the integer.
##### Examples
Basic usage:
```
let n = 0x1234567890123456isize;
let m = n.swap_bytes();
assert_eq!(m, 0x5634129078563412);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#262-267)1.37.0 (const: 1.37.0) · #### pub const fn reverse\_bits(self) -> isize
Reverses the order of bits in the integer. The least significant bit becomes the most significant bit, second least-significant bit becomes second most-significant bit, etc.
##### Examples
Basic usage:
```
let n = 0x1234567890123456isize;
let m = n.reverse_bits();
assert_eq!(m, 0x6a2c48091e6a2c48);
assert_eq!(0, 0isize.reverse_bits());
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#262-267)const: 1.32.0 · #### pub const fn from\_be(x: isize) -> isize
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:
```
let n = 0x1Aisize;
if cfg!(target_endian = "big") {
assert_eq!(isize::from_be(n), n)
} else {
assert_eq!(isize::from_be(n), n.swap_bytes())
}
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#262-267)const: 1.32.0 · #### pub const fn from\_le(x: isize) -> isize
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:
```
let n = 0x1Aisize;
if cfg!(target_endian = "little") {
assert_eq!(isize::from_le(n), n)
} else {
assert_eq!(isize::from_le(n), n.swap_bytes())
}
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#262-267)const: 1.32.0 · #### pub const fn to\_be(self) -> isize
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:
```
let n = 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/mod.rs.html#262-267)const: 1.32.0 · #### pub const fn to\_le(self) -> isize
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:
```
let n = 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/mod.rs.html#262-267)const: 1.47.0 · #### pub const fn checked\_add(self, rhs: isize) -> Option<isize>
Checked integer addition. Computes `self + rhs`, returning `None` if overflow occurred.
##### Examples
Basic usage:
```
assert_eq!((isize::MAX - 2).checked_add(1), Some(isize::MAX - 1));
assert_eq!((isize::MAX - 2).checked_add(3), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#262-267)const: [unstable](https://github.com/rust-lang/rust/issues/85122 "Tracking issue for const_inherent_unchecked_arith") · #### pub unsafe fn unchecked\_add(self, rhs: isize) -> isize
🔬This is a nightly-only experimental API. (`unchecked_math` [#85122](https://github.com/rust-lang/rust/issues/85122))
Unchecked integer addition. Computes `self + rhs`, assuming overflow cannot occur.
##### Safety
This results in undefined behavior when `self + rhs > isize::MAX` or `self + rhs < isize::MIN`, i.e. when [`checked_add`](primitive.isize#method.checked_add) would return `None`.
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#262-267)const: [unstable](https://github.com/rust-lang/rust/issues/87840 "Tracking issue for mixed_integer_ops") · #### pub fn checked\_add\_unsigned(self, rhs: usize) -> Option<isize>
🔬This is a nightly-only experimental API. (`mixed_integer_ops` [#87840](https://github.com/rust-lang/rust/issues/87840))
Checked addition with an unsigned integer. Computes `self + rhs`, returning `None` if overflow occurred.
##### Examples
Basic usage:
```
assert_eq!(1isize.checked_add_unsigned(2), Some(3));
assert_eq!((isize::MAX - 2).checked_add_unsigned(3), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#262-267)const: 1.47.0 · #### pub const fn checked\_sub(self, rhs: isize) -> Option<isize>
Checked integer subtraction. Computes `self - rhs`, returning `None` if overflow occurred.
##### Examples
Basic usage:
```
assert_eq!((isize::MIN + 2).checked_sub(1), Some(isize::MIN + 1));
assert_eq!((isize::MIN + 2).checked_sub(3), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#262-267)const: [unstable](https://github.com/rust-lang/rust/issues/85122 "Tracking issue for const_inherent_unchecked_arith") · #### pub unsafe fn unchecked\_sub(self, rhs: isize) -> isize
🔬This is a nightly-only experimental API. (`unchecked_math` [#85122](https://github.com/rust-lang/rust/issues/85122))
Unchecked integer subtraction. Computes `self - rhs`, assuming overflow cannot occur.
##### Safety
This results in undefined behavior when `self - rhs > isize::MAX` or `self - rhs < isize::MIN`, i.e. when [`checked_sub`](primitive.isize#method.checked_sub) would return `None`.
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#262-267)const: [unstable](https://github.com/rust-lang/rust/issues/87840 "Tracking issue for mixed_integer_ops") · #### pub fn checked\_sub\_unsigned(self, rhs: usize) -> Option<isize>
🔬This is a nightly-only experimental API. (`mixed_integer_ops` [#87840](https://github.com/rust-lang/rust/issues/87840))
Checked subtraction with an unsigned integer. Computes `self - rhs`, returning `None` if overflow occurred.
##### Examples
Basic usage:
```
assert_eq!(1isize.checked_sub_unsigned(2), Some(-1));
assert_eq!((isize::MIN + 2).checked_sub_unsigned(3), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#262-267)const: 1.47.0 · #### pub const fn checked\_mul(self, rhs: isize) -> Option<isize>
Checked integer multiplication. Computes `self * rhs`, returning `None` if overflow occurred.
##### Examples
Basic usage:
```
assert_eq!(isize::MAX.checked_mul(1), Some(isize::MAX));
assert_eq!(isize::MAX.checked_mul(2), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#262-267)const: [unstable](https://github.com/rust-lang/rust/issues/85122 "Tracking issue for const_inherent_unchecked_arith") · #### pub unsafe fn unchecked\_mul(self, rhs: isize) -> isize
🔬This is a nightly-only experimental API. (`unchecked_math` [#85122](https://github.com/rust-lang/rust/issues/85122))
Unchecked integer multiplication. Computes `self * rhs`, assuming overflow cannot occur.
##### Safety
This results in undefined behavior when `self * rhs > isize::MAX` or `self * rhs < isize::MIN`, i.e. when [`checked_mul`](primitive.isize#method.checked_mul) would return `None`.
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#262-267)const: 1.52.0 · #### pub const fn checked\_div(self, rhs: isize) -> Option<isize>
Checked integer division. Computes `self / rhs`, returning `None` if `rhs == 0` or the division results in overflow.
##### Examples
Basic usage:
```
assert_eq!((isize::MIN + 1).checked_div(-1), Some(9223372036854775807));
assert_eq!(isize::MIN.checked_div(-1), None);
assert_eq!((1isize).checked_div(0), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#262-267)1.38.0 (const: 1.52.0) · #### pub const fn checked\_div\_euclid(self, rhs: isize) -> Option<isize>
Checked Euclidean division. Computes `self.div_euclid(rhs)`, returning `None` if `rhs == 0` or the division results in overflow.
##### Examples
Basic usage:
```
assert_eq!((isize::MIN + 1).checked_div_euclid(-1), Some(9223372036854775807));
assert_eq!(isize::MIN.checked_div_euclid(-1), None);
assert_eq!((1isize).checked_div_euclid(0), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#262-267)1.7.0 (const: 1.52.0) · #### pub const fn checked\_rem(self, rhs: isize) -> Option<isize>
Checked integer remainder. Computes `self % rhs`, returning `None` if `rhs == 0` or the division results in overflow.
##### Examples
Basic usage:
```
assert_eq!(5isize.checked_rem(2), Some(1));
assert_eq!(5isize.checked_rem(0), None);
assert_eq!(isize::MIN.checked_rem(-1), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#262-267)1.38.0 (const: 1.52.0) · #### pub const fn checked\_rem\_euclid(self, rhs: isize) -> Option<isize>
Checked Euclidean remainder. Computes `self.rem_euclid(rhs)`, returning `None` if `rhs == 0` or the division results in overflow.
##### Examples
Basic usage:
```
assert_eq!(5isize.checked_rem_euclid(2), Some(1));
assert_eq!(5isize.checked_rem_euclid(0), None);
assert_eq!(isize::MIN.checked_rem_euclid(-1), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#262-267)1.7.0 (const: 1.47.0) · #### pub const fn checked\_neg(self) -> Option<isize>
Checked negation. Computes `-self`, returning `None` if `self == MIN`.
##### Examples
Basic usage:
```
assert_eq!(5isize.checked_neg(), Some(-5));
assert_eq!(isize::MIN.checked_neg(), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#262-267)1.7.0 (const: 1.47.0) · #### pub const fn checked\_shl(self, rhs: u32) -> Option<isize>
Checked shift left. Computes `self << rhs`, returning `None` if `rhs` is larger than or equal to the number of bits in `self`.
##### Examples
Basic usage:
```
assert_eq!(0x1isize.checked_shl(4), Some(0x10));
assert_eq!(0x1isize.checked_shl(129), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#262-267)const: [unstable](https://github.com/rust-lang/rust/issues/85122 "Tracking issue for const_inherent_unchecked_arith") · #### pub unsafe fn unchecked\_shl(self, rhs: isize) -> isize
🔬This is a nightly-only experimental API. (`unchecked_math` [#85122](https://github.com/rust-lang/rust/issues/85122))
Unchecked shift left. Computes `self << rhs`, assuming that `rhs` is less than the number of bits in `self`.
##### Safety
This results in undefined behavior if `rhs` is larger than or equal to the number of bits in `self`, i.e. when [`checked_shl`](primitive.isize#method.checked_shl) would return `None`.
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#262-267)1.7.0 (const: 1.47.0) · #### pub const fn checked\_shr(self, rhs: u32) -> Option<isize>
Checked shift right. Computes `self >> rhs`, returning `None` if `rhs` is larger than or equal to the number of bits in `self`.
##### Examples
Basic usage:
```
assert_eq!(0x10isize.checked_shr(4), Some(0x1));
assert_eq!(0x10isize.checked_shr(128), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#262-267)const: [unstable](https://github.com/rust-lang/rust/issues/85122 "Tracking issue for const_inherent_unchecked_arith") · #### pub unsafe fn unchecked\_shr(self, rhs: isize) -> isize
🔬This is a nightly-only experimental API. (`unchecked_math` [#85122](https://github.com/rust-lang/rust/issues/85122))
Unchecked shift right. Computes `self >> rhs`, assuming that `rhs` is less than the number of bits in `self`.
##### Safety
This results in undefined behavior if `rhs` is larger than or equal to the number of bits in `self`, i.e. when [`checked_shr`](primitive.isize#method.checked_shr) would return `None`.
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#262-267)1.13.0 (const: 1.47.0) · #### pub const fn checked\_abs(self) -> Option<isize>
Checked absolute value. Computes `self.abs()`, returning `None` if `self == MIN`.
##### Examples
Basic usage:
```
assert_eq!((-5isize).checked_abs(), Some(5));
assert_eq!(isize::MIN.checked_abs(), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#262-267)1.34.0 (const: 1.50.0) · #### pub const fn checked\_pow(self, exp: u32) -> Option<isize>
Checked exponentiation. Computes `self.pow(exp)`, returning `None` if overflow occurred.
##### Examples
Basic usage:
```
assert_eq!(8isize.checked_pow(2), Some(64));
assert_eq!(isize::MAX.checked_pow(2), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#262-267)const: 1.47.0 · #### pub const fn saturating\_add(self, rhs: isize) -> isize
Saturating integer addition. Computes `self + rhs`, saturating at the numeric bounds instead of overflowing.
##### Examples
Basic usage:
```
assert_eq!(100isize.saturating_add(1), 101);
assert_eq!(isize::MAX.saturating_add(100), isize::MAX);
assert_eq!(isize::MIN.saturating_add(-1), isize::MIN);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#262-267)const: [unstable](https://github.com/rust-lang/rust/issues/87840 "Tracking issue for mixed_integer_ops") · #### pub fn saturating\_add\_unsigned(self, rhs: usize) -> isize
🔬This is a nightly-only experimental API. (`mixed_integer_ops` [#87840](https://github.com/rust-lang/rust/issues/87840))
Saturating addition with an unsigned integer. Computes `self + rhs`, saturating at the numeric bounds instead of overflowing.
##### Examples
Basic usage:
```
assert_eq!(1isize.saturating_add_unsigned(2), 3);
assert_eq!(isize::MAX.saturating_add_unsigned(100), isize::MAX);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#262-267)const: 1.47.0 · #### pub const fn saturating\_sub(self, rhs: isize) -> isize
Saturating integer subtraction. Computes `self - rhs`, saturating at the numeric bounds instead of overflowing.
##### Examples
Basic usage:
```
assert_eq!(100isize.saturating_sub(127), -27);
assert_eq!(isize::MIN.saturating_sub(100), isize::MIN);
assert_eq!(isize::MAX.saturating_sub(-1), isize::MAX);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#262-267)const: [unstable](https://github.com/rust-lang/rust/issues/87840 "Tracking issue for mixed_integer_ops") · #### pub fn saturating\_sub\_unsigned(self, rhs: usize) -> isize
🔬This is a nightly-only experimental API. (`mixed_integer_ops` [#87840](https://github.com/rust-lang/rust/issues/87840))
Saturating subtraction with an unsigned integer. Computes `self - rhs`, saturating at the numeric bounds instead of overflowing.
##### Examples
Basic usage:
```
assert_eq!(100isize.saturating_sub_unsigned(127), -27);
assert_eq!(isize::MIN.saturating_sub_unsigned(100), isize::MIN);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#262-267)1.45.0 (const: 1.47.0) · #### pub const fn saturating\_neg(self) -> isize
Saturating integer negation. Computes `-self`, returning `MAX` if `self == MIN` instead of overflowing.
##### Examples
Basic usage:
```
assert_eq!(100isize.saturating_neg(), -100);
assert_eq!((-100isize).saturating_neg(), 100);
assert_eq!(isize::MIN.saturating_neg(), isize::MAX);
assert_eq!(isize::MAX.saturating_neg(), isize::MIN + 1);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#262-267)1.45.0 (const: 1.47.0) · #### pub const fn saturating\_abs(self) -> isize
Saturating absolute value. Computes `self.abs()`, returning `MAX` if `self == MIN` instead of overflowing.
##### Examples
Basic usage:
```
assert_eq!(100isize.saturating_abs(), 100);
assert_eq!((-100isize).saturating_abs(), 100);
assert_eq!(isize::MIN.saturating_abs(), isize::MAX);
assert_eq!((isize::MIN + 1).saturating_abs(), isize::MAX);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#262-267)1.7.0 (const: 1.47.0) · #### pub const fn saturating\_mul(self, rhs: isize) -> isize
Saturating integer multiplication. Computes `self * rhs`, saturating at the numeric bounds instead of overflowing.
##### Examples
Basic usage:
```
assert_eq!(10isize.saturating_mul(12), 120);
assert_eq!(isize::MAX.saturating_mul(10), isize::MAX);
assert_eq!(isize::MIN.saturating_mul(10), isize::MIN);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#262-267)1.58.0 (const: 1.58.0) · #### pub const fn saturating\_div(self, rhs: isize) -> isize
Saturating integer division. Computes `self / rhs`, saturating at the numeric bounds instead of overflowing.
##### Examples
Basic usage:
```
assert_eq!(5isize.saturating_div(2), 2);
assert_eq!(isize::MAX.saturating_div(-1), isize::MIN + 1);
assert_eq!(isize::MIN.saturating_div(-1), isize::MAX);
```
ⓘ
```
let _ = 1isize.saturating_div(0);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#262-267)1.34.0 (const: 1.50.0) · #### pub const fn saturating\_pow(self, exp: u32) -> isize
Saturating integer exponentiation. Computes `self.pow(exp)`, saturating at the numeric bounds instead of overflowing.
##### Examples
Basic usage:
```
assert_eq!((-4isize).saturating_pow(3), -64);
assert_eq!(isize::MIN.saturating_pow(2), isize::MAX);
assert_eq!(isize::MIN.saturating_pow(3), isize::MIN);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#262-267)const: 1.32.0 · #### pub const fn wrapping\_add(self, rhs: isize) -> isize
Wrapping (modular) addition. Computes `self + rhs`, wrapping around at the boundary of the type.
##### Examples
Basic usage:
```
assert_eq!(100isize.wrapping_add(27), 127);
assert_eq!(isize::MAX.wrapping_add(2), isize::MIN + 1);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#262-267)const: [unstable](https://github.com/rust-lang/rust/issues/87840 "Tracking issue for mixed_integer_ops") · #### pub fn wrapping\_add\_unsigned(self, rhs: usize) -> isize
🔬This is a nightly-only experimental API. (`mixed_integer_ops` [#87840](https://github.com/rust-lang/rust/issues/87840))
Wrapping (modular) addition with an unsigned integer. Computes `self + rhs`, wrapping around at the boundary of the type.
##### Examples
Basic usage:
```
assert_eq!(100isize.wrapping_add_unsigned(27), 127);
assert_eq!(isize::MAX.wrapping_add_unsigned(2), isize::MIN + 1);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#262-267)const: 1.32.0 · #### pub const fn wrapping\_sub(self, rhs: isize) -> isize
Wrapping (modular) subtraction. Computes `self - rhs`, wrapping around at the boundary of the type.
##### Examples
Basic usage:
```
assert_eq!(0isize.wrapping_sub(127), -127);
assert_eq!((-2isize).wrapping_sub(isize::MAX), isize::MAX);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#262-267)const: [unstable](https://github.com/rust-lang/rust/issues/87840 "Tracking issue for mixed_integer_ops") · #### pub fn wrapping\_sub\_unsigned(self, rhs: usize) -> isize
🔬This is a nightly-only experimental API. (`mixed_integer_ops` [#87840](https://github.com/rust-lang/rust/issues/87840))
Wrapping (modular) subtraction with an unsigned integer. Computes `self - rhs`, wrapping around at the boundary of the type.
##### Examples
Basic usage:
```
assert_eq!(0isize.wrapping_sub_unsigned(127), -127);
assert_eq!((-2isize).wrapping_sub_unsigned(usize::MAX), -1);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#262-267)const: 1.32.0 · #### pub const fn wrapping\_mul(self, rhs: isize) -> isize
Wrapping (modular) multiplication. Computes `self * rhs`, wrapping around at the boundary of the type.
##### Examples
Basic usage:
```
assert_eq!(10isize.wrapping_mul(12), 120);
assert_eq!(11i8.wrapping_mul(12), -124);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#262-267)1.2.0 (const: 1.52.0) · #### pub const fn wrapping\_div(self, rhs: isize) -> isize
Wrapping (modular) division. Computes `self / rhs`, wrapping around at the boundary of the type.
The only case where such wrapping can occur is when one divides `MIN / -1` on a signed type (where `MIN` is the negative minimal value for the type); this is equivalent to `-MIN`, a positive value that is too large to represent in the type. In such a case, this function returns `MIN` itself.
##### Panics
This function will panic if `rhs` is 0.
##### Examples
Basic usage:
```
assert_eq!(100isize.wrapping_div(10), 10);
assert_eq!((-128i8).wrapping_div(-1), -128);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#262-267)1.38.0 (const: 1.52.0) · #### pub const fn wrapping\_div\_euclid(self, rhs: isize) -> isize
Wrapping Euclidean division. Computes `self.div_euclid(rhs)`, wrapping around at the boundary of the type.
Wrapping will only occur in `MIN / -1` on a signed type (where `MIN` is the negative minimal value for the type). This is equivalent to `-MIN`, a positive value that is too large to represent in the type. In this case, this method returns `MIN` itself.
##### Panics
This function will panic if `rhs` is 0.
##### Examples
Basic usage:
```
assert_eq!(100isize.wrapping_div_euclid(10), 10);
assert_eq!((-128i8).wrapping_div_euclid(-1), -128);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#262-267)1.2.0 (const: 1.52.0) · #### pub const fn wrapping\_rem(self, rhs: isize) -> isize
Wrapping (modular) remainder. Computes `self % rhs`, wrapping around at the boundary of the type.
Such wrap-around never actually occurs mathematically; implementation artifacts make `x % y` invalid for `MIN / -1` on a signed type (where `MIN` is the negative minimal value). In such a case, this function returns `0`.
##### Panics
This function will panic if `rhs` is 0.
##### Examples
Basic usage:
```
assert_eq!(100isize.wrapping_rem(10), 0);
assert_eq!((-128i8).wrapping_rem(-1), 0);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#262-267)1.38.0 (const: 1.52.0) · #### pub const fn wrapping\_rem\_euclid(self, rhs: isize) -> isize
Wrapping Euclidean remainder. Computes `self.rem_euclid(rhs)`, wrapping around at the boundary of the type.
Wrapping will only occur in `MIN % -1` on a signed type (where `MIN` is the negative minimal value for the type). In this case, this method returns 0.
##### Panics
This function will panic if `rhs` is 0.
##### Examples
Basic usage:
```
assert_eq!(100isize.wrapping_rem_euclid(10), 0);
assert_eq!((-128i8).wrapping_rem_euclid(-1), 0);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#262-267)1.2.0 (const: 1.32.0) · #### pub const fn wrapping\_neg(self) -> isize
Wrapping (modular) negation. Computes `-self`, wrapping around at the boundary of the type.
The only case where such wrapping can occur is when one negates `MIN` on a signed type (where `MIN` is 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:
```
assert_eq!(100isize.wrapping_neg(), -100);
assert_eq!(isize::MIN.wrapping_neg(), isize::MIN);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#262-267)1.2.0 (const: 1.32.0) · #### pub const fn wrapping\_shl(self, rhs: u32) -> isize
Panic-free bitwise shift-left; yields `self << mask(rhs)`, where `mask` removes any high-order bits of `rhs` that would cause the shift to exceed the bitwidth of the type.
Note that this is *not* the same as a rotate-left; the RHS of a wrapping shift-left is restricted to the range of the type, rather than the bits shifted out of the LHS being returned to the other end. The primitive integer types all implement a [`rotate_left`](primitive.isize#method.rotate_left) function, which may be what you want instead.
##### Examples
Basic usage:
```
assert_eq!((-1isize).wrapping_shl(7), -128);
assert_eq!((-1isize).wrapping_shl(128), -1);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#262-267)1.2.0 (const: 1.32.0) · #### pub const fn wrapping\_shr(self, rhs: u32) -> isize
Panic-free bitwise shift-right; yields `self >> mask(rhs)`, where `mask` removes any high-order bits of `rhs` that would cause the shift to exceed the bitwidth of the type.
Note that this is *not* the same as a rotate-right; the RHS of a wrapping shift-right is restricted to the range of the type, rather than the bits shifted out of the LHS being returned to the other end. The primitive integer types all implement a [`rotate_right`](primitive.isize#method.rotate_right) function, which may be what you want instead.
##### Examples
Basic usage:
```
assert_eq!((-128isize).wrapping_shr(7), -1);
assert_eq!((-128i16).wrapping_shr(64), -128);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#262-267)1.13.0 (const: 1.32.0) · #### pub const fn wrapping\_abs(self) -> isize
Wrapping (modular) absolute value. Computes `self.abs()`, 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:
```
assert_eq!(100isize.wrapping_abs(), 100);
assert_eq!((-100isize).wrapping_abs(), 100);
assert_eq!(isize::MIN.wrapping_abs(), isize::MIN);
assert_eq!((-128i8).wrapping_abs() as u8, 128);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#262-267)1.51.0 (const: 1.51.0) · #### pub const fn unsigned\_abs(self) -> usize
Computes the absolute value of `self` without any wrapping or panicking.
##### Examples
Basic usage:
```
assert_eq!(100isize.unsigned_abs(), 100usize);
assert_eq!((-100isize).unsigned_abs(), 100usize);
assert_eq!((-128i8).unsigned_abs(), 128u8);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#262-267)1.34.0 (const: 1.50.0) · #### pub const fn wrapping\_pow(self, exp: u32) -> isize
Wrapping (modular) exponentiation. Computes `self.pow(exp)`, wrapping around at the boundary of the type.
##### Examples
Basic usage:
```
assert_eq!(3isize.wrapping_pow(4), 81);
assert_eq!(3i8.wrapping_pow(5), -13);
assert_eq!(3i8.wrapping_pow(6), -39);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#262-267)1.7.0 (const: 1.32.0) · #### pub const fn overflowing\_add(self, rhs: isize) -> (isize, bool)
Calculates `self` + `rhs`
Returns a tuple of the addition along with a boolean indicating whether an arithmetic overflow would occur. If an overflow would have occurred then the wrapped value is returned.
##### Examples
Basic usage:
```
assert_eq!(5isize.overflowing_add(2), (7, false));
assert_eq!(isize::MAX.overflowing_add(1), (isize::MIN, true));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#262-267)const: [unstable](https://github.com/rust-lang/rust/issues/85532 "Tracking issue for const_bigint_helper_methods") · #### pub fn carrying\_add(self, rhs: isize, carry: bool) -> (isize, bool)
🔬This is a nightly-only experimental API. (`bigint_helper_methods` [#85532](https://github.com/rust-lang/rust/issues/85532))
Calculates `self + rhs + carry` without the ability to overflow.
Performs “signed ternary addition” which takes in an extra bit to add, and may return an additional bit of overflow. This signed function is used only on the highest-ordered data, for which the signed overflow result indicates whether the big integer overflowed or not.
##### Examples
Basic usage:
```
#![feature(bigint_helper_methods)]
assert_eq!(5isize.carrying_add(2, false), (7, false));
assert_eq!(5isize.carrying_add(2, true), (8, false));
assert_eq!(isize::MAX.carrying_add(1, false), (isize::MIN, true));
assert_eq!(isize::MAX.carrying_add(0, true), (isize::MIN, true));
assert_eq!(isize::MAX.carrying_add(1, true), (isize::MIN + 1, true));
assert_eq!(isize::MAX.carrying_add(isize::MAX, true), (-1, true));
assert_eq!(isize::MIN.carrying_add(-1, true), (isize::MIN, false));
assert_eq!(0isize.carrying_add(isize::MAX, true), (isize::MIN, true));
```
If `carry` is false, this method is equivalent to [`overflowing_add`](primitive.isize#method.overflowing_add):
```
#![feature(bigint_helper_methods)]
assert_eq!(5_isize.carrying_add(2, false), 5_isize.overflowing_add(2));
assert_eq!(isize::MAX.carrying_add(1, false), isize::MAX.overflowing_add(1));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#262-267)const: [unstable](https://github.com/rust-lang/rust/issues/87840 "Tracking issue for mixed_integer_ops") · #### pub fn overflowing\_add\_unsigned(self, rhs: usize) -> (isize, bool)
🔬This is a nightly-only experimental API. (`mixed_integer_ops` [#87840](https://github.com/rust-lang/rust/issues/87840))
Calculates `self` + `rhs` with an unsigned `rhs`
Returns a tuple of the addition along with a boolean indicating whether an arithmetic overflow would occur. If an overflow would have occurred then the wrapped value is returned.
##### Examples
Basic usage:
```
assert_eq!(1isize.overflowing_add_unsigned(2), (3, false));
assert_eq!((isize::MIN).overflowing_add_unsigned(usize::MAX), (isize::MAX, false));
assert_eq!((isize::MAX - 2).overflowing_add_unsigned(3), (isize::MIN, true));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#262-267)1.7.0 (const: 1.32.0) · #### pub const fn overflowing\_sub(self, rhs: isize) -> (isize, bool)
Calculates `self` - `rhs`
Returns a tuple of the subtraction along with a boolean indicating whether an arithmetic overflow would occur. If an overflow would have occurred then the wrapped value is returned.
##### Examples
Basic usage:
```
assert_eq!(5isize.overflowing_sub(2), (3, false));
assert_eq!(isize::MIN.overflowing_sub(1), (isize::MAX, true));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#262-267)const: [unstable](https://github.com/rust-lang/rust/issues/85532 "Tracking issue for const_bigint_helper_methods") · #### pub fn borrowing\_sub(self, rhs: isize, borrow: bool) -> (isize, bool)
🔬This is a nightly-only experimental API. (`bigint_helper_methods` [#85532](https://github.com/rust-lang/rust/issues/85532))
Calculates `self - rhs - borrow` without the ability to overflow.
Performs “signed ternary subtraction” which takes in an extra bit to subtract, and may return an additional bit of overflow. This signed function is used only on the highest-ordered data, for which the signed overflow result indicates whether the big integer overflowed or not.
##### Examples
Basic usage:
```
#![feature(bigint_helper_methods)]
assert_eq!(5isize.borrowing_sub(2, false), (3, false));
assert_eq!(5isize.borrowing_sub(2, true), (2, false));
assert_eq!(0isize.borrowing_sub(1, false), (-1, false));
assert_eq!(0isize.borrowing_sub(1, true), (-2, false));
assert_eq!(isize::MIN.borrowing_sub(1, true), (isize::MAX - 1, true));
assert_eq!(isize::MAX.borrowing_sub(-1, false), (isize::MIN, true));
assert_eq!(isize::MAX.borrowing_sub(-1, true), (isize::MAX, false));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#262-267)const: [unstable](https://github.com/rust-lang/rust/issues/87840 "Tracking issue for mixed_integer_ops") · #### pub fn overflowing\_sub\_unsigned(self, rhs: usize) -> (isize, bool)
🔬This is a nightly-only experimental API. (`mixed_integer_ops` [#87840](https://github.com/rust-lang/rust/issues/87840))
Calculates `self` - `rhs` with an unsigned `rhs`
Returns a tuple of the subtraction along with a boolean indicating whether an arithmetic overflow would occur. If an overflow would have occurred then the wrapped value is returned.
##### Examples
Basic usage:
```
assert_eq!(1isize.overflowing_sub_unsigned(2), (-1, false));
assert_eq!((isize::MAX).overflowing_sub_unsigned(usize::MAX), (isize::MIN, false));
assert_eq!((isize::MIN + 2).overflowing_sub_unsigned(3), (isize::MAX, true));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#262-267)1.7.0 (const: 1.32.0) · #### pub const fn overflowing\_mul(self, rhs: isize) -> (isize, bool)
Calculates the multiplication of `self` and `rhs`.
Returns a tuple of the multiplication along with a boolean indicating whether an arithmetic overflow would occur. If an overflow would have occurred then the wrapped value is returned.
##### Examples
Basic usage:
```
assert_eq!(5isize.overflowing_mul(2), (10, false));
assert_eq!(1_000_000_000i32.overflowing_mul(10), (1410065408, true));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#262-267)1.7.0 (const: 1.52.0) · #### pub const fn overflowing\_div(self, rhs: isize) -> (isize, bool)
Calculates the divisor when `self` is divided by `rhs`.
Returns a tuple of the divisor along with a boolean indicating whether an arithmetic overflow would occur. If an overflow would occur then self is returned.
##### Panics
This function will panic if `rhs` is 0.
##### Examples
Basic usage:
```
assert_eq!(5isize.overflowing_div(2), (2, false));
assert_eq!(isize::MIN.overflowing_div(-1), (isize::MIN, true));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#262-267)1.38.0 (const: 1.52.0) · #### pub const fn overflowing\_div\_euclid(self, rhs: isize) -> (isize, bool)
Calculates the quotient of Euclidean division `self.div_euclid(rhs)`.
Returns a tuple of the divisor along with a boolean indicating whether an arithmetic overflow would occur. If an overflow would occur then `self` is returned.
##### Panics
This function will panic if `rhs` is 0.
##### Examples
Basic usage:
```
assert_eq!(5isize.overflowing_div_euclid(2), (2, false));
assert_eq!(isize::MIN.overflowing_div_euclid(-1), (isize::MIN, true));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#262-267)1.7.0 (const: 1.52.0) · #### pub const fn overflowing\_rem(self, rhs: isize) -> (isize, bool)
Calculates the remainder when `self` is divided by `rhs`.
Returns a tuple of the remainder after dividing along with a boolean indicating whether an arithmetic overflow would occur. If an overflow would occur then 0 is returned.
##### Panics
This function will panic if `rhs` is 0.
##### Examples
Basic usage:
```
assert_eq!(5isize.overflowing_rem(2), (1, false));
assert_eq!(isize::MIN.overflowing_rem(-1), (0, true));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#262-267)1.38.0 (const: 1.52.0) · #### pub const fn overflowing\_rem\_euclid(self, rhs: isize) -> (isize, bool)
Overflowing Euclidean remainder. Calculates `self.rem_euclid(rhs)`.
Returns a tuple of the remainder after dividing along with a boolean indicating whether an arithmetic overflow would occur. If an overflow would occur then 0 is returned.
##### Panics
This function will panic if `rhs` is 0.
##### Examples
Basic usage:
```
assert_eq!(5isize.overflowing_rem_euclid(2), (1, false));
assert_eq!(isize::MIN.overflowing_rem_euclid(-1), (0, true));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#262-267)1.7.0 (const: 1.32.0) · #### pub const fn overflowing\_neg(self) -> (isize, bool)
Negates self, overflowing if this is equal to the minimum value.
Returns a tuple of the negated version of self along with a boolean indicating whether an overflow happened. If `self` is the minimum value (e.g., `i32::MIN` for values of type `i32`), then the minimum value will be returned again and `true` will be returned for an overflow happening.
##### Examples
Basic usage:
```
assert_eq!(2isize.overflowing_neg(), (-2, false));
assert_eq!(isize::MIN.overflowing_neg(), (isize::MIN, true));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#262-267)1.7.0 (const: 1.32.0) · #### pub const fn overflowing\_shl(self, rhs: u32) -> (isize, bool)
Shifts self left by `rhs` bits.
Returns a tuple of the shifted version of self along with a boolean indicating whether the shift value was larger than or equal to the number of bits. If the shift value is too large, then value is masked (N-1) where N is the number of bits, and this value is then used to perform the shift.
##### Examples
Basic usage:
```
assert_eq!(0x1isize.overflowing_shl(4), (0x10, false));
assert_eq!(0x1i32.overflowing_shl(36), (0x10, true));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#262-267)1.7.0 (const: 1.32.0) · #### pub const fn overflowing\_shr(self, rhs: u32) -> (isize, bool)
Shifts self right by `rhs` bits.
Returns a tuple of the shifted version of self along with a boolean indicating whether the shift value was larger than or equal to the number of bits. If the shift value is too large, then value is masked (N-1) where N is the number of bits, and this value is then used to perform the shift.
##### Examples
Basic usage:
```
assert_eq!(0x10isize.overflowing_shr(4), (0x1, false));
assert_eq!(0x10i32.overflowing_shr(36), (0x1, true));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#262-267)1.13.0 (const: 1.32.0) · #### pub const fn overflowing\_abs(self) -> (isize, bool)
Computes the absolute value of `self`.
Returns a tuple of the absolute version of self along with a boolean indicating whether an overflow happened. If self is the minimum value (e.g., isize::MIN for values of type isize), then the minimum value will be returned again and true will be returned for an overflow happening.
##### Examples
Basic usage:
```
assert_eq!(10isize.overflowing_abs(), (10, false));
assert_eq!((-10isize).overflowing_abs(), (10, false));
assert_eq!((isize::MIN).overflowing_abs(), (isize::MIN, true));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#262-267)1.34.0 (const: 1.50.0) · #### pub const fn overflowing\_pow(self, exp: u32) -> (isize, bool)
Raises self to the power of `exp`, using exponentiation by squaring.
Returns a tuple of the exponentiation along with a bool indicating whether an overflow happened.
##### Examples
Basic usage:
```
assert_eq!(3isize.overflowing_pow(4), (81, false));
assert_eq!(3i8.overflowing_pow(5), (-13, true));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#262-267)const: 1.50.0 · #### pub const fn pow(self, exp: u32) -> isize
Raises self to the power of `exp`, using exponentiation by squaring.
##### Examples
Basic usage:
```
let x: isize = 2; // or any other integer type
assert_eq!(x.pow(5), 32);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#262-267)1.38.0 (const: 1.52.0) · #### pub const fn div\_euclid(self, rhs: isize) -> isize
Calculates the quotient of Euclidean division of `self` by `rhs`.
This computes the integer `q` such that `self = q * rhs + r`, with `r = self.rem_euclid(rhs)` and `0 <= r < abs(rhs)`.
In other words, the result is `self / rhs` rounded to the integer `q` such that `self >= q * rhs`. If `self > 0`, this is equal to round towards zero (the default in Rust); if `self < 0`, this is equal to round towards +/- infinity.
##### Panics
This function will panic if `rhs` is 0 or the division results in overflow.
##### Examples
Basic usage:
```
let a: isize = 7; // or any other integer type
let b = 4;
assert_eq!(a.div_euclid(b), 1); // 7 >= 4 * 1
assert_eq!(a.div_euclid(-b), -1); // 7 >= -4 * -1
assert_eq!((-a).div_euclid(b), -2); // -7 >= 4 * -2
assert_eq!((-a).div_euclid(-b), 2); // -7 >= -4 * 2
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#262-267)1.38.0 (const: 1.52.0) · #### pub const fn rem\_euclid(self, rhs: isize) -> isize
Calculates the least nonnegative remainder of `self (mod rhs)`.
This is done as if by the Euclidean division algorithm – given `r = self.rem_euclid(rhs)`, `self = rhs * self.div_euclid(rhs) + r`, and `0 <= r < abs(rhs)`.
##### Panics
This function will panic if `rhs` is 0 or the division results in overflow.
##### Examples
Basic usage:
```
let a: isize = 7; // or any other integer type
let b = 4;
assert_eq!(a.rem_euclid(b), 3);
assert_eq!((-a).rem_euclid(b), 1);
assert_eq!(a.rem_euclid(-b), 3);
assert_eq!((-a).rem_euclid(-b), 1);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#262-267)#### pub const fn div\_floor(self, rhs: isize) -> isize
🔬This is a nightly-only experimental API. (`int_roundings` [#88581](https://github.com/rust-lang/rust/issues/88581))
Calculates the quotient of `self` and `rhs`, rounding the result towards negative infinity.
##### Panics
This function will panic if `rhs` is zero.
###### [Overflow behavior](#overflow-behavior)
On overflow, this function will panic if overflow checks are enabled (default in debug mode) and wrap if overflow checks are disabled (default in release mode).
##### Examples
Basic usage:
```
#![feature(int_roundings)]
let a: isize = 8;
let b = 3;
assert_eq!(a.div_floor(b), 2);
assert_eq!(a.div_floor(-b), -3);
assert_eq!((-a).div_floor(b), -3);
assert_eq!((-a).div_floor(-b), 2);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#262-267)#### pub const fn div\_ceil(self, rhs: isize) -> isize
🔬This is a nightly-only experimental API. (`int_roundings` [#88581](https://github.com/rust-lang/rust/issues/88581))
Calculates the quotient of `self` and `rhs`, rounding the result towards positive infinity.
##### Panics
This function will panic if `rhs` is zero.
###### [Overflow behavior](#overflow-behavior-1)
On overflow, this function will panic if overflow checks are enabled (default in debug mode) and wrap if overflow checks are disabled (default in release mode).
##### Examples
Basic usage:
```
#![feature(int_roundings)]
let a: isize = 8;
let b = 3;
assert_eq!(a.div_ceil(b), 3);
assert_eq!(a.div_ceil(-b), -2);
assert_eq!((-a).div_ceil(b), -2);
assert_eq!((-a).div_ceil(-b), 3);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#262-267)#### pub const fn next\_multiple\_of(self, rhs: isize) -> isize
🔬This is a nightly-only experimental API. (`int_roundings` [#88581](https://github.com/rust-lang/rust/issues/88581))
If `rhs` is positive, calculates the smallest value greater than or equal to `self` that is a multiple of `rhs`. If `rhs` is negative, calculates the largest value less than or equal to `self` that is a multiple of `rhs`.
##### Panics
This function will panic if `rhs` is zero.
###### [Overflow behavior](#overflow-behavior-2)
On overflow, this function will panic if overflow checks are enabled (default in debug mode) and wrap if overflow checks are disabled (default in release mode).
##### Examples
Basic usage:
```
#![feature(int_roundings)]
assert_eq!(16_isize.next_multiple_of(8), 16);
assert_eq!(23_isize.next_multiple_of(8), 24);
assert_eq!(16_isize.next_multiple_of(-8), 16);
assert_eq!(23_isize.next_multiple_of(-8), 16);
assert_eq!((-16_isize).next_multiple_of(8), -16);
assert_eq!((-23_isize).next_multiple_of(8), -16);
assert_eq!((-16_isize).next_multiple_of(-8), -16);
assert_eq!((-23_isize).next_multiple_of(-8), -24);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#262-267)#### pub const fn checked\_next\_multiple\_of(self, rhs: isize) -> Option<isize>
🔬This is a nightly-only experimental API. (`int_roundings` [#88581](https://github.com/rust-lang/rust/issues/88581))
If `rhs` is positive, calculates the smallest value greater than or equal to `self` that is a multiple of `rhs`. If `rhs` is negative, calculates the largest value less than or equal to `self` that is a multiple of `rhs`. Returns `None` if `rhs` is zero or the operation would result in overflow.
##### Examples
Basic usage:
```
#![feature(int_roundings)]
assert_eq!(16_isize.checked_next_multiple_of(8), Some(16));
assert_eq!(23_isize.checked_next_multiple_of(8), Some(24));
assert_eq!(16_isize.checked_next_multiple_of(-8), Some(16));
assert_eq!(23_isize.checked_next_multiple_of(-8), Some(16));
assert_eq!((-16_isize).checked_next_multiple_of(8), Some(-16));
assert_eq!((-23_isize).checked_next_multiple_of(8), Some(-16));
assert_eq!((-16_isize).checked_next_multiple_of(-8), Some(-16));
assert_eq!((-23_isize).checked_next_multiple_of(-8), Some(-24));
assert_eq!(1_isize.checked_next_multiple_of(0), None);
assert_eq!(isize::MAX.checked_next_multiple_of(2), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#262-267)#### pub const fn ilog(self, base: isize) -> u32
🔬This is a nightly-only experimental API. (`int_log` [#70887](https://github.com/rust-lang/rust/issues/70887))
Returns the logarithm of the number with respect to an arbitrary base, rounded down.
This method might not be optimized owing to implementation details; `ilog2` can produce results more efficiently for base 2, and `ilog10` can produce results more efficiently for base 10.
##### Panics
When the number is negative, zero, or if the base is not at least 2; it panics in debug mode and the return value is 0 in release mode.
##### Examples
```
#![feature(int_log)]
assert_eq!(5isize.ilog(5), 1);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#262-267)#### 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.
##### Panics
When the number is negative or zero it panics in debug mode and the return value is 0 in release mode.
##### Examples
```
#![feature(int_log)]
assert_eq!(2isize.ilog2(), 1);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#262-267)#### 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.
##### Panics
When the number is negative or zero it panics in debug mode and the return value is 0 in release mode.
##### Example
```
#![feature(int_log)]
assert_eq!(10isize.ilog10(), 1);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#262-267)#### pub const fn checked\_ilog(self, base: isize) -> Option<u32>
🔬This is a nightly-only experimental API. (`int_log` [#70887](https://github.com/rust-lang/rust/issues/70887))
Returns the logarithm of the number with respect to an arbitrary base, rounded down.
Returns `None` if the number is negative or zero, or if the base is not at least 2.
This method might not be optimized owing to implementation details; `checked_ilog2` can produce results more efficiently for base 2, and `checked_ilog10` can produce results more efficiently for base 10.
##### Examples
```
#![feature(int_log)]
assert_eq!(5isize.checked_ilog(5), Some(1));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#262-267)#### pub const fn checked\_ilog2(self) -> Option<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.
Returns `None` if the number is negative or zero.
##### Examples
```
#![feature(int_log)]
assert_eq!(2isize.checked_ilog2(), Some(1));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#262-267)#### pub const fn checked\_ilog10(self) -> Option<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.
Returns `None` if the number is negative or zero.
##### Example
```
#![feature(int_log)]
assert_eq!(10isize.checked_ilog10(), Some(1));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#262-267)const: 1.32.0 · #### pub const fn abs(self) -> isize
Computes the absolute value of `self`.
##### Overflow behavior
The absolute value of `isize::MIN` cannot be represented as an `isize`, and attempting to calculate it will cause an overflow. This means that code in debug mode will trigger a panic on this case and optimized code will return `isize::MIN` without a panic.
##### Examples
Basic usage:
```
assert_eq!(10isize.abs(), 10);
assert_eq!((-10isize).abs(), 10);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#262-267)1.60.0 (const: 1.60.0) · #### pub const fn abs\_diff(self, other: isize) -> usize
Computes the absolute difference between `self` and `other`.
This function always returns the correct answer without overflow or panics by returning an unsigned integer.
##### Examples
Basic usage:
```
assert_eq!(100isize.abs_diff(80), 20usize);
assert_eq!(100isize.abs_diff(110), 10usize);
assert_eq!((-100isize).abs_diff(80), 180usize);
assert_eq!((-100isize).abs_diff(-120), 20usize);
assert_eq!(isize::MIN.abs_diff(isize::MAX), usize::MAX);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#262-267)const: 1.47.0 · #### pub const fn signum(self) -> isize
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:
```
assert_eq!(10isize.signum(), 1);
assert_eq!(0isize.signum(), 0);
assert_eq!((-10isize).signum(), -1);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#262-267)const: 1.32.0 · #### pub const fn is\_positive(self) -> bool
Returns `true` if `self` is positive and `false` if the number is zero or negative.
##### Examples
Basic usage:
```
assert!(10isize.is_positive());
assert!(!(-10isize).is_positive());
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#262-267)const: 1.32.0 · #### pub const fn is\_negative(self) -> bool
Returns `true` if `self` is negative and `false` if the number is zero or positive.
##### Examples
Basic usage:
```
assert!((-10isize).is_negative());
assert!(!10isize.is_negative());
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#262-267)1.32.0 (const: 1.44.0) · #### pub const fn to\_be\_bytes(self) -> [u8; 8]
Return the memory representation of this integer as a byte array in big-endian (network) byte order.
**Note**: This function returns an array of length 2, 4 or 8 bytes depending on the target pointer size.
##### Examples
```
let bytes = 0x1234567890123456isize.to_be_bytes();
assert_eq!(bytes, [0x12, 0x34, 0x56, 0x78, 0x90, 0x12, 0x34, 0x56]);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#262-267)1.32.0 (const: 1.44.0) · #### pub const fn to\_le\_bytes(self) -> [u8; 8]
Return the memory representation of this integer as a byte array in little-endian byte order.
**Note**: This function returns an array of length 2, 4 or 8 bytes depending on the target pointer size.
##### Examples
```
let bytes = 0x1234567890123456isize.to_le_bytes();
assert_eq!(bytes, [0x56, 0x34, 0x12, 0x90, 0x78, 0x56, 0x34, 0x12]);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#262-267)1.32.0 (const: 1.44.0) · #### pub const fn to\_ne\_bytes(self) -> [u8; 8]
Return the memory representation of this integer as a byte array in native byte order.
As the target platform’s native endianness is used, portable code should use [`to_be_bytes`](primitive.isize#method.to_be_bytes) or [`to_le_bytes`](primitive.isize#method.to_le_bytes), as appropriate, instead.
**Note**: This function returns an array of length 2, 4 or 8 bytes depending on the target pointer size.
##### Examples
```
let bytes = 0x1234567890123456isize.to_ne_bytes();
assert_eq!(
bytes,
if cfg!(target_endian = "big") {
[0x12, 0x34, 0x56, 0x78, 0x90, 0x12, 0x34, 0x56]
} else {
[0x56, 0x34, 0x12, 0x90, 0x78, 0x56, 0x34, 0x12]
}
);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#262-267)1.32.0 (const: 1.44.0) · #### pub const fn from\_be\_bytes(bytes: [u8; 8]) -> isize
Create an integer value from its representation as a byte array in big endian.
**Note**: This function takes an array of length 2, 4 or 8 bytes depending on the target pointer size.
##### Examples
```
let value = isize::from_be_bytes([0x12, 0x34, 0x56, 0x78, 0x90, 0x12, 0x34, 0x56]);
assert_eq!(value, 0x1234567890123456);
```
When starting from a slice rather than an array, fallible conversion APIs can be used:
```
fn read_be_isize(input: &mut &[u8]) -> isize {
let (int_bytes, rest) = input.split_at(std::mem::size_of::<isize>());
*input = rest;
isize::from_be_bytes(int_bytes.try_into().unwrap())
}
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#262-267)1.32.0 (const: 1.44.0) · #### pub const fn from\_le\_bytes(bytes: [u8; 8]) -> isize
Create an integer value from its representation as a byte array in little endian.
**Note**: This function takes an array of length 2, 4 or 8 bytes depending on the target pointer size.
##### Examples
```
let value = isize::from_le_bytes([0x56, 0x34, 0x12, 0x90, 0x78, 0x56, 0x34, 0x12]);
assert_eq!(value, 0x1234567890123456);
```
When starting from a slice rather than an array, fallible conversion APIs can be used:
```
fn read_le_isize(input: &mut &[u8]) -> isize {
let (int_bytes, rest) = input.split_at(std::mem::size_of::<isize>());
*input = rest;
isize::from_le_bytes(int_bytes.try_into().unwrap())
}
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#262-267)1.32.0 (const: 1.44.0) · #### pub const fn from\_ne\_bytes(bytes: [u8; 8]) -> isize
Create an integer value from its memory representation as a byte array in native endianness.
As the target platform’s native endianness is used, portable code likely wants to use [`from_be_bytes`](primitive.isize#method.from_be_bytes) or [`from_le_bytes`](primitive.isize#method.from_le_bytes), as appropriate instead.
**Note**: This function takes an array of length 2, 4 or 8 bytes depending on the target pointer size.
##### Examples
```
let value = isize::from_ne_bytes(if cfg!(target_endian = "big") {
[0x12, 0x34, 0x56, 0x78, 0x90, 0x12, 0x34, 0x56]
} else {
[0x56, 0x34, 0x12, 0x90, 0x78, 0x56, 0x34, 0x12]
});
assert_eq!(value, 0x1234567890123456);
```
When starting from a slice rather than an array, fallible conversion APIs can be used:
```
fn read_ne_isize(input: &mut &[u8]) -> isize {
let (int_bytes, rest) = input.split_at(std::mem::size_of::<isize>());
*input = rest;
isize::from_ne_bytes(int_bytes.try_into().unwrap())
}
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#262-267)const: 1.32.0 · #### pub const fn min\_value() -> isize
👎Deprecating in a future Rust version: replaced by the `MIN` associated constant on this type
New code should prefer to use [`isize::MIN`](primitive.isize#associatedconstant.MIN "isize::MIN") instead.
Returns the smallest value that can be represented by this integer type.
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#262-267)const: 1.32.0 · #### pub const fn max\_value() -> isize
👎Deprecating in a future Rust version: replaced by the `MAX` associated constant on this type
New code should prefer to use [`isize::MAX`](primitive.isize#associatedconstant.MAX "isize::MAX") instead.
Returns the largest value that can be represented by this integer type.
Trait Implementations
---------------------
[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
The resulting type after applying the `+` operator.
[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") · #### fn add(self, other: &isize) -> <isize as Add<isize>>::Output
Performs the `+` operation. [Read more](ops/trait.add#tymethod.add)
[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
The resulting type after applying the `+` operator.
[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") · #### fn add(self, other: &isize) -> <isize as Add<isize>>::Output
Performs the `+` operation. [Read more](ops/trait.add#tymethod.add)
[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
The resulting type after applying the `+` operator.
[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") · #### fn add(self, other: isize) -> <isize as Add<isize>>::Output
Performs the `+` operation. [Read more](ops/trait.add#tymethod.add)
[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
The resulting type after applying the `+` operator.
[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") · #### fn add(self, other: isize) -> isize
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<&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/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/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/ops/arith.rs.html#786)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/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/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/ops/arith.rs.html#786)1.8.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/ops/arith.rs.html#786)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/fmt/num.rs.html#174)### impl Binary for isize
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#174)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error>
Formats the value using the given formatter.
[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
The resulting type after applying the `&` operator.
[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") · #### fn bitand(self, other: &isize) -> <isize as BitAnd<isize>>::Output
Performs the `&` operation. [Read more](ops/trait.bitand#tymethod.bitand)
[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
The resulting type after applying the `&` operator.
[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") · #### fn bitand(self, other: &isize) -> <isize as BitAnd<isize>>::Output
Performs the `&` operation. [Read more](ops/trait.bitand#tymethod.bitand)
[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
The resulting type after applying the `&` operator.
[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") · #### fn bitand(self, other: isize) -> <isize as BitAnd<isize>>::Output
Performs the `&` operation. [Read more](ops/trait.bitand#tymethod.bitand)
[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
The resulting type after applying the `&` operator.
[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") · #### fn bitand(self, rhs: isize) -> isize
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<&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/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/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/ops/bit.rs.html#734)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/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/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/ops/bit.rs.html#734)1.8.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/ops/bit.rs.html#734)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/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
The resulting type after applying the `|` operator.
[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") · #### fn bitor(self, other: &isize) -> <isize as BitOr<isize>>::Output
Performs the `|` operation. [Read more](ops/trait.bitor#tymethod.bitor)
[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
The resulting type after applying the `|` operator.
[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") · #### fn bitor(self, other: &isize) -> <isize 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 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/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
The resulting type after applying the `|` operator.
[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") · #### fn bitor(self, other: isize) -> <isize 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 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/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
The resulting type after applying the `|` operator.
[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") · #### fn bitor(self, rhs: isize) -> isize
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<&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/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/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/ops/bit.rs.html#806)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/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/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/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/ops/bit.rs.html#806)1.8.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/ops/bit.rs.html#806)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/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
The resulting type after applying the `^` operator.
[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") · #### fn bitxor(self, other: &isize) -> <isize as BitXor<isize>>::Output
Performs the `^` operation. [Read more](ops/trait.bitxor#tymethod.bitxor)
[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
The resulting type after applying the `^` operator.
[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") · #### fn bitxor(self, other: &isize) -> <isize as BitXor<isize>>::Output
Performs the `^` operation. [Read more](ops/trait.bitxor#tymethod.bitxor)
[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
The resulting type after applying the `^` operator.
[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") · #### fn bitxor(self, other: isize) -> <isize as BitXor<isize>>::Output
Performs the `^` operation. [Read more](ops/trait.bitxor#tymethod.bitxor)
[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
The resulting type after applying the `^` operator.
[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") · #### fn bitxor(self, other: isize) -> isize
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<&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/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/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/ops/bit.rs.html#878)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/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/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/ops/bit.rs.html#878)1.8.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/ops/bit.rs.html#878)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/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#197-202)const: [unstable](https://github.com/rust-lang/rust/issues/91805 "Tracking issue for const_clone") · #### fn clone(&self) -> isize
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/num.rs.html#197-200)### impl Debug for isize
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#197-200)#### 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/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#214)const: [unstable](https://github.com/rust-lang/rust/issues/87864 "Tracking issue for const_default_impls") · #### fn default() -> isize
Returns the default value of `0`
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#461-464)### impl Display for isize
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#461-464)#### 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/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
The resulting type after applying the `/` operator.
[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") · #### fn div(self, other: &isize) -> <isize as Div<isize>>::Output
Performs the `/` operation. [Read more](ops/trait.div#tymethod.div)
[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
The resulting type after applying the `/` operator.
[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") · #### fn div(self, other: &isize) -> <isize as Div<isize>>::Output
Performs the `/` operation. [Read more](ops/trait.div#tymethod.div)
[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
The resulting type after applying the `/` operator.
[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") · #### fn div(self, other: isize) -> <isize as Div<isize>>::Output
Performs the `/` operation. [Read more](ops/trait.div#tymethod.div)
[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
The resulting type after applying the `/` operator.
[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") · #### fn div(self, other: isize) -> isize
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<&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/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/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/ops/arith.rs.html#968)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/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/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/ops/arith.rs.html#968)1.8.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/ops/arith.rs.html#968)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/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#97)1.28.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<bool> for isize
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#97)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: bool) -> isize
Converts a `bool` to a `isize`. The resulting value is `0` for `false` and `1` for `true` values.
##### Examples
```
assert_eq!(isize::from(true), 1);
assert_eq!(isize::from(false), 0);
```
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#142)1.26.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<i16> for isize
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#142)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: i16) -> isize
Converts `i16` to `isize` losslessly.
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#117)1.5.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<i8> for isize
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#117)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: i8) -> isize
Converts `i8` to `isize` losslessly.
[source](https://doc.rust-lang.org/src/core/sync/atomic.rs.html#2922-2926)1.23.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<isize> for AtomicIsize
[source](https://doc.rust-lang.org/src/core/sync/atomic.rs.html#2922-2926)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(v: isize) -> AtomicIsize
Converts an `isize` into an `AtomicIsize`.
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#141)1.26.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<u8> for isize
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#141)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: u8) -> isize
Converts `u8` to `isize` losslessly.
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#1018)### impl FromStr for isize
#### type Err = ParseIntError
The associated error which can be returned from parsing.
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#1018)#### fn from\_str(src: &str) -> Result<isize, ParseIntError>
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/hash/mod.rs.html#829-842)### impl Hash for isize
[source](https://doc.rust-lang.org/src/core/hash/mod.rs.html#829-842)#### 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#829-842)#### fn hash\_slice<H>(data: &[isize], 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/fmt/num.rs.html#465-468)1.42.0 · ### impl LowerExp for isize
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#465-468)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error>
Formats the value using the given formatter.
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#174)### impl LowerHex for isize
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#174)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error>
Formats the value using the given formatter.
[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
The resulting type after applying the `*` operator.
[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") · #### fn mul(self, other: &isize) -> <isize as Mul<isize>>::Output
Performs the `*` operation. [Read more](ops/trait.mul#tymethod.mul)
[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
The resulting type after applying the `*` operator.
[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") · #### fn mul(self, other: &isize) -> <isize as Mul<isize>>::Output
Performs the `*` operation. [Read more](ops/trait.mul#tymethod.mul)
[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
The resulting type after applying the `*` operator.
[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") · #### fn mul(self, other: isize) -> <isize as Mul<isize>>::Output
Performs the `*` operation. [Read more](ops/trait.mul#tymethod.mul)
[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
The resulting type after applying the `*` operator.
[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") · #### fn mul(self, other: isize) -> isize
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<&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/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/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/ops/arith.rs.html#911)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/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/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/ops/arith.rs.html#911)1.8.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/ops/arith.rs.html#911)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/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
The resulting type after applying the `-` operator.
[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") · #### fn neg(self) -> <isize as Neg>::Output
Performs the unary `-` operation. [Read more](ops/trait.neg#tymethod.neg)
[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
The resulting type after applying the `-` operator.
[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") · #### fn neg(self) -> isize
Performs the unary `-` operation. [Read more](ops/trait.neg#tymethod.neg)
[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
The resulting type after applying the `!` operator.
[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") · #### fn not(self) -> <isize as Not>::Output
Performs the unary `!` operation. [Read more](ops/trait.not#tymethod.not)
[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
The resulting type after applying the `!` operator.
[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") · #### fn not(self) -> isize
Performs the unary `!` operation. [Read more](ops/trait.not#tymethod.not)
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#174)### impl Octal for isize
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#174)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error>
Formats the value using the given formatter.
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1486)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · ### impl Ord for isize
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1486)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · #### fn cmp(&self, other: &isize) -> 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/cmp.rs.html#1366-1368)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · ### impl PartialEq<isize> for isize
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1366-1368)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · #### fn eq(&self, other: &isize) -> 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#1366-1368)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · #### fn ne(&self, other: &isize) -> 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/cmp.rs.html#1486)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · ### impl PartialOrd<isize> for isize
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1486)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · #### fn partial\_cmp(&self, other: &isize) -> 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#1486)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · #### fn lt(&self, other: &isize) -> 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#1486)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · #### fn le(&self, other: &isize) -> 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#1486)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · #### fn ge(&self, other: &isize) -> 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/cmp.rs.html#1486)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · #### fn gt(&self, other: &isize) -> 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/iter/traits/accum.rs.html#141)1.12.0 · ### impl<'a> Product<&'a isize> for isize
[source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)#### fn product<I>(iter: I) -> isizewhere I: [Iterator](iter/trait.iterator "trait std::iter::Iterator")<Item = &'a [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.12.0 · ### impl Product<isize> for isize
[source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)#### fn product<I>(iter: I) -> isizewhere I: [Iterator](iter/trait.iterator "trait std::iter::Iterator")<Item = [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/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
The resulting type after applying the `%` operator.
[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") · #### fn rem(self, other: &isize) -> <isize as Rem<isize>>::Output
Performs the `%` operation. [Read more](ops/trait.rem#tymethod.rem)
[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
The resulting type after applying the `%` operator.
[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") · #### fn rem(self, other: &isize) -> <isize as Rem<isize>>::Output
Performs the `%` operation. [Read more](ops/trait.rem#tymethod.rem)
[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
The resulting type after applying the `%` operator.
[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") · #### fn rem(self, other: isize) -> <isize as Rem<isize>>::Output
Performs the `%` operation. [Read more](ops/trait.rem#tymethod.rem)
[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
The resulting type after applying the `%` operator.
[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") · #### fn rem(self, other: isize) -> isize
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<&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/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/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/ops/arith.rs.html#1029)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/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/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/ops/arith.rs.html#1029)1.8.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/ops/arith.rs.html#1029)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/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i128) -> <isize as Shl<i128>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i128) -> <isize as Shl<i128>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i16) -> <isize as Shl<i16>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i16) -> <isize as Shl<i16>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i32) -> <isize as Shl<i32>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i32) -> <isize as Shl<i32>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i64) -> <isize as Shl<i64>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i64) -> <isize as Shl<i64>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i8) -> <isize as Shl<i8>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i8) -> <isize as Shl<i8>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &isize) -> <i128 as Shl<isize>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &isize) -> <i16 as Shl<isize>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &isize) -> <i32 as Shl<isize>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &isize) -> <i64 as Shl<isize>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &isize) -> <i8 as Shl<isize>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &isize) -> <isize as Shl<isize>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &isize) -> <u128 as Shl<isize>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &isize) -> <u16 as Shl<isize>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &isize) -> <u32 as Shl<isize>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &isize) -> <u64 as Shl<isize>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &isize) -> <u8 as Shl<isize>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &isize) -> <usize as Shl<isize>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &isize) -> <i128 as Shl<isize>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &isize) -> <i16 as Shl<isize>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &isize) -> <i32 as Shl<isize>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &isize) -> <i64 as Shl<isize>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &isize) -> <i8 as Shl<isize>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &isize) -> <isize as Shl<isize>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &isize) -> <u128 as Shl<isize>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &isize) -> <u16 as Shl<isize>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &isize) -> <u32 as Shl<isize>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &isize) -> <u64 as Shl<isize>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &isize) -> <u8 as Shl<isize>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &isize) -> <usize as Shl<isize>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u128) -> <isize as Shl<u128>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u128) -> <isize as Shl<u128>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u16) -> <isize as Shl<u16>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u16) -> <isize as Shl<u16>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u32) -> <isize as Shl<u32>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u32) -> <isize as Shl<u32>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u64) -> <isize as Shl<u64>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u64) -> <isize as Shl<u64>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u8) -> <isize as Shl<u8>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u8) -> <isize as Shl<u8>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &usize) -> <isize as Shl<usize>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &usize) -> <isize as Shl<usize>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i128) -> <isize as Shl<i128>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i128) -> isize
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i16) -> <isize as Shl<i16>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i16) -> isize
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i32) -> <isize as Shl<i32>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i32) -> isize
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i64) -> <isize as Shl<i64>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i64) -> isize
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i8) -> <isize as Shl<i8>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i8) -> isize
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: isize) -> <i128 as Shl<isize>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: isize) -> <i16 as Shl<isize>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: isize) -> <i32 as Shl<isize>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: isize) -> <i64 as Shl<isize>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: isize) -> <i8 as Shl<isize>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: isize) -> <isize as Shl<isize>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: isize) -> <u128 as Shl<isize>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: isize) -> <u16 as Shl<isize>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: isize) -> <u32 as Shl<isize>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: isize) -> <u64 as Shl<isize>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: isize) -> <u8 as Shl<isize>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: isize) -> <usize as Shl<isize>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: isize) -> i128
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: isize) -> i16
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: isize) -> i32
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: isize) -> i64
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: isize) -> i8
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: isize) -> isize
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: isize) -> u128
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: isize) -> u16
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: isize) -> u32
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: isize) -> u64
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: isize) -> u8
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: isize) -> usize
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u128) -> <isize as Shl<u128>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u128) -> isize
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u16) -> <isize as Shl<u16>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u16) -> isize
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u32) -> <isize as Shl<u32>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u32) -> isize
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u64) -> <isize as Shl<u64>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u64) -> isize
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u8) -> <isize as Shl<u8>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u8) -> isize
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: usize) -> <isize as Shl<usize>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: usize) -> isize
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &i128)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &i16)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &i32)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &i64)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &i8)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &isize)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &isize)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &isize)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &isize)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &isize)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &isize)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &isize)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &isize)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &isize)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &isize)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &isize)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &isize)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &u128)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &u16)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &u32)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &u64)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &u8)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)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/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: i128)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: i16)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: i32)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: i64)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: i8)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: isize)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: isize)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: isize)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: isize)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: isize)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: isize)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: isize)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: isize)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: isize)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: isize)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: isize)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: isize)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: u128)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: u16)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: u32)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: u64)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: u8)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)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/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i128) -> <isize as Shr<i128>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i128) -> <isize as Shr<i128>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i16) -> <isize as Shr<i16>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i16) -> <isize as Shr<i16>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i32) -> <isize as Shr<i32>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i32) -> <isize as Shr<i32>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i64) -> <isize as Shr<i64>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i64) -> <isize as Shr<i64>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i8) -> <isize as Shr<i8>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i8) -> <isize as Shr<i8>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &isize) -> <i128 as Shr<isize>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &isize) -> <i16 as Shr<isize>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &isize) -> <i32 as Shr<isize>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &isize) -> <i64 as Shr<isize>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &isize) -> <i8 as Shr<isize>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &isize) -> <isize as Shr<isize>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &isize) -> <u128 as Shr<isize>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &isize) -> <u16 as Shr<isize>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &isize) -> <u32 as Shr<isize>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &isize) -> <u64 as Shr<isize>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &isize) -> <u8 as Shr<isize>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &isize) -> <usize as Shr<isize>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &isize) -> <i128 as Shr<isize>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &isize) -> <i16 as Shr<isize>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &isize) -> <i32 as Shr<isize>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &isize) -> <i64 as Shr<isize>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &isize) -> <i8 as Shr<isize>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &isize) -> <isize as Shr<isize>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &isize) -> <u128 as Shr<isize>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &isize) -> <u16 as Shr<isize>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &isize) -> <u32 as Shr<isize>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &isize) -> <u64 as Shr<isize>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &isize) -> <u8 as Shr<isize>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &isize) -> <usize as Shr<isize>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u128) -> <isize as Shr<u128>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u128) -> <isize as Shr<u128>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u16) -> <isize as Shr<u16>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u16) -> <isize as Shr<u16>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u32) -> <isize as Shr<u32>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u32) -> <isize as Shr<u32>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u64) -> <isize as Shr<u64>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u64) -> <isize as Shr<u64>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u8) -> <isize as Shr<u8>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u8) -> <isize as Shr<u8>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &usize) -> <isize as Shr<usize>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &usize) -> <isize as Shr<usize>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i128) -> <isize as Shr<i128>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i128) -> isize
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i16) -> <isize as Shr<i16>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i16) -> isize
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i32) -> <isize as Shr<i32>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i32) -> isize
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i64) -> <isize as Shr<i64>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i64) -> isize
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i8) -> <isize as Shr<i8>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i8) -> isize
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: isize) -> <i128 as Shr<isize>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: isize) -> <i16 as Shr<isize>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: isize) -> <i32 as Shr<isize>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: isize) -> <i64 as Shr<isize>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: isize) -> <i8 as Shr<isize>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: isize) -> <isize as Shr<isize>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: isize) -> <u128 as Shr<isize>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: isize) -> <u16 as Shr<isize>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: isize) -> <u32 as Shr<isize>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: isize) -> <u64 as Shr<isize>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: isize) -> <u8 as Shr<isize>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: isize) -> <usize as Shr<isize>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: isize) -> i128
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: isize) -> i16
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: isize) -> i32
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: isize) -> i64
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: isize) -> i8
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: isize) -> isize
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: isize) -> u128
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: isize) -> u16
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: isize) -> u32
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: isize) -> u64
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: isize) -> u8
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: isize) -> usize
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u128) -> <isize as Shr<u128>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u128) -> isize
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u16) -> <isize as Shr<u16>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u16) -> isize
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u32) -> <isize as Shr<u32>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u32) -> isize
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u64) -> <isize as Shr<u64>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u64) -> isize
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u8) -> <isize as Shr<u8>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u8) -> isize
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: usize) -> <isize as Shr<usize>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: usize) -> isize
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &i128)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &i16)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &i32)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &i64)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &i8)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &isize)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &isize)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &isize)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &isize)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &isize)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &isize)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &isize)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &isize)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &isize)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &isize)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &isize)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &isize)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &u128)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &u16)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &u32)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &u64)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &u8)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)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/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: i128)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: i16)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: i32)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: i64)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: i8)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: isize)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: isize)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: isize)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: isize)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: isize)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: isize)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: isize)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: isize)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: isize)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: isize)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: isize)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: isize)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: u128)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: u16)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: u32)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: u64)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: u8)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)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/up/up/portable-simd/crates/core_simd/src/vector.rs.html#726)### impl SimdElement for isize
#### type Mask = isize
🔬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.
[source](https://doc.rust-lang.org/src/core/iter/range.rs.html#391-394)### impl Step for isize
[source](https://doc.rust-lang.org/src/core/iter/range.rs.html#391-394)#### unsafe fn forward\_unchecked(start: isize, n: usize) -> isize
🔬This is a nightly-only experimental API. (`step_trait` [#42168](https://github.com/rust-lang/rust/issues/42168))
Returns the value that would be obtained by taking the *successor* of `self` `count` times. [Read more](iter/trait.step#method.forward_unchecked)
[source](https://doc.rust-lang.org/src/core/iter/range.rs.html#391-394)#### unsafe fn backward\_unchecked(start: isize, n: usize) -> isize
🔬This is a nightly-only experimental API. (`step_trait` [#42168](https://github.com/rust-lang/rust/issues/42168))
Returns the value that would be obtained by taking the *predecessor* of `self` `count` times. [Read more](iter/trait.step#method.backward_unchecked)
[source](https://doc.rust-lang.org/src/core/iter/range.rs.html#391-394)#### fn forward(start: isize, n: usize) -> isize
🔬This is a nightly-only experimental API. (`step_trait` [#42168](https://github.com/rust-lang/rust/issues/42168))
Returns the value that would be obtained by taking the *successor* of `self` `count` times. [Read more](iter/trait.step#method.forward)
[source](https://doc.rust-lang.org/src/core/iter/range.rs.html#391-394)#### fn backward(start: isize, n: usize) -> isize
🔬This is a nightly-only experimental API. (`step_trait` [#42168](https://github.com/rust-lang/rust/issues/42168))
Returns the value that would be obtained by taking the *predecessor* of `self` `count` times. [Read more](iter/trait.step#method.backward)
[source](https://doc.rust-lang.org/src/core/iter/range.rs.html#391-394)#### fn steps\_between(start: &isize, end: &isize) -> Option<usize>
🔬This is a nightly-only experimental API. (`step_trait` [#42168](https://github.com/rust-lang/rust/issues/42168))
Returns the number of *successor* steps required to get from `start` to `end`. [Read more](iter/trait.step#tymethod.steps_between)
[source](https://doc.rust-lang.org/src/core/iter/range.rs.html#391-394)#### fn forward\_checked(start: isize, n: usize) -> Option<isize>
🔬This is a nightly-only experimental API. (`step_trait` [#42168](https://github.com/rust-lang/rust/issues/42168))
Returns the value that would be obtained by taking the *successor* of `self` `count` times. [Read more](iter/trait.step#tymethod.forward_checked)
[source](https://doc.rust-lang.org/src/core/iter/range.rs.html#391-394)#### fn backward\_checked(start: isize, n: usize) -> Option<isize>
🔬This is a nightly-only experimental API. (`step_trait` [#42168](https://github.com/rust-lang/rust/issues/42168))
Returns the value that would be obtained by taking the *predecessor* of `self` `count` times. [Read more](iter/trait.step#tymethod.backward_checked)
[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
The resulting type after applying the `-` operator.
[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") · #### fn sub(self, other: &isize) -> <isize as Sub<isize>>::Output
Performs the `-` operation. [Read more](ops/trait.sub#tymethod.sub)
[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
The resulting type after applying the `-` operator.
[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") · #### fn sub(self, other: &isize) -> <isize as Sub<isize>>::Output
Performs the `-` operation. [Read more](ops/trait.sub#tymethod.sub)
[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
The resulting type after applying the `-` operator.
[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") · #### fn sub(self, other: isize) -> <isize as Sub<isize>>::Output
Performs the `-` operation. [Read more](ops/trait.sub#tymethod.sub)
[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
The resulting type after applying the `-` operator.
[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") · #### fn sub(self, other: isize) -> isize
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<&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/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/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/ops/arith.rs.html#853)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/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/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/ops/arith.rs.html#853)1.8.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/ops/arith.rs.html#853)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/iter/traits/accum.rs.html#141)1.12.0 · ### impl<'a> Sum<&'a isize> for isize
[source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)#### fn sum<I>(iter: I) -> isizewhere I: [Iterator](iter/trait.iterator "trait std::iter::Iterator")<Item = &'a [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.12.0 · ### impl Sum<isize> for isize
[source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)#### fn sum<I>(iter: I) -> isizewhere I: [Iterator](iter/trait.iterator "trait std::iter::Iterator")<Item = [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/convert/num.rs.html#372)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<i128> for isize
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#372)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: i128) -> Result<isize, <isize as TryFrom<i128>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#371)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<i32> for isize
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#371)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(value: i32) -> Result<isize, <isize as TryFrom<i32>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#371)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<i64> for isize
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#371)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(value: i64) -> Result<isize, <isize as TryFrom<i64>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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/convert/num.rs.html#362)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<isize> for i128
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#362)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(value: isize) -> Result<i128, <i128 as TryFrom<isize>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#361)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<isize> for i16
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#361)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: isize) -> Result<i16, <i16 as TryFrom<isize>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#361)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<isize> for i32
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#361)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: isize) -> Result<i32, <i32 as TryFrom<isize>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#362)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<isize> for i64
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#362)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(value: isize) -> Result<i64, <i64 as TryFrom<isize>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#361)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<isize> for i8
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#361)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: isize) -> Result<i8, <i8 as TryFrom<isize>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#360)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<isize> for u128
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#360)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: isize) -> Result<u128, <u128 as TryFrom<isize>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#359)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<isize> for u16
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#359)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: isize) -> Result<u16, <u16 as TryFrom<isize>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#359)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<isize> for u32
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#359)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: isize) -> Result<u32, <u32 as TryFrom<isize>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#360)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<isize> for u64
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#360)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: isize) -> Result<u64, <u64 as TryFrom<isize>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#359)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<isize> for u8
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#359)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: isize) -> Result<u8, <u8 as TryFrom<isize>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#298)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<isize> for usize
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#298)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: isize) -> Result<usize, <usize as TryFrom<isize>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#370)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<u128> for isize
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#370)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: u128) -> Result<isize, <isize as TryFrom<u128>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#369)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<u16> for isize
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#369)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(value: u16) -> Result<isize, <isize as TryFrom<u16>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#369)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<u32> for isize
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#369)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(value: u32) -> Result<isize, <isize as TryFrom<u32>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#370)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<u64> for isize
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#370)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: u64) -> Result<isize, <isize as TryFrom<u64>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#297)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<usize> for isize
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#297)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: usize) -> Result<isize, <isize as TryFrom<usize>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### type Error = TryFromIntError
The type returned in the event of a conversion error.
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#465-468)1.42.0 · ### impl UpperExp for isize
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#465-468)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error>
Formats the value using the given formatter.
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#174)### impl UpperHex for isize
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#174)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error>
Formats the value using the given formatter.
[source](https://doc.rust-lang.org/src/core/marker.rs.html#830-835)### impl Copy for isize
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1377)### impl Eq for isize
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#38)### impl FloatToInt<isize> for f32
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#39)### impl FloatToInt<isize> for f64
[source](https://doc.rust-lang.org/src/core/up/up/portable-simd/crates/core_simd/src/masks.rs.html#80)### impl MaskElement for isize
[source](https://doc.rust-lang.org/src/core/iter/range.rs.html#17)### impl TrustedStep for isize
Auto Trait Implementations
--------------------------
### impl RefUnwindSafe for isize
### impl Send for isize
### impl Sync for isize
### impl Unpin for isize
### impl UnwindSafe for isize
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 Keyword while Keyword while
=============
Loop while a condition is upheld.
A `while` expression is used for predicate loops. The `while` expression runs the conditional expression before running the loop body, then runs the loop body if the conditional expression evaluates to `true`, or exits the loop otherwise.
```
let mut counter = 0;
while counter < 10 {
println!("{counter}");
counter += 1;
}
```
Like the [`for`](keyword.for) expression, we can use `break` and `continue`. A `while` expression cannot break with a value and always evaluates to `()` unlike [`loop`](keyword.loop).
```
let mut i = 1;
while i < 100 {
i *= 2;
if i == 64 {
break; // Exit when `i` is 64.
}
}
```
As `if` expressions have their pattern matching variant in `if let`, so too do `while` expressions with `while let`. The `while let` expression matches the pattern against the expression, then runs the loop body if pattern matching succeeds, or exits the loop otherwise. We can use `break` and `continue` in `while let` expressions just like in `while`.
```
let mut counter = Some(0);
while let Some(i) = counter {
if i == 10 {
counter = None;
} else {
println!("{i}");
counter = Some (i + 1);
}
}
```
For more information on `while` and loops in general, see the [reference](../reference/expressions/loop-expr#predicate-loops).
See also, [`for`](keyword.for), [`loop`](keyword.loop).
rust Macro std::line Macro std::line
===============
```
macro_rules! line {
() => { ... };
}
```
Expands to the line number on which it was invoked.
With [`column!`](macro.column "column!") and [`file!`](macro.file "file!"), these macros provide debugging information for developers about the location within the source.
The expanded expression has type `u32` and is 1-based, so the first line in each file evaluates to 1, the second to 2, etc. This is consistent with error messages by common compilers or popular editors. The returned line is *not necessarily* the line of the `line!` invocation itself, but rather the first macro invocation leading up to the invocation of the `line!` macro.
Examples
--------
```
let current_line = line!();
println!("defined on line: {current_line}");
```
rust Primitive Type never Primitive Type never
====================
🔬This is a nightly-only experimental API. (`never_type` [#35121](https://github.com/rust-lang/rust/issues/35121))
The `!` type, also called “never”.
`!` represents the type of computations which never resolve to any value at all. For example, the [`exit`](process/fn.exit) function `fn exit(code: i32) -> !` exits the process without ever returning, and so returns `!`.
`break`, `continue` and `return` expressions also have type `!`. For example we are allowed to write:
```
#![feature(never_type)]
let x: ! = {
return 123
};
```
Although the `let` is pointless here, it illustrates the meaning of `!`. Since `x` is never assigned a value (because `return` returns from the entire function), `x` can be given type `!`. We could also replace `return 123` with a `panic!` or a never-ending `loop` and this code would still be valid.
A more realistic usage of `!` is in this code:
```
let num: u32 = match get_a_number() {
Some(num) => num,
None => break,
};
```
Both match arms must produce values of type [`u32`](primitive.u32), but since `break` never produces a value at all we know it can never produce a value which isn’t a [`u32`](primitive.u32). This illustrates another behaviour of the `!` type - expressions with type `!` will coerce into any other type.
`!` and generics
-----------------
### Infallible errors
The main place you’ll see `!` used explicitly is in generic code. Consider the [`FromStr`](str/trait.fromstr) trait:
```
trait FromStr: Sized {
type Err;
fn from_str(s: &str) -> Result<Self, Self::Err>;
}
```
When implementing this trait for [`String`](string/struct.string) we need to pick a type for [`Err`](result/enum.result#variant.Err "Err"). And since converting a string into a string will never result in an error, the appropriate type is `!`. (Currently the type actually used is an enum with no variants, though this is only because `!` was added to Rust at a later date and it may change in the future.) With an [`Err`](result/enum.result#variant.Err "Err") type of `!`, if we have to call [`String::from_str`](str/trait.fromstr#tymethod.from_str) for some reason the result will be a [`Result<String, !>`](result/enum.result "Result<String, !>") which we can unpack like this:
```
#![feature(exhaustive_patterns)]
use std::str::FromStr;
let Ok(s) = String::from_str("hello");
```
Since the [`Err`](result/enum.result#variant.Err "Err") variant contains a `!`, it can never occur. If the `exhaustive_patterns` feature is present this means we can exhaustively match on [`Result<T, !>`](result/enum.result "Result<T, !>") by just taking the [`Ok`](result/enum.result#variant.Ok "Ok") variant. This illustrates another behaviour of `!` - it can be used to “delete” certain enum variants from generic types like `Result`.
### Infinite loops
While [`Result<T, !>`](result/enum.result "Result<T, !>") is very useful for removing errors, `!` can also be used to remove successes as well. If we think of [`Result<T, !>`](result/enum.result "Result<T, !>") as “if this function returns, it has not errored,” we get a very intuitive idea of [`Result<!, E>`](result/enum.result "Result<!, E>") as well: if the function returns, it *has* errored.
For example, consider the case of a simple web server, which can be simplified to:
ⓘ
```
loop {
let (client, request) = get_request().expect("disconnected");
let response = request.process();
response.send(client);
}
```
Currently, this isn’t ideal, because we simply panic whenever we fail to get a new connection. Instead, we’d like to keep track of this error, like this:
ⓘ
```
loop {
match get_request() {
Err(err) => break err,
Ok((client, request)) => {
let response = request.process();
response.send(client);
},
}
}
```
Now, when the server disconnects, we exit the loop with an error instead of panicking. While it might be intuitive to simply return the error, we might want to wrap it in a [`Result<!, E>`](result/enum.result "Result<!, E>") instead:
ⓘ
```
fn server_loop() -> Result<!, ConnectionError> {
loop {
let (client, request) = get_request()?;
let response = request.process();
response.send(client);
}
}
```
Now, we can use `?` instead of `match`, and the return type makes a lot more sense: if the loop ever stops, it means that an error occurred. We don’t even have to wrap the loop in an `Ok` because `!` coerces to `Result<!, ConnectionError>` automatically.
`!` and traits
---------------
When writing your own traits, `!` should have an `impl` whenever there is an obvious `impl` which doesn’t `panic!`. The reason is that functions returning an `impl Trait` where `!` does not have an `impl` of `Trait` cannot diverge as their only possible code path. In other words, they can’t return `!` from every code path. As an example, this code doesn’t compile:
ⓘ
```
use std::ops::Add;
fn foo() -> impl Add<u32> {
unimplemented!()
}
```
But this code does:
```
use std::ops::Add;
fn foo() -> impl Add<u32> {
if true {
unimplemented!()
} else {
0
}
}
```
The reason is that, in the first example, there are many possible types that `!` could coerce to, because many types implement `Add<u32>`. However, in the second example, the `else` branch returns a `0`, which the compiler infers from the return type to be of type `u32`. Since `u32` is a concrete type, `!` can and will be coerced to it. See issue [#36375](https://github.com/rust-lang/rust/issues/36375) for more information on this quirk of `!`.
As it turns out, though, most traits can have an `impl` for `!`. Take [`Debug`](fmt/trait.debug) for example:
```
#![feature(never_type)]
impl Debug for ! {
fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result {
*self
}
}
```
Once again we’re using `!`’s ability to coerce into any other type, in this case [`fmt::Result`](fmt/type.result "fmt::Result"). Since this method takes a `&!` as an argument we know that it can never be called (because there is no value of type `!` for it to be called with). Writing `*self` essentially tells the compiler “We know that this code can never be run, so just treat the entire function body as having type [`fmt::Result`](fmt/type.result "fmt::Result")”. This pattern can be used a lot when implementing traits for `!`. Generally, any trait which only has methods which take a `self` parameter should have such an impl.
On the other hand, one trait which would not be appropriate to implement is [`Default`](default/trait.default "Default"):
```
trait Default {
fn default() -> Self;
}
```
Since `!` has no values, it has no default value either. It’s true that we could write an `impl` for this which simply panics, but the same is true for any type (we could `impl Default` for (eg.) [`File`](fs/struct.file) by just making [`default()`](default/trait.default#tymethod.default) panic.)
Trait Implementations
---------------------
[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#208)const: [unstable](https://github.com/rust-lang/rust/issues/91805 "Tracking issue for const_clone") · #### fn clone(&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)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/fmt/mod.rs.html#2379)### impl Debug for !
[source](https://doc.rust-lang.org/src/core/fmt/mod.rs.html#2380)#### fn fmt(&self, &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/fmt/mod.rs.html#2386)### impl Display for !
[source](https://doc.rust-lang.org/src/core/fmt/mod.rs.html#2387)#### fn fmt(&self, &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#215)### impl Error for !
[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/convert/mod.rs.html#755)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert")) · ### impl From<!> for Infallible
[source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#756)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn from(x: !) -> Infallible
Converts to this type from the input type.
[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/hash/mod.rs.html#869)1.29.0 · ### impl Hash for !
[source](https://doc.rust-lang.org/src/core/hash/mod.rs.html#871)#### fn hash<H>(&self, &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/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 = !
The resulting type after applying the `!` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#77)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn not(self) -> !
Performs the unary `!` operation. [Read more](ops/trait.not#tymethod.not)
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1509)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · ### impl Ord for !
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1510)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · #### fn cmp(&self, &!) -> 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/cmp.rs.html#1490)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · ### impl PartialEq<!> for !
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1491)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · #### fn eq(&self, &!) -> 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/cmp.rs.html#1501)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · ### impl PartialOrd<!> for !
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1502)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · #### fn partial\_cmp(&self, &!) -> 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/process.rs.html#2176-2180)1.61.0 · ### impl Termination for !
[source](https://doc.rust-lang.org/src/std/process.rs.html#2177-2179)#### fn report(self) -> ExitCode
Is called to get the representation of the value as status code. This status code is returned to the operating system. [Read more](process/trait.termination#tymethod.report)
[source](https://doc.rust-lang.org/src/core/marker.rs.html#838)### impl Copy for !
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1497)### impl Eq for !
Blanket Implementations
-----------------------
[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.
rust Macro std::eprint Macro std::eprint
=================
```
macro_rules! eprint {
($($arg:tt)*) => { ... };
}
```
Prints to the standard error.
Equivalent to the [`print!`](macro.print "print!") macro, except that output goes to [`io::stderr`](io/fn.stderr) instead of [`io::stdout`](io/fn.stdout). See [`print!`](macro.print "print!") for example usage.
Use `eprint!` only for error and progress messages. Use `print!` instead for the primary output of your program.
Panics
------
Panics if writing to `io::stderr` fails.
Writing to non-blocking stdout can cause an error, which will lead this macro to panic.
Examples
--------
```
eprint!("Error: Could not complete task");
```
rust Macro std::const_format_args Macro std::const\_format\_args
==============================
```
macro_rules! const_format_args {
($fmt:expr) => { ... };
($fmt:expr, $($args:tt)*) => { ... };
}
```
🔬This is a nightly-only experimental API. (`const_format_args`)
Same as [`format_args`](macro.format_args "format_args"), but can be used in some const contexts.
This macro is used by the panic macros for the `const_panic` feature.
This macro will be removed once `format_args` is allowed in const contexts.
rust Keyword for Keyword for
===========
Iteration with [`in`](keyword.in), trait implementation with [`impl`](keyword.impl), or [higher-ranked trait bounds](../reference/trait-bounds#higher-ranked-trait-bounds) (`for<'a>`).
The `for` keyword is used in many syntactic locations:
* `for` is used in for-in-loops (see below).
* `for` is used when implementing traits as in `impl Trait for Type` (see [`impl`](keyword.impl) for more info on that).
* `for` is also used for [higher-ranked trait bounds](../reference/trait-bounds#higher-ranked-trait-bounds) as in `for<'a> &'a T: PartialEq<i32>`.
for-in-loops, or to be more precise, iterator loops, are a simple syntactic sugar over a common practice within Rust, which is to loop over anything that implements [`IntoIterator`](iter/trait.intoiterator "IntoIterator") until the iterator returned by `.into_iter()` returns `None` (or the loop body uses `break`).
```
for i in 0..5 {
println!("{}", i * 2);
}
for i in std::iter::repeat(5) {
println!("turns out {i} never stops being 5");
break; // would loop forever otherwise
}
'outer: for x in 5..50 {
for y in 0..10 {
if x == y {
break 'outer;
}
}
}
```
As shown in the example above, `for` loops (along with all other loops) can be tagged, using similar syntax to lifetimes (only visually similar, entirely distinct in practice). Giving the same tag to `break` breaks the tagged loop, which is useful for inner loops. It is definitely not a goto.
A `for` loop expands as shown:
```
for loop_variable in iterator {
code()
}
```
```
{
let result = match IntoIterator::into_iter(iterator) {
mut iter => loop {
match iter.next() {
None => break,
Some(loop_variable) => { code(); },
};
},
};
result
}
```
More details on the functionality shown can be seen at the [`IntoIterator`](iter/trait.intoiterator "IntoIterator") docs.
For more information on for-loops, see the [Rust book](../book/ch03-05-control-flow#looping-through-a-collection-with-for) or the [Reference](../reference/expressions/loop-expr#iterator-loops).
See also, [`loop`](keyword.loop), [`while`](keyword.while).
| programming_docs |
rust Macro std::unreachable Macro std::unreachable
======================
```
macro_rules! unreachable {
($($arg:tt)*) => { ... };
}
```
Indicates unreachable code.
This is useful any time that the compiler can’t determine that some code is unreachable. For example:
* Match arms with guard conditions.
* Loops that dynamically terminate.
* Iterators that dynamically terminate.
If the determination that the code is unreachable proves incorrect, the program immediately terminates with a [`panic!`](https://doc.rust-lang.org/core/macro.panic.html "panic!").
The unsafe counterpart of this macro is the [`unreachable_unchecked`](hint/fn.unreachable_unchecked) function, which will cause undefined behavior if the code is reached.
Panics
------
This will always [`panic!`](https://doc.rust-lang.org/core/macro.panic.html "panic!") because `unreachable!` is just a shorthand for `panic!` with a fixed, specific message.
Like `panic!`, this macro has a second form for displaying custom values.
Examples
--------
Match arms:
```
fn foo(x: Option<i32>) {
match x {
Some(n) if n >= 0 => println!("Some(Non-negative)"),
Some(n) if n < 0 => println!("Some(Negative)"),
Some(_) => unreachable!(), // compile error if commented out
None => println!("None")
}
}
```
Iterators:
```
fn divide_by_three(x: u32) -> u32 { // one of the poorest implementations of x/3
for i in 0.. {
if 3*i < i { panic!("u32 overflow"); }
if x < 3*i { return i-1; }
}
unreachable!("The loop should always return");
}
```
rust Macro std::stringify Macro std::stringify
====================
```
macro_rules! stringify {
($($t:tt)*) => { ... };
}
```
Stringifies its arguments.
This macro will yield an expression of type `&'static str` which is the stringification of all the tokens passed to the macro. No restrictions are placed on the syntax of the macro invocation itself.
Note that the expanded results of the input tokens may change in the future. You should be careful if you rely on the output.
Examples
--------
```
let one_plus_one = stringify!(1 + 1);
assert_eq!(one_plus_one, "1 + 1");
```
rust Macro std::debug_assert_eq Macro std::debug\_assert\_eq
============================
```
macro_rules! debug_assert_eq {
($($arg:tt)*) => { ... };
}
```
Asserts that two expressions are equal to each other.
On panic, this macro will print the values of the expressions with their debug representations.
Unlike [`assert_eq!`](macro.assert_eq "assert_eq!"), `debug_assert_eq!` statements are only enabled in non optimized builds by default. An optimized build will not execute `debug_assert_eq!` statements unless `-C debug-assertions` is passed to the compiler. This makes `debug_assert_eq!` useful for checks that are too expensive to be present in a release build but may be helpful during development. The result of expanding `debug_assert_eq!` is always type checked.
Examples
--------
```
let a = 3;
let b = 1 + 2;
debug_assert_eq!(a, b);
```
rust Macro std::println Macro std::println
==================
```
macro_rules! println {
() => { ... };
($($arg:tt)*) => { ... };
}
```
Prints to the standard output, with a newline.
On all platforms, the newline is the LINE FEED character (`\n`/`U+000A`) alone (no additional CARRIAGE RETURN (`\r`/`U+000D`)).
This macro uses the same syntax as [`format!`](macro.format "format!"), but writes to the standard output instead. See [`std::fmt`](fmt/index) for more information.
The `println!` macro will lock the standard output on each call. If you call `println!` within a hot loop, this behavior may be the bottleneck of the loop. To avoid this, lock stdout with [`io::stdout().lock()`](io/struct.stdout):
```
use std::io::{stdout, Write};
let mut lock = stdout().lock();
writeln!(lock, "hello world").unwrap();
```
Use `println!` only for the primary output of your program. Use [`eprintln!`](macro.eprintln) instead to print error and progress messages.
Panics
------
Panics if writing to [`io::stdout`](io/fn.stdout) fails.
Writing to non-blocking stdout can cause an error, which will lead this macro to panic.
Examples
--------
```
println!(); // prints just a newline
println!("hello there!");
println!("format {} arguments", "some");
let local_variable = "some";
println!("format {local_variable} arguments");
```
rust Primitive Type u16 Primitive Type u16
==================
The 16-bit unsigned integer type.
Implementations
---------------
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#826)### impl u16
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#827-828)1.43.0 · #### pub const MIN: u16 = 0u16
The smallest value that can be represented by this integer type.
##### Examples
Basic usage:
```
assert_eq!(u16::MIN, 0);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#827-828)1.43.0 · #### pub const MAX: u16 = 65\_535u16
The largest value that can be represented by this integer type (216 − 1)
##### Examples
Basic usage:
```
assert_eq!(u16::MAX, 65535);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#827-828)1.53.0 · #### pub const BITS: u32 = 16u32
The size of this integer type in bits.
##### Examples
```
assert_eq!(u16::BITS, 16);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#827-828)#### pub fn from\_str\_radix(src: &str, radix: u32) -> Result<u16, ParseIntError>
Converts a string slice in a given base to an integer.
The string is expected to be an optional `+` sign followed by digits. Leading and trailing whitespace represent an error. Digits are a subset of these characters, depending on `radix`:
* `0-9`
* `a-z`
* `A-Z`
##### Panics
This function panics if `radix` is not in the range from 2 to 36.
##### Examples
Basic usage:
```
assert_eq!(u16::from_str_radix("A", 16), Ok(10));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#827-828)const: 1.32.0 · #### pub const fn count\_ones(self) -> u32
Returns the number of ones in the binary representation of `self`.
##### Examples
Basic usage:
```
let n = 0b01001100u16;
assert_eq!(n.count_ones(), 3);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#827-828)const: 1.32.0 · #### pub const fn count\_zeros(self) -> u32
Returns the number of zeros in the binary representation of `self`.
##### Examples
Basic usage:
```
assert_eq!(u16::MAX.count_zeros(), 0);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#827-828)const: 1.32.0 · #### pub const fn leading\_zeros(self) -> u32
Returns the number of leading zeros in the binary representation of `self`.
##### Examples
Basic usage:
```
let n = u16::MAX >> 2;
assert_eq!(n.leading_zeros(), 2);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#827-828)const: 1.32.0 · #### pub const fn trailing\_zeros(self) -> u32
Returns the number of trailing zeros in the binary representation of `self`.
##### Examples
Basic usage:
```
let n = 0b0101000u16;
assert_eq!(n.trailing_zeros(), 3);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#827-828)1.46.0 (const: 1.46.0) · #### pub const fn leading\_ones(self) -> u32
Returns the number of leading ones in the binary representation of `self`.
##### Examples
Basic usage:
```
let n = !(u16::MAX >> 2);
assert_eq!(n.leading_ones(), 2);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#827-828)1.46.0 (const: 1.46.0) · #### pub const fn trailing\_ones(self) -> u32
Returns the number of trailing ones in the binary representation of `self`.
##### Examples
Basic usage:
```
let n = 0b1010111u16;
assert_eq!(n.trailing_ones(), 3);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#827-828)const: 1.32.0 · #### pub const fn rotate\_left(self, n: u32) -> u16
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:
```
let n = 0xa003u16;
let m = 0x3a;
assert_eq!(n.rotate_left(4), m);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#827-828)const: 1.32.0 · #### pub const fn rotate\_right(self, n: u32) -> u16
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:
```
let n = 0x3au16;
let m = 0xa003;
assert_eq!(n.rotate_right(4), m);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#827-828)const: 1.32.0 · #### pub const fn swap\_bytes(self) -> u16
Reverses the byte order of the integer.
##### Examples
Basic usage:
```
let n = 0x1234u16;
let m = n.swap_bytes();
assert_eq!(m, 0x3412);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#827-828)1.37.0 (const: 1.37.0) · #### pub const fn reverse\_bits(self) -> u16
Reverses the order of bits in the integer. The least significant bit becomes the most significant bit, second least-significant bit becomes second most-significant bit, etc.
##### Examples
Basic usage:
```
let n = 0x1234u16;
let m = n.reverse_bits();
assert_eq!(m, 0x2c48);
assert_eq!(0, 0u16.reverse_bits());
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#827-828)const: 1.32.0 · #### pub const fn from\_be(x: u16) -> u16
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:
```
let n = 0x1Au16;
if cfg!(target_endian = "big") {
assert_eq!(u16::from_be(n), n)
} else {
assert_eq!(u16::from_be(n), n.swap_bytes())
}
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#827-828)const: 1.32.0 · #### pub const fn from\_le(x: u16) -> u16
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:
```
let n = 0x1Au16;
if cfg!(target_endian = "little") {
assert_eq!(u16::from_le(n), n)
} else {
assert_eq!(u16::from_le(n), n.swap_bytes())
}
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#827-828)const: 1.32.0 · #### pub const fn to\_be(self) -> u16
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:
```
let n = 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/mod.rs.html#827-828)const: 1.32.0 · #### pub const fn to\_le(self) -> u16
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:
```
let n = 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/mod.rs.html#827-828)const: 1.47.0 · #### pub const fn checked\_add(self, rhs: u16) -> Option<u16>
Checked integer addition. Computes `self + rhs`, returning `None` if overflow occurred.
##### Examples
Basic usage:
```
assert_eq!((u16::MAX - 2).checked_add(1), Some(u16::MAX - 1));
assert_eq!((u16::MAX - 2).checked_add(3), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#827-828)const: [unstable](https://github.com/rust-lang/rust/issues/85122 "Tracking issue for const_inherent_unchecked_arith") · #### pub unsafe fn unchecked\_add(self, rhs: u16) -> u16
🔬This is a nightly-only experimental API. (`unchecked_math` [#85122](https://github.com/rust-lang/rust/issues/85122))
Unchecked integer addition. Computes `self + rhs`, assuming overflow cannot occur.
##### Safety
This results in undefined behavior when `self + rhs > u16::MAX` or `self + rhs < u16::MIN`, i.e. when [`checked_add`](primitive.u16#method.checked_add) would return `None`.
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#827-828)const: [unstable](https://github.com/rust-lang/rust/issues/87840 "Tracking issue for mixed_integer_ops") · #### pub fn checked\_add\_signed(self, rhs: i16) -> Option<u16>
🔬This is a nightly-only experimental API. (`mixed_integer_ops` [#87840](https://github.com/rust-lang/rust/issues/87840))
Checked addition with a signed integer. Computes `self + rhs`, returning `None` if overflow occurred.
##### Examples
Basic usage:
```
assert_eq!(1u16.checked_add_signed(2), Some(3));
assert_eq!(1u16.checked_add_signed(-2), None);
assert_eq!((u16::MAX - 2).checked_add_signed(3), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#827-828)const: 1.47.0 · #### pub const fn checked\_sub(self, rhs: u16) -> Option<u16>
Checked integer subtraction. Computes `self - rhs`, returning `None` if overflow occurred.
##### Examples
Basic usage:
```
assert_eq!(1u16.checked_sub(1), Some(0));
assert_eq!(0u16.checked_sub(1), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#827-828)const: [unstable](https://github.com/rust-lang/rust/issues/85122 "Tracking issue for const_inherent_unchecked_arith") · #### pub unsafe fn unchecked\_sub(self, rhs: u16) -> u16
🔬This is a nightly-only experimental API. (`unchecked_math` [#85122](https://github.com/rust-lang/rust/issues/85122))
Unchecked integer subtraction. Computes `self - rhs`, assuming overflow cannot occur.
##### Safety
This results in undefined behavior when `self - rhs > u16::MAX` or `self - rhs < u16::MIN`, i.e. when [`checked_sub`](primitive.u16#method.checked_sub) would return `None`.
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#827-828)const: 1.47.0 · #### pub const fn checked\_mul(self, rhs: u16) -> Option<u16>
Checked integer multiplication. Computes `self * rhs`, returning `None` if overflow occurred.
##### Examples
Basic usage:
```
assert_eq!(5u16.checked_mul(1), Some(5));
assert_eq!(u16::MAX.checked_mul(2), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#827-828)const: [unstable](https://github.com/rust-lang/rust/issues/85122 "Tracking issue for const_inherent_unchecked_arith") · #### pub unsafe fn unchecked\_mul(self, rhs: u16) -> u16
🔬This is a nightly-only experimental API. (`unchecked_math` [#85122](https://github.com/rust-lang/rust/issues/85122))
Unchecked integer multiplication. Computes `self * rhs`, assuming overflow cannot occur.
##### Safety
This results in undefined behavior when `self * rhs > u16::MAX` or `self * rhs < u16::MIN`, i.e. when [`checked_mul`](primitive.u16#method.checked_mul) would return `None`.
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#827-828)const: 1.52.0 · #### pub const fn checked\_div(self, rhs: u16) -> Option<u16>
Checked integer division. Computes `self / rhs`, returning `None` if `rhs == 0`.
##### Examples
Basic usage:
```
assert_eq!(128u16.checked_div(2), Some(64));
assert_eq!(1u16.checked_div(0), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#827-828)1.38.0 (const: 1.52.0) · #### pub const fn checked\_div\_euclid(self, rhs: u16) -> Option<u16>
Checked Euclidean division. Computes `self.div_euclid(rhs)`, returning `None` if `rhs == 0`.
##### Examples
Basic usage:
```
assert_eq!(128u16.checked_div_euclid(2), Some(64));
assert_eq!(1u16.checked_div_euclid(0), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#827-828)1.7.0 (const: 1.52.0) · #### pub const fn checked\_rem(self, rhs: u16) -> Option<u16>
Checked integer remainder. Computes `self % rhs`, returning `None` if `rhs == 0`.
##### Examples
Basic usage:
```
assert_eq!(5u16.checked_rem(2), Some(1));
assert_eq!(5u16.checked_rem(0), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#827-828)1.38.0 (const: 1.52.0) · #### pub const fn checked\_rem\_euclid(self, rhs: u16) -> Option<u16>
Checked Euclidean modulo. Computes `self.rem_euclid(rhs)`, returning `None` if `rhs == 0`.
##### Examples
Basic usage:
```
assert_eq!(5u16.checked_rem_euclid(2), Some(1));
assert_eq!(5u16.checked_rem_euclid(0), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#827-828)#### pub const fn ilog(self, base: u16) -> u32
🔬This is a nightly-only experimental API. (`int_log` [#70887](https://github.com/rust-lang/rust/issues/70887))
Returns the logarithm of the number with respect to an arbitrary base, rounded down.
This method might not be optimized owing to implementation details; `ilog2` can produce results more efficiently for base 2, and `ilog10` can produce results more efficiently for base 10.
##### Panics
When the number is zero, or if the base is not at least 2; it panics in debug mode and the return value is 0 in release mode.
##### Examples
```
#![feature(int_log)]
assert_eq!(5u16.ilog(5), 1);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#827-828)#### 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.
##### Panics
When the number is zero it panics in debug mode and the return value is 0 in release mode.
##### Examples
```
#![feature(int_log)]
assert_eq!(2u16.ilog2(), 1);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#827-828)#### 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.
##### Panics
When the number is zero it panics in debug mode and the return value is 0 in release mode.
##### Example
```
#![feature(int_log)]
assert_eq!(10u16.ilog10(), 1);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#827-828)#### pub const fn checked\_ilog(self, base: u16) -> Option<u32>
🔬This is a nightly-only experimental API. (`int_log` [#70887](https://github.com/rust-lang/rust/issues/70887))
Returns the logarithm of the number with respect to an arbitrary base, rounded down.
Returns `None` if the number is zero, or if the base is not at least 2.
This method might not be optimized owing to implementation details; `checked_ilog2` can produce results more efficiently for base 2, and `checked_ilog10` can produce results more efficiently for base 10.
##### Examples
```
#![feature(int_log)]
assert_eq!(5u16.checked_ilog(5), Some(1));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#827-828)#### pub const fn checked\_ilog2(self) -> Option<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.
Returns `None` if the number is zero.
##### Examples
```
#![feature(int_log)]
assert_eq!(2u16.checked_ilog2(), Some(1));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#827-828)#### pub const fn checked\_ilog10(self) -> Option<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.
Returns `None` if the number is zero.
##### Examples
```
#![feature(int_log)]
assert_eq!(10u16.checked_ilog10(), Some(1));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#827-828)1.7.0 (const: 1.47.0) · #### pub const fn checked\_neg(self) -> Option<u16>
Checked negation. Computes `-self`, returning `None` unless `self == 0`.
Note that negating any positive integer will overflow.
##### Examples
Basic usage:
```
assert_eq!(0u16.checked_neg(), Some(0));
assert_eq!(1u16.checked_neg(), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#827-828)1.7.0 (const: 1.47.0) · #### pub const fn checked\_shl(self, rhs: u32) -> Option<u16>
Checked shift left. Computes `self << rhs`, returning `None` if `rhs` is larger than or equal to the number of bits in `self`.
##### Examples
Basic usage:
```
assert_eq!(0x1u16.checked_shl(4), Some(0x10));
assert_eq!(0x10u16.checked_shl(129), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#827-828)const: [unstable](https://github.com/rust-lang/rust/issues/85122 "Tracking issue for const_inherent_unchecked_arith") · #### pub unsafe fn unchecked\_shl(self, rhs: u16) -> u16
🔬This is a nightly-only experimental API. (`unchecked_math` [#85122](https://github.com/rust-lang/rust/issues/85122))
Unchecked shift left. Computes `self << rhs`, assuming that `rhs` is less than the number of bits in `self`.
##### Safety
This results in undefined behavior if `rhs` is larger than or equal to the number of bits in `self`, i.e. when [`checked_shl`](primitive.u16#method.checked_shl) would return `None`.
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#827-828)1.7.0 (const: 1.47.0) · #### pub const fn checked\_shr(self, rhs: u32) -> Option<u16>
Checked shift right. Computes `self >> rhs`, returning `None` if `rhs` is larger than or equal to the number of bits in `self`.
##### Examples
Basic usage:
```
assert_eq!(0x10u16.checked_shr(4), Some(0x1));
assert_eq!(0x10u16.checked_shr(129), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#827-828)const: [unstable](https://github.com/rust-lang/rust/issues/85122 "Tracking issue for const_inherent_unchecked_arith") · #### pub unsafe fn unchecked\_shr(self, rhs: u16) -> u16
🔬This is a nightly-only experimental API. (`unchecked_math` [#85122](https://github.com/rust-lang/rust/issues/85122))
Unchecked shift right. Computes `self >> rhs`, assuming that `rhs` is less than the number of bits in `self`.
##### Safety
This results in undefined behavior if `rhs` is larger than or equal to the number of bits in `self`, i.e. when [`checked_shr`](primitive.u16#method.checked_shr) would return `None`.
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#827-828)1.34.0 (const: 1.50.0) · #### pub const fn checked\_pow(self, exp: u32) -> Option<u16>
Checked exponentiation. Computes `self.pow(exp)`, returning `None` if overflow occurred.
##### Examples
Basic usage:
```
assert_eq!(2u16.checked_pow(5), Some(32));
assert_eq!(u16::MAX.checked_pow(2), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#827-828)const: 1.47.0 · #### pub const fn saturating\_add(self, rhs: u16) -> u16
Saturating integer addition. Computes `self + rhs`, saturating at the numeric bounds instead of overflowing.
##### Examples
Basic usage:
```
assert_eq!(100u16.saturating_add(1), 101);
assert_eq!(u16::MAX.saturating_add(127), u16::MAX);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#827-828)const: [unstable](https://github.com/rust-lang/rust/issues/87840 "Tracking issue for mixed_integer_ops") · #### pub fn saturating\_add\_signed(self, rhs: i16) -> u16
🔬This is a nightly-only experimental API. (`mixed_integer_ops` [#87840](https://github.com/rust-lang/rust/issues/87840))
Saturating addition with a signed integer. Computes `self + rhs`, saturating at the numeric bounds instead of overflowing.
##### Examples
Basic usage:
```
assert_eq!(1u16.saturating_add_signed(2), 3);
assert_eq!(1u16.saturating_add_signed(-2), 0);
assert_eq!((u16::MAX - 2).saturating_add_signed(4), u16::MAX);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#827-828)const: 1.47.0 · #### pub const fn saturating\_sub(self, rhs: u16) -> u16
Saturating integer subtraction. Computes `self - rhs`, saturating at the numeric bounds instead of overflowing.
##### Examples
Basic usage:
```
assert_eq!(100u16.saturating_sub(27), 73);
assert_eq!(13u16.saturating_sub(127), 0);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#827-828)1.7.0 (const: 1.47.0) · #### pub const fn saturating\_mul(self, rhs: u16) -> u16
Saturating integer multiplication. Computes `self * rhs`, saturating at the numeric bounds instead of overflowing.
##### Examples
Basic usage:
```
assert_eq!(2u16.saturating_mul(10), 20);
assert_eq!((u16::MAX).saturating_mul(10), u16::MAX);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#827-828)1.58.0 (const: 1.58.0) · #### pub const fn saturating\_div(self, rhs: u16) -> u16
Saturating integer division. Computes `self / rhs`, saturating at the numeric bounds instead of overflowing.
##### Examples
Basic usage:
```
assert_eq!(5u16.saturating_div(2), 2);
```
ⓘ
```
let _ = 1u16.saturating_div(0);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#827-828)1.34.0 (const: 1.50.0) · #### pub const fn saturating\_pow(self, exp: u32) -> u16
Saturating integer exponentiation. Computes `self.pow(exp)`, saturating at the numeric bounds instead of overflowing.
##### Examples
Basic usage:
```
assert_eq!(4u16.saturating_pow(3), 64);
assert_eq!(u16::MAX.saturating_pow(2), u16::MAX);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#827-828)const: 1.32.0 · #### pub const fn wrapping\_add(self, rhs: u16) -> u16
Wrapping (modular) addition. Computes `self + rhs`, wrapping around at the boundary of the type.
##### Examples
Basic usage:
```
assert_eq!(200u16.wrapping_add(55), 255);
assert_eq!(200u16.wrapping_add(u16::MAX), 199);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#827-828)const: [unstable](https://github.com/rust-lang/rust/issues/87840 "Tracking issue for mixed_integer_ops") · #### pub fn wrapping\_add\_signed(self, rhs: i16) -> u16
🔬This is a nightly-only experimental API. (`mixed_integer_ops` [#87840](https://github.com/rust-lang/rust/issues/87840))
Wrapping (modular) addition with a signed integer. Computes `self + rhs`, wrapping around at the boundary of the type.
##### Examples
Basic usage:
```
assert_eq!(1u16.wrapping_add_signed(2), 3);
assert_eq!(1u16.wrapping_add_signed(-2), u16::MAX);
assert_eq!((u16::MAX - 2).wrapping_add_signed(4), 1);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#827-828)const: 1.32.0 · #### pub const fn wrapping\_sub(self, rhs: u16) -> u16
Wrapping (modular) subtraction. Computes `self - rhs`, wrapping around at the boundary of the type.
##### Examples
Basic usage:
```
assert_eq!(100u16.wrapping_sub(100), 0);
assert_eq!(100u16.wrapping_sub(u16::MAX), 101);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#827-828)const: 1.32.0 · #### pub const fn wrapping\_mul(self, rhs: u16) -> u16
Wrapping (modular) multiplication. Computes `self * rhs`, wrapping around at the boundary of the type.
##### Examples
Basic usage:
Please note that this example is shared between integer types. Which explains why `u8` is used here.
```
assert_eq!(10u8.wrapping_mul(12), 120);
assert_eq!(25u8.wrapping_mul(12), 44);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#827-828)1.2.0 (const: 1.52.0) · #### pub const fn wrapping\_div(self, rhs: u16) -> u16
Wrapping (modular) division. Computes `self / rhs`. Wrapped division on unsigned types is just normal division. There’s no way wrapping could ever happen. This function exists, so that all operations are accounted for in the wrapping operations.
##### Examples
Basic usage:
```
assert_eq!(100u16.wrapping_div(10), 10);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#827-828)1.38.0 (const: 1.52.0) · #### pub const fn wrapping\_div\_euclid(self, rhs: u16) -> u16
Wrapping Euclidean division. Computes `self.div_euclid(rhs)`. Wrapped division on unsigned types is just normal division. There’s no way wrapping could ever happen. This function exists, so that all operations are accounted for in the wrapping operations. Since, for the positive integers, all common definitions of division are equal, this is exactly equal to `self.wrapping_div(rhs)`.
##### Examples
Basic usage:
```
assert_eq!(100u16.wrapping_div_euclid(10), 10);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#827-828)1.2.0 (const: 1.52.0) · #### pub const fn wrapping\_rem(self, rhs: u16) -> u16
Wrapping (modular) remainder. Computes `self % rhs`. Wrapped remainder calculation on unsigned types is just the regular remainder calculation. There’s no way wrapping could ever happen. This function exists, so that all operations are accounted for in the wrapping operations.
##### Examples
Basic usage:
```
assert_eq!(100u16.wrapping_rem(10), 0);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#827-828)1.38.0 (const: 1.52.0) · #### pub const fn wrapping\_rem\_euclid(self, rhs: u16) -> u16
Wrapping Euclidean modulo. Computes `self.rem_euclid(rhs)`. Wrapped modulo calculation on unsigned types is just the regular remainder calculation. There’s no way wrapping could ever happen. This function exists, so that all operations are accounted for in the wrapping operations. Since, for the positive integers, all common definitions of division are equal, this is exactly equal to `self.wrapping_rem(rhs)`.
##### Examples
Basic usage:
```
assert_eq!(100u16.wrapping_rem_euclid(10), 0);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#827-828)1.2.0 (const: 1.32.0) · #### pub const fn wrapping\_neg(self) -> u16
Wrapping (modular) negation. Computes `-self`, wrapping around at the boundary of the type.
Since unsigned types do not have negative equivalents all applications of this function will wrap (except for `-0`). For values smaller than the corresponding signed type’s maximum the result is the same as casting the corresponding signed value. Any larger values are equivalent to `MAX + 1 - (val - MAX - 1)` where `MAX` is the corresponding signed type’s maximum.
##### Examples
Basic usage:
Please note that this example is shared between integer types. Which explains why `i8` is used here.
```
assert_eq!(100i8.wrapping_neg(), -100);
assert_eq!((-128i8).wrapping_neg(), -128);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#827-828)1.2.0 (const: 1.32.0) · #### pub const fn wrapping\_shl(self, rhs: u32) -> u16
Panic-free bitwise shift-left; yields `self << mask(rhs)`, where `mask` removes any high-order bits of `rhs` that would cause the shift to exceed the bitwidth of the type.
Note that this is *not* the same as a rotate-left; the RHS of a wrapping shift-left is restricted to the range of the type, rather than the bits shifted out of the LHS being returned to the other end. The primitive integer types all implement a [`rotate_left`](primitive.u16#method.rotate_left) function, which may be what you want instead.
##### Examples
Basic usage:
```
assert_eq!(1u16.wrapping_shl(7), 128);
assert_eq!(1u16.wrapping_shl(128), 1);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#827-828)1.2.0 (const: 1.32.0) · #### pub const fn wrapping\_shr(self, rhs: u32) -> u16
Panic-free bitwise shift-right; yields `self >> mask(rhs)`, where `mask` removes any high-order bits of `rhs` that would cause the shift to exceed the bitwidth of the type.
Note that this is *not* the same as a rotate-right; the RHS of a wrapping shift-right is restricted to the range of the type, rather than the bits shifted out of the LHS being returned to the other end. The primitive integer types all implement a [`rotate_right`](primitive.u16#method.rotate_right) function, which may be what you want instead.
##### Examples
Basic usage:
```
assert_eq!(128u16.wrapping_shr(7), 1);
assert_eq!(128u16.wrapping_shr(128), 128);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#827-828)1.34.0 (const: 1.50.0) · #### pub const fn wrapping\_pow(self, exp: u32) -> u16
Wrapping (modular) exponentiation. Computes `self.pow(exp)`, wrapping around at the boundary of the type.
##### Examples
Basic usage:
```
assert_eq!(3u16.wrapping_pow(5), 243);
assert_eq!(3u8.wrapping_pow(6), 217);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#827-828)1.7.0 (const: 1.32.0) · #### pub const fn overflowing\_add(self, rhs: u16) -> (u16, bool)
Calculates `self` + `rhs`
Returns a tuple of the addition along with a boolean indicating whether an arithmetic overflow would occur. If an overflow would have occurred then the wrapped value is returned.
##### Examples
Basic usage
```
assert_eq!(5u16.overflowing_add(2), (7, false));
assert_eq!(u16::MAX.overflowing_add(1), (0, true));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#827-828)const: [unstable](https://github.com/rust-lang/rust/issues/85532 "Tracking issue for const_bigint_helper_methods") · #### pub fn carrying\_add(self, rhs: u16, carry: bool) -> (u16, bool)
🔬This is a nightly-only experimental API. (`bigint_helper_methods` [#85532](https://github.com/rust-lang/rust/issues/85532))
Calculates `self + rhs + carry` without the ability to overflow.
Performs “ternary addition” which takes in an extra bit to add, and may return an additional bit of overflow. This allows for chaining together multiple additions to create “big integers” which represent larger values.
This can be thought of as a 16-bit “full adder”, in the electronics sense.
##### Examples
Basic usage
```
#![feature(bigint_helper_methods)]
assert_eq!(5u16.carrying_add(2, false), (7, false));
assert_eq!(5u16.carrying_add(2, true), (8, false));
assert_eq!(u16::MAX.carrying_add(1, false), (0, true));
assert_eq!(u16::MAX.carrying_add(0, true), (0, true));
assert_eq!(u16::MAX.carrying_add(1, true), (1, true));
assert_eq!(u16::MAX.carrying_add(u16::MAX, true), (u16::MAX, true));
```
If `carry` is false, this method is equivalent to [`overflowing_add`](primitive.u16#method.overflowing_add):
```
#![feature(bigint_helper_methods)]
assert_eq!(5_u16.carrying_add(2, false), 5_u16.overflowing_add(2));
assert_eq!(u16::MAX.carrying_add(1, false), u16::MAX.overflowing_add(1));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#827-828)const: [unstable](https://github.com/rust-lang/rust/issues/87840 "Tracking issue for mixed_integer_ops") · #### pub fn overflowing\_add\_signed(self, rhs: i16) -> (u16, bool)
🔬This is a nightly-only experimental API. (`mixed_integer_ops` [#87840](https://github.com/rust-lang/rust/issues/87840))
Calculates `self` + `rhs` with a signed `rhs`
Returns a tuple of the addition along with a boolean indicating whether an arithmetic overflow would occur. If an overflow would have occurred then the wrapped value is returned.
##### Examples
Basic usage:
```
assert_eq!(1u16.overflowing_add_signed(2), (3, false));
assert_eq!(1u16.overflowing_add_signed(-2), (u16::MAX, true));
assert_eq!((u16::MAX - 2).overflowing_add_signed(4), (1, true));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#827-828)1.7.0 (const: 1.32.0) · #### pub const fn overflowing\_sub(self, rhs: u16) -> (u16, bool)
Calculates `self` - `rhs`
Returns a tuple of the subtraction along with a boolean indicating whether an arithmetic overflow would occur. If an overflow would have occurred then the wrapped value is returned.
##### Examples
Basic usage
```
assert_eq!(5u16.overflowing_sub(2), (3, false));
assert_eq!(0u16.overflowing_sub(1), (u16::MAX, true));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#827-828)const: [unstable](https://github.com/rust-lang/rust/issues/85532 "Tracking issue for const_bigint_helper_methods") · #### pub fn borrowing\_sub(self, rhs: u16, borrow: bool) -> (u16, bool)
🔬This is a nightly-only experimental API. (`bigint_helper_methods` [#85532](https://github.com/rust-lang/rust/issues/85532))
Calculates `self - rhs - borrow` without the ability to overflow.
Performs “ternary subtraction” which takes in an extra bit to subtract, and may return an additional bit of overflow. This allows for chaining together multiple subtractions to create “big integers” which represent larger values.
##### Examples
Basic usage
```
#![feature(bigint_helper_methods)]
assert_eq!(5u16.borrowing_sub(2, false), (3, false));
assert_eq!(5u16.borrowing_sub(2, true), (2, false));
assert_eq!(0u16.borrowing_sub(1, false), (u16::MAX, true));
assert_eq!(0u16.borrowing_sub(1, true), (u16::MAX - 1, true));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#827-828)1.60.0 (const: 1.60.0) · #### pub const fn abs\_diff(self, other: u16) -> u16
Computes the absolute difference between `self` and `other`.
##### Examples
Basic usage:
```
assert_eq!(100u16.abs_diff(80), 20u16);
assert_eq!(100u16.abs_diff(110), 10u16);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#827-828)1.7.0 (const: 1.32.0) · #### pub const fn overflowing\_mul(self, rhs: u16) -> (u16, bool)
Calculates the multiplication of `self` and `rhs`.
Returns a tuple of the multiplication along with a boolean indicating whether an arithmetic overflow would occur. If an overflow would have occurred then the wrapped value is returned.
##### Examples
Basic usage:
Please note that this example is shared between integer types. Which explains why `u32` is used here.
```
assert_eq!(5u32.overflowing_mul(2), (10, false));
assert_eq!(1_000_000_000u32.overflowing_mul(10), (1410065408, true));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#827-828)1.7.0 (const: 1.52.0) · #### pub const fn overflowing\_div(self, rhs: u16) -> (u16, bool)
Calculates the divisor when `self` is divided by `rhs`.
Returns a tuple of the divisor along with a boolean indicating whether an arithmetic overflow would occur. Note that for unsigned integers overflow never occurs, so the second value is always `false`.
##### Panics
This function will panic if `rhs` is 0.
##### Examples
Basic usage
```
assert_eq!(5u16.overflowing_div(2), (2, false));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#827-828)1.38.0 (const: 1.52.0) · #### pub const fn overflowing\_div\_euclid(self, rhs: u16) -> (u16, bool)
Calculates the quotient of Euclidean division `self.div_euclid(rhs)`.
Returns a tuple of the divisor along with a boolean indicating whether an arithmetic overflow would occur. Note that for unsigned integers overflow never occurs, so the second value is always `false`. Since, for the positive integers, all common definitions of division are equal, this is exactly equal to `self.overflowing_div(rhs)`.
##### Panics
This function will panic if `rhs` is 0.
##### Examples
Basic usage
```
assert_eq!(5u16.overflowing_div_euclid(2), (2, false));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#827-828)1.7.0 (const: 1.52.0) · #### pub const fn overflowing\_rem(self, rhs: u16) -> (u16, bool)
Calculates the remainder when `self` is divided by `rhs`.
Returns a tuple of the remainder after dividing along with a boolean indicating whether an arithmetic overflow would occur. Note that for unsigned integers overflow never occurs, so the second value is always `false`.
##### Panics
This function will panic if `rhs` is 0.
##### Examples
Basic usage
```
assert_eq!(5u16.overflowing_rem(2), (1, false));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#827-828)1.38.0 (const: 1.52.0) · #### pub const fn overflowing\_rem\_euclid(self, rhs: u16) -> (u16, bool)
Calculates the remainder `self.rem_euclid(rhs)` as if by Euclidean division.
Returns a tuple of the modulo after dividing along with a boolean indicating whether an arithmetic overflow would occur. Note that for unsigned integers overflow never occurs, so the second value is always `false`. Since, for the positive integers, all common definitions of division are equal, this operation is exactly equal to `self.overflowing_rem(rhs)`.
##### Panics
This function will panic if `rhs` is 0.
##### Examples
Basic usage
```
assert_eq!(5u16.overflowing_rem_euclid(2), (1, false));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#827-828)1.7.0 (const: 1.32.0) · #### pub const fn overflowing\_neg(self) -> (u16, bool)
Negates self in an overflowing fashion.
Returns `!self + 1` using wrapping operations to return the value that represents the negation of this unsigned value. Note that for positive unsigned values overflow always occurs, but negating 0 does not overflow.
##### Examples
Basic usage
```
assert_eq!(0u16.overflowing_neg(), (0, false));
assert_eq!(2u16.overflowing_neg(), (-2i32 as u16, true));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#827-828)1.7.0 (const: 1.32.0) · #### pub const fn overflowing\_shl(self, rhs: u32) -> (u16, bool)
Shifts self left by `rhs` bits.
Returns a tuple of the shifted version of self along with a boolean indicating whether the shift value was larger than or equal to the number of bits. If the shift value is too large, then value is masked (N-1) where N is the number of bits, and this value is then used to perform the shift.
##### Examples
Basic usage
```
assert_eq!(0x1u16.overflowing_shl(4), (0x10, false));
assert_eq!(0x1u16.overflowing_shl(132), (0x10, true));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#827-828)1.7.0 (const: 1.32.0) · #### pub const fn overflowing\_shr(self, rhs: u32) -> (u16, bool)
Shifts self right by `rhs` bits.
Returns a tuple of the shifted version of self along with a boolean indicating whether the shift value was larger than or equal to the number of bits. If the shift value is too large, then value is masked (N-1) where N is the number of bits, and this value is then used to perform the shift.
##### Examples
Basic usage
```
assert_eq!(0x10u16.overflowing_shr(4), (0x1, false));
assert_eq!(0x10u16.overflowing_shr(132), (0x1, true));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#827-828)1.34.0 (const: 1.50.0) · #### pub const fn overflowing\_pow(self, exp: u32) -> (u16, bool)
Raises self to the power of `exp`, using exponentiation by squaring.
Returns a tuple of the exponentiation along with a bool indicating whether an overflow happened.
##### Examples
Basic usage:
```
assert_eq!(3u16.overflowing_pow(5), (243, false));
assert_eq!(3u8.overflowing_pow(6), (217, true));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#827-828)const: 1.50.0 · #### pub const fn pow(self, exp: u32) -> u16
Raises self to the power of `exp`, using exponentiation by squaring.
##### Examples
Basic usage:
```
assert_eq!(2u16.pow(5), 32);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#827-828)1.38.0 (const: 1.52.0) · #### pub const fn div\_euclid(self, rhs: u16) -> u16
Performs Euclidean division.
Since, for the positive integers, all common definitions of division are equal, this is exactly equal to `self / rhs`.
##### Panics
This function will panic if `rhs` is 0.
##### Examples
Basic usage:
```
assert_eq!(7u16.div_euclid(4), 1); // or any other integer type
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#827-828)1.38.0 (const: 1.52.0) · #### pub const fn rem\_euclid(self, rhs: u16) -> u16
Calculates the least remainder of `self (mod rhs)`.
Since, for the positive integers, all common definitions of division are equal, this is exactly equal to `self % rhs`.
##### Panics
This function will panic if `rhs` is 0.
##### Examples
Basic usage:
```
assert_eq!(7u16.rem_euclid(4), 3); // or any other integer type
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#827-828)#### pub const fn div\_floor(self, rhs: u16) -> u16
🔬This is a nightly-only experimental API. (`int_roundings` [#88581](https://github.com/rust-lang/rust/issues/88581))
Calculates the quotient of `self` and `rhs`, rounding the result towards negative infinity.
This is the same as performing `self / rhs` for all unsigned integers.
##### Panics
This function will panic if `rhs` is zero.
##### Examples
Basic usage:
```
#![feature(int_roundings)]
assert_eq!(7_u16.div_floor(4), 1);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#827-828)#### pub const fn div\_ceil(self, rhs: u16) -> u16
🔬This is a nightly-only experimental API. (`int_roundings` [#88581](https://github.com/rust-lang/rust/issues/88581))
Calculates the quotient of `self` and `rhs`, rounding the result towards positive infinity.
##### Panics
This function will panic if `rhs` is zero.
###### [Overflow behavior](#overflow-behavior)
On overflow, this function will panic if overflow checks are enabled (default in debug mode) and wrap if overflow checks are disabled (default in release mode).
##### Examples
Basic usage:
```
#![feature(int_roundings)]
assert_eq!(7_u16.div_ceil(4), 2);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#827-828)#### pub const fn next\_multiple\_of(self, rhs: u16) -> u16
🔬This is a nightly-only experimental API. (`int_roundings` [#88581](https://github.com/rust-lang/rust/issues/88581))
Calculates the smallest value greater than or equal to `self` that is a multiple of `rhs`.
##### Panics
This function will panic if `rhs` is zero.
###### [Overflow behavior](#overflow-behavior-1)
On overflow, this function will panic if overflow checks are enabled (default in debug mode) and wrap if overflow checks are disabled (default in release mode).
##### Examples
Basic usage:
```
#![feature(int_roundings)]
assert_eq!(16_u16.next_multiple_of(8), 16);
assert_eq!(23_u16.next_multiple_of(8), 24);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#827-828)#### pub const fn checked\_next\_multiple\_of(self, rhs: u16) -> Option<u16>
🔬This is a nightly-only experimental API. (`int_roundings` [#88581](https://github.com/rust-lang/rust/issues/88581))
Calculates the smallest value greater than or equal to `self` that is a multiple of `rhs`. Returns `None` if `rhs` is zero or the operation would result in overflow.
##### Examples
Basic usage:
```
#![feature(int_roundings)]
assert_eq!(16_u16.checked_next_multiple_of(8), Some(16));
assert_eq!(23_u16.checked_next_multiple_of(8), Some(24));
assert_eq!(1_u16.checked_next_multiple_of(0), None);
assert_eq!(u16::MAX.checked_next_multiple_of(2), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#827-828)const: 1.32.0 · #### pub const fn is\_power\_of\_two(self) -> bool
Returns `true` if and only if `self == 2^k` for some `k`.
##### Examples
Basic usage:
```
assert!(16u16.is_power_of_two());
assert!(!10u16.is_power_of_two());
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#827-828)const: 1.50.0 · #### pub const fn next\_power\_of\_two(self) -> u16
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`), it panics in debug mode and the return value is wrapped to 0 in release mode (the only situation in which method can return 0).
##### Examples
Basic usage:
```
assert_eq!(2u16.next_power_of_two(), 2);
assert_eq!(3u16.next_power_of_two(), 4);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#827-828)const: 1.50.0 · #### pub const fn checked\_next\_power\_of\_two(self) -> Option<u16>
Returns the smallest power of two greater than or equal to `n`. If the next power of two is greater than the type’s maximum value, `None` is returned, otherwise the power of two is wrapped in `Some`.
##### Examples
Basic usage:
```
assert_eq!(2u16.checked_next_power_of_two(), Some(2));
assert_eq!(3u16.checked_next_power_of_two(), Some(4));
assert_eq!(u16::MAX.checked_next_power_of_two(), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#827-828)const: [unstable](https://github.com/rust-lang/rust/issues/32463 "Tracking issue for wrapping_next_power_of_two") · #### pub fn wrapping\_next\_power\_of\_two(self) -> 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 `n`. If the next power of two is greater than the type’s maximum value, the return value is wrapped to `0`.
##### Examples
Basic usage:
```
#![feature(wrapping_next_power_of_two)]
assert_eq!(2u16.wrapping_next_power_of_two(), 2);
assert_eq!(3u16.wrapping_next_power_of_two(), 4);
assert_eq!(u16::MAX.wrapping_next_power_of_two(), 0);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#827-828)1.32.0 (const: 1.44.0) · #### pub const fn to\_be\_bytes(self) -> [u8; 2]
Return the memory representation of this integer as a byte array in big-endian (network) byte order.
##### Examples
```
let bytes = 0x1234u16.to_be_bytes();
assert_eq!(bytes, [0x12, 0x34]);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#827-828)1.32.0 (const: 1.44.0) · #### pub const fn to\_le\_bytes(self) -> [u8; 2]
Return the memory representation of this integer as a byte array in little-endian byte order.
##### Examples
```
let bytes = 0x1234u16.to_le_bytes();
assert_eq!(bytes, [0x34, 0x12]);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#827-828)1.32.0 (const: 1.44.0) · #### pub const fn to\_ne\_bytes(self) -> [u8; 2]
Return the memory representation of this integer as a byte array in native byte order.
As the target platform’s native endianness is used, portable code should use [`to_be_bytes`](primitive.u16#method.to_be_bytes) or [`to_le_bytes`](primitive.u16#method.to_le_bytes), as appropriate, instead.
##### Examples
```
let bytes = 0x1234u16.to_ne_bytes();
assert_eq!(
bytes,
if cfg!(target_endian = "big") {
[0x12, 0x34]
} else {
[0x34, 0x12]
}
);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#827-828)1.32.0 (const: 1.44.0) · #### pub const fn from\_be\_bytes(bytes: [u8; 2]) -> u16
Create a native endian integer value from its representation as a byte array in big endian.
##### Examples
```
let value = u16::from_be_bytes([0x12, 0x34]);
assert_eq!(value, 0x1234);
```
When starting from a slice rather than an array, fallible conversion APIs can be used:
```
fn read_be_u16(input: &mut &[u8]) -> u16 {
let (int_bytes, rest) = input.split_at(std::mem::size_of::<u16>());
*input = rest;
u16::from_be_bytes(int_bytes.try_into().unwrap())
}
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#827-828)1.32.0 (const: 1.44.0) · #### pub const fn from\_le\_bytes(bytes: [u8; 2]) -> u16
Create a native endian integer value from its representation as a byte array in little endian.
##### Examples
```
let value = u16::from_le_bytes([0x34, 0x12]);
assert_eq!(value, 0x1234);
```
When starting from a slice rather than an array, fallible conversion APIs can be used:
```
fn read_le_u16(input: &mut &[u8]) -> u16 {
let (int_bytes, rest) = input.split_at(std::mem::size_of::<u16>());
*input = rest;
u16::from_le_bytes(int_bytes.try_into().unwrap())
}
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#827-828)1.32.0 (const: 1.44.0) · #### pub const fn from\_ne\_bytes(bytes: [u8; 2]) -> u16
Create a native endian integer value from its memory representation as a byte array in native endianness.
As the target platform’s native endianness is used, portable code likely wants to use [`from_be_bytes`](primitive.u16#method.from_be_bytes) or [`from_le_bytes`](primitive.u16#method.from_le_bytes), as appropriate instead.
##### Examples
```
let value = u16::from_ne_bytes(if cfg!(target_endian = "big") {
[0x12, 0x34]
} else {
[0x34, 0x12]
});
assert_eq!(value, 0x1234);
```
When starting from a slice rather than an array, fallible conversion APIs can be used:
```
fn read_ne_u16(input: &mut &[u8]) -> u16 {
let (int_bytes, rest) = input.split_at(std::mem::size_of::<u16>());
*input = rest;
u16::from_ne_bytes(int_bytes.try_into().unwrap())
}
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#827-828)const: 1.32.0 · #### pub const fn min\_value() -> u16
👎Deprecating in a future Rust version: replaced by the `MIN` associated constant on this type
New code should prefer to use [`u16::MIN`](primitive.u16#associatedconstant.MIN "u16::MIN") instead.
Returns the smallest value that can be represented by this integer type.
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#827-828)const: 1.32.0 · #### pub const fn max\_value() -> u16
👎Deprecating in a future Rust version: replaced by the `MAX` associated constant on this type
New code should prefer to use [`u16::MAX`](primitive.u16#associatedconstant.MAX "u16::MAX") instead.
Returns the largest value that can be represented by this integer type.
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#829)const: [unstable](https://github.com/rust-lang/rust/issues/85532 "Tracking issue for const_bigint_helper_methods") · #### pub fn widening\_mul(self, rhs: u16) -> (u16, u16)
🔬This is a nightly-only experimental API. (`bigint_helper_methods` [#85532](https://github.com/rust-lang/rust/issues/85532))
Calculates the complete product `self * rhs` without the possibility to overflow.
This returns the low-order (wrapping) bits and the high-order (overflow) bits of the result as two separate values, in that order.
##### Examples
Basic usage:
Please note that this example is shared between integer types. Which explains why `u32` is used here.
```
#![feature(bigint_helper_methods)]
assert_eq!(5u32.widening_mul(2), (10, 0));
assert_eq!(1_000_000_000u32.widening_mul(10), (1410065408, 2));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#829)const: [unstable](https://github.com/rust-lang/rust/issues/85532 "Tracking issue for bigint_helper_methods") · #### pub fn carrying\_mul(self, rhs: u16, carry: u16) -> (u16, u16)
🔬This is a nightly-only experimental API. (`bigint_helper_methods` [#85532](https://github.com/rust-lang/rust/issues/85532))
Calculates the “full multiplication” `self * rhs + carry` without the possibility to overflow.
This returns the low-order (wrapping) bits and the high-order (overflow) bits of the result as two separate values, in that order.
Performs “long multiplication” which takes in an extra amount to add, and may return an additional amount of overflow. This allows for chaining together multiple multiplications to create “big integers” which represent larger values.
##### Examples
Basic usage:
Please note that this example is shared between integer types. Which explains why `u32` is used here.
```
#![feature(bigint_helper_methods)]
assert_eq!(5u32.carrying_mul(2, 0), (10, 0));
assert_eq!(5u32.carrying_mul(2, 10), (20, 0));
assert_eq!(1_000_000_000u32.carrying_mul(10, 0), (1410065408, 2));
assert_eq!(1_000_000_000u32.carrying_mul(10, 10), (1410065418, 2));
assert_eq!(u16::MAX.carrying_mul(u16::MAX, u16::MAX), (0, u16::MAX));
```
If `carry` is zero, this is similar to [`overflowing_mul`](primitive.u16#method.overflowing_mul), except that it gives the value of the overflow instead of just whether one happened:
```
#![feature(bigint_helper_methods)]
let r = u8::carrying_mul(7, 13, 0);
assert_eq!((r.0, r.1 != 0), u8::overflowing_mul(7, 13));
let r = u8::carrying_mul(13, 42, 0);
assert_eq!((r.0, r.1 != 0), u8::overflowing_mul(13, 42));
```
The value of the first field in the returned tuple matches what you’d get by combining the [`wrapping_mul`](primitive.u16#method.wrapping_mul) and [`wrapping_add`](primitive.u16#method.wrapping_add) methods:
```
#![feature(bigint_helper_methods)]
assert_eq!(
789_u16.carrying_mul(456, 123).0,
789_u16.wrapping_mul(456).wrapping_add(123),
);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#852)const: [unstable](https://github.com/rust-lang/rust/issues/94919 "Tracking issue for utf16_extra_const") · #### pub fn is\_utf16\_surrogate(self) -> bool
🔬This is a nightly-only experimental API. (`utf16_extra` [#94919](https://github.com/rust-lang/rust/issues/94919))
Checks if the value is a Unicode surrogate code point, which are disallowed values for [`char`](primitive.char "char").
##### Examples
```
#![feature(utf16_extra)]
let low_non_surrogate = 0xA000u16;
let low_surrogate = 0xD800u16;
let high_surrogate = 0xDC00u16;
let high_non_surrogate = 0xE000u16;
assert!(!low_non_surrogate.is_utf16_surrogate());
assert!(low_surrogate.is_utf16_surrogate());
assert!(high_surrogate.is_utf16_surrogate());
assert!(!high_non_surrogate.is_utf16_surrogate());
```
Trait Implementations
---------------------
[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
The resulting type after applying the `+` operator.
[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") · #### fn add(self, other: &u16) -> <u16 as Add<u16>>::Output
Performs the `+` operation. [Read more](ops/trait.add#tymethod.add)
[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
The resulting type after applying the `+` operator.
[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") · #### fn add(self, other: &u16) -> <u16 as Add<u16>>::Output
Performs the `+` operation. [Read more](ops/trait.add#tymethod.add)
[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
The resulting type after applying the `+` operator.
[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") · #### fn add(self, other: u16) -> <u16 as Add<u16>>::Output
Performs the `+` operation. [Read more](ops/trait.add#tymethod.add)
[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
The resulting type after applying the `+` operator.
[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") · #### fn add(self, other: u16) -> u16
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<&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/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/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/ops/arith.rs.html#786)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/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/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/ops/arith.rs.html#786)1.8.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/ops/arith.rs.html#786)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/fmt/num.rs.html#176)### impl Binary for u16
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#176)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error>
Formats the value using the given formatter.
[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
The resulting type after applying the `&` operator.
[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") · #### fn bitand(self, other: &u16) -> <u16 as BitAnd<u16>>::Output
Performs the `&` operation. [Read more](ops/trait.bitand#tymethod.bitand)
[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
The resulting type after applying the `&` operator.
[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") · #### fn bitand(self, other: &u16) -> <u16 as BitAnd<u16>>::Output
Performs the `&` operation. [Read more](ops/trait.bitand#tymethod.bitand)
[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
The resulting type after applying the `&` operator.
[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") · #### fn bitand(self, other: u16) -> <u16 as BitAnd<u16>>::Output
Performs the `&` operation. [Read more](ops/trait.bitand#tymethod.bitand)
[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
The resulting type after applying the `&` operator.
[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") · #### fn bitand(self, rhs: u16) -> u16
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<&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/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/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/ops/bit.rs.html#734)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/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/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/ops/bit.rs.html#734)1.8.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/ops/bit.rs.html#734)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/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
The resulting type after applying the `|` operator.
[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") · #### fn bitor(self, other: &u16) -> <u16 as BitOr<u16>>::Output
Performs the `|` operation. [Read more](ops/trait.bitor#tymethod.bitor)
[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
The resulting type after applying the `|` operator.
[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") · #### fn bitor(self, other: &u16) -> <u16 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 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/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
The resulting type after applying the `|` operator.
[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") · #### fn bitor(self, other: u16) -> <u16 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 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/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
The resulting type after applying the `|` operator.
[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") · #### fn bitor(self, rhs: u16) -> u16
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<&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/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/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/ops/bit.rs.html#806)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/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/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/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/ops/bit.rs.html#806)1.8.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/ops/bit.rs.html#806)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/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
The resulting type after applying the `^` operator.
[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") · #### fn bitxor(self, other: &u16) -> <u16 as BitXor<u16>>::Output
Performs the `^` operation. [Read more](ops/trait.bitxor#tymethod.bitxor)
[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
The resulting type after applying the `^` operator.
[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") · #### fn bitxor(self, other: &u16) -> <u16 as BitXor<u16>>::Output
Performs the `^` operation. [Read more](ops/trait.bitxor#tymethod.bitxor)
[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
The resulting type after applying the `^` operator.
[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") · #### fn bitxor(self, other: u16) -> <u16 as BitXor<u16>>::Output
Performs the `^` operation. [Read more](ops/trait.bitxor#tymethod.bitxor)
[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
The resulting type after applying the `^` operator.
[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") · #### fn bitxor(self, other: u16) -> u16
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<&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/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/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/ops/bit.rs.html#878)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/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/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/ops/bit.rs.html#878)1.8.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/ops/bit.rs.html#878)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/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") · #### fn clone(&self) -> u16
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/num.rs.html#197-200)### impl Debug for u16
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#197-200)#### 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/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#209)const: [unstable](https://github.com/rust-lang/rust/issues/87864 "Tracking issue for const_default_impls") · #### fn default() -> u16
Returns the default value of `0`
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#461-464)### impl Display for u16
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#461-464)#### 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/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
The resulting type after applying the `/` operator.
[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") · #### fn div(self, other: &u16) -> <u16 as Div<u16>>::Output
Performs the `/` operation. [Read more](ops/trait.div#tymethod.div)
[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
The resulting type after applying the `/` operator.
[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") · #### fn div(self, other: &u16) -> <u16 as Div<u16>>::Output
Performs the `/` operation. [Read more](ops/trait.div#tymethod.div)
[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/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
The resulting type after applying the `/` operator.
[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") · #### fn div(self, other: u16) -> <u16 as Div<u16>>::Output
Performs the `/` operation. [Read more](ops/trait.div#tymethod.div)
[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
The resulting type after applying the `/` operator.
[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") · #### fn div(self, other: u16) -> u16
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<&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/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/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/ops/arith.rs.html#968)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/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/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/ops/arith.rs.html#968)1.8.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/ops/arith.rs.html#968)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/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#87)1.28.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<bool> for u16
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#87)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: bool) -> u16
Converts a `bool` to a `u16`. The resulting value is `0` for `false` and `1` for `true` values.
##### Examples
```
assert_eq!(u16::from(true), 1);
assert_eq!(u16::from(false), 0);
```
[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/87852 "Tracking issue for const_num_from_num")) · ### impl From<u16> for AtomicU16
[source](https://doc.rust-lang.org/src/core/sync/atomic.rs.html#2735-2753)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(v: u16) -> AtomicU16
Converts an `u16` into an `AtomicU16`.
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#164)1.6.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<u16> for f32
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#164)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: u16) -> f32
Converts `u16` to `f32` losslessly.
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#165)1.6.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<u16> for f64
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#165)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: u16) -> f64
Converts `u16` to `f64` losslessly.
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#132)1.26.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<u16> for i128
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#132)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: u16) -> i128
Converts `u16` to `i128` losslessly.
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#130)1.5.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<u16> for i32
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#130)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: u16) -> i32
Converts `u16` to `i32` losslessly.
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#131)1.5.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<u16> for i64
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#131)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: u16) -> i64
Converts `u16` to `i64` losslessly.
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#107)1.26.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<u16> for u128
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#107)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: u16) -> u128
Converts `u16` to `u128` losslessly.
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#105)1.5.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<u16> for u32
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#105)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: u16) -> u32
Converts `u16` to `u32` losslessly.
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#106)1.5.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<u16> for u64
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#106)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: u16) -> u64
Converts `u16` to `u64` losslessly.
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#140)1.26.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<u16> for usize
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#140)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: u16) -> usize
Converts `u16` to `usize` losslessly.
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#100)1.5.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<u8> for u16
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#100)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: u8) -> u16
Converts `u8` to `u16` losslessly.
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#1018)### impl FromStr for u16
#### type Err = ParseIntError
The associated error which can be returned from parsing.
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#1018)#### fn from\_str(src: &str) -> Result<u16, ParseIntError>
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/hash/mod.rs.html#829-842)### impl Hash for u16
[source](https://doc.rust-lang.org/src/core/hash/mod.rs.html#829-842)#### 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#829-842)#### fn hash\_slice<H>(data: &[u16], 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/fmt/num.rs.html#465-468)1.42.0 · ### impl LowerExp for u16
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#465-468)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error>
Formats the value using the given formatter.
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#176)### impl LowerHex for u16
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#176)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error>
Formats the value using the given formatter.
[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
The resulting type after applying the `*` operator.
[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") · #### fn mul(self, other: &u16) -> <u16 as Mul<u16>>::Output
Performs the `*` operation. [Read more](ops/trait.mul#tymethod.mul)
[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
The resulting type after applying the `*` operator.
[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") · #### fn mul(self, other: &u16) -> <u16 as Mul<u16>>::Output
Performs the `*` operation. [Read more](ops/trait.mul#tymethod.mul)
[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
The resulting type after applying the `*` operator.
[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") · #### fn mul(self, other: u16) -> <u16 as Mul<u16>>::Output
Performs the `*` operation. [Read more](ops/trait.mul#tymethod.mul)
[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
The resulting type after applying the `*` operator.
[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") · #### fn mul(self, other: u16) -> u16
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<&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/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/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/ops/arith.rs.html#911)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/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/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/ops/arith.rs.html#911)1.8.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/ops/arith.rs.html#911)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/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
The resulting type after applying the `!` operator.
[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") · #### fn not(self) -> <u16 as Not>::Output
Performs the unary `!` operation. [Read more](ops/trait.not#tymethod.not)
[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
The resulting type after applying the `!` operator.
[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") · #### fn not(self) -> u16
Performs the unary `!` operation. [Read more](ops/trait.not#tymethod.not)
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#176)### impl Octal for u16
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#176)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error>
Formats the value using the given formatter.
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1486)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · ### impl Ord for u16
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1486)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · #### fn cmp(&self, other: &u16) -> 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/cmp.rs.html#1366-1368)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · ### impl PartialEq<u16> for u16
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1366-1368)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · #### fn eq(&self, other: &u16) -> 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#1366-1368)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · #### fn ne(&self, other: &u16) -> 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/cmp.rs.html#1486)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · ### impl PartialOrd<u16> for u16
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1486)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · #### fn partial\_cmp(&self, other: &u16) -> 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#1486)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · #### fn lt(&self, other: &u16) -> 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#1486)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · #### fn le(&self, other: &u16) -> 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#1486)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · #### fn ge(&self, other: &u16) -> 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/cmp.rs.html#1486)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · #### fn gt(&self, other: &u16) -> 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/iter/traits/accum.rs.html#141)1.12.0 · ### impl<'a> Product<&'a u16> for u16
[source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)#### fn product<I>(iter: I) -> u16where I: [Iterator](iter/trait.iterator "trait std::iter::Iterator")<Item = &'a [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.12.0 · ### impl Product<u16> for u16
[source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)#### fn product<I>(iter: I) -> u16where I: [Iterator](iter/trait.iterator "trait std::iter::Iterator")<Item = [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/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
The resulting type after applying the `%` operator.
[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") · #### fn rem(self, other: &u16) -> <u16 as Rem<u16>>::Output
Performs the `%` operation. [Read more](ops/trait.rem#tymethod.rem)
[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
The resulting type after applying the `%` operator.
[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") · #### fn rem(self, other: &u16) -> <u16 as Rem<u16>>::Output
Performs the `%` operation. [Read more](ops/trait.rem#tymethod.rem)
[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/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
The resulting type after applying the `%` operator.
[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") · #### fn rem(self, other: u16) -> <u16 as Rem<u16>>::Output
Performs the `%` operation. [Read more](ops/trait.rem#tymethod.rem)
[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
The resulting type after applying the `%` operator.
[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") · #### fn rem(self, other: u16) -> u16
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<&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/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/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/ops/arith.rs.html#1029)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/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/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/ops/arith.rs.html#1029)1.8.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/ops/arith.rs.html#1029)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/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i128) -> <u16 as Shl<i128>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i128) -> <u16 as Shl<i128>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i16) -> <u16 as Shl<i16>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i16) -> <u16 as Shl<i16>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i32) -> <u16 as Shl<i32>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i32) -> <u16 as Shl<i32>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i64) -> <u16 as Shl<i64>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i64) -> <u16 as Shl<i64>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i8) -> <u16 as Shl<i8>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i8) -> <u16 as Shl<i8>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &isize) -> <u16 as Shl<isize>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &isize) -> <u16 as Shl<isize>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u128) -> <u16 as Shl<u128>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u128) -> <u16 as Shl<u128>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u16) -> <i128 as Shl<u16>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u16) -> <i16 as Shl<u16>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u16) -> <i32 as Shl<u16>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u16) -> <i64 as Shl<u16>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u16) -> <i8 as Shl<u16>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u16) -> <isize as Shl<u16>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u16) -> <u128 as Shl<u16>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u16) -> <u16 as Shl<u16>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u16) -> <u32 as Shl<u16>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u16) -> <u64 as Shl<u16>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u16) -> <u8 as Shl<u16>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u16) -> <usize as Shl<u16>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u16) -> <i128 as Shl<u16>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u16) -> <i16 as Shl<u16>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u16) -> <i32 as Shl<u16>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u16) -> <i64 as Shl<u16>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u16) -> <i8 as Shl<u16>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u16) -> <isize as Shl<u16>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u16) -> <u128 as Shl<u16>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u16) -> <u16 as Shl<u16>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u16) -> <u32 as Shl<u16>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u16) -> <u64 as Shl<u16>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u16) -> <u8 as Shl<u16>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u16) -> <usize as Shl<u16>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u32) -> <u16 as Shl<u32>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u32) -> <u16 as Shl<u32>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u64) -> <u16 as Shl<u64>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u64) -> <u16 as Shl<u64>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u8) -> <u16 as Shl<u8>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u8) -> <u16 as Shl<u8>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &usize) -> <u16 as Shl<usize>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &usize) -> <u16 as Shl<usize>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i128) -> <u16 as Shl<i128>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i128) -> u16
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i16) -> <u16 as Shl<i16>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i16) -> u16
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i32) -> <u16 as Shl<i32>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i32) -> u16
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i64) -> <u16 as Shl<i64>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i64) -> u16
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i8) -> <u16 as Shl<i8>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i8) -> u16
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: isize) -> <u16 as Shl<isize>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: isize) -> u16
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u128) -> <u16 as Shl<u128>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u128) -> u16
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u16) -> <i128 as Shl<u16>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u16) -> <i16 as Shl<u16>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u16) -> <i32 as Shl<u16>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u16) -> <i64 as Shl<u16>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u16) -> <i8 as Shl<u16>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u16) -> <isize as Shl<u16>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u16) -> <u128 as Shl<u16>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u16) -> <u16 as Shl<u16>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u16) -> <u32 as Shl<u16>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u16) -> <u64 as Shl<u16>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u16) -> <u8 as Shl<u16>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u16) -> <usize as Shl<u16>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u16) -> i128
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u16) -> i16
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u16) -> i32
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u16) -> i64
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u16) -> i8
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u16) -> isize
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u16) -> u128
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u16) -> u16
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u16) -> u32
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u16) -> u64
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u16) -> u8
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u16) -> usize
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u32) -> <u16 as Shl<u32>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u32) -> u16
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u64) -> <u16 as Shl<u64>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u64) -> u16
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u8) -> <u16 as Shl<u8>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u8) -> u16
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: usize) -> <u16 as Shl<usize>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: usize) -> u16
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &i128)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &i16)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &i32)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &i64)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &i8)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &isize)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &u128)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &u16)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &u16)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &u16)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &u16)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &u16)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &u16)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &u16)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &u16)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &u16)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &u16)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &u16)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &u16)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &u32)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &u64)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &u8)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)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/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: i128)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: i16)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: i32)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: i64)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: i8)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: isize)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: u128)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: u16)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: u16)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: u16)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: u16)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: u16)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: u16)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: u16)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: u16)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: u16)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: u16)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: u16)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: u16)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: u32)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: u64)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: u8)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)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/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i128) -> <u16 as Shr<i128>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i128) -> <u16 as Shr<i128>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i16) -> <u16 as Shr<i16>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i16) -> <u16 as Shr<i16>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i32) -> <u16 as Shr<i32>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i32) -> <u16 as Shr<i32>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i64) -> <u16 as Shr<i64>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i64) -> <u16 as Shr<i64>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i8) -> <u16 as Shr<i8>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i8) -> <u16 as Shr<i8>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &isize) -> <u16 as Shr<isize>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &isize) -> <u16 as Shr<isize>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u128) -> <u16 as Shr<u128>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u128) -> <u16 as Shr<u128>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u16) -> <i128 as Shr<u16>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u16) -> <i16 as Shr<u16>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u16) -> <i32 as Shr<u16>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u16) -> <i64 as Shr<u16>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u16) -> <i8 as Shr<u16>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u16) -> <isize as Shr<u16>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u16) -> <u128 as Shr<u16>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u16) -> <u16 as Shr<u16>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u16) -> <u32 as Shr<u16>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u16) -> <u64 as Shr<u16>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u16) -> <u8 as Shr<u16>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u16) -> <usize as Shr<u16>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u16) -> <i128 as Shr<u16>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u16) -> <i16 as Shr<u16>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u16) -> <i32 as Shr<u16>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u16) -> <i64 as Shr<u16>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u16) -> <i8 as Shr<u16>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u16) -> <isize as Shr<u16>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u16) -> <u128 as Shr<u16>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u16) -> <u16 as Shr<u16>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u16) -> <u32 as Shr<u16>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u16) -> <u64 as Shr<u16>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u16) -> <u8 as Shr<u16>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u16) -> <usize as Shr<u16>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u32) -> <u16 as Shr<u32>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u32) -> <u16 as Shr<u32>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u64) -> <u16 as Shr<u64>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u64) -> <u16 as Shr<u64>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u8) -> <u16 as Shr<u8>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u8) -> <u16 as Shr<u8>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &usize) -> <u16 as Shr<usize>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &usize) -> <u16 as Shr<usize>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i128) -> <u16 as Shr<i128>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i128) -> u16
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i16) -> <u16 as Shr<i16>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i16) -> u16
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i32) -> <u16 as Shr<i32>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i32) -> u16
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i64) -> <u16 as Shr<i64>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i64) -> u16
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i8) -> <u16 as Shr<i8>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i8) -> u16
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: isize) -> <u16 as Shr<isize>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: isize) -> u16
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u128) -> <u16 as Shr<u128>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u128) -> u16
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u16) -> <i128 as Shr<u16>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u16) -> <i16 as Shr<u16>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u16) -> <i32 as Shr<u16>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u16) -> <i64 as Shr<u16>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u16) -> <i8 as Shr<u16>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u16) -> <isize as Shr<u16>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u16) -> <u128 as Shr<u16>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u16) -> <u16 as Shr<u16>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u16) -> <u32 as Shr<u16>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u16) -> <u64 as Shr<u16>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u16) -> <u8 as Shr<u16>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u16) -> <usize as Shr<u16>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u16) -> i128
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u16) -> i16
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u16) -> i32
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u16) -> i64
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u16) -> i8
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u16) -> isize
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u16) -> u128
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u16) -> u16
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u16) -> u32
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u16) -> u64
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u16) -> u8
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u16) -> usize
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u32) -> <u16 as Shr<u32>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u32) -> u16
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u64) -> <u16 as Shr<u64>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u64) -> u16
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u8) -> <u16 as Shr<u8>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u8) -> u16
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: usize) -> <u16 as Shr<usize>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: usize) -> u16
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &i128)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &i16)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &i32)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &i64)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &i8)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &isize)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &u128)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &u16)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &u16)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &u16)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &u16)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &u16)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &u16)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &u16)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &u16)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &u16)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &u16)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &u16)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &u16)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &u32)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &u64)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &u8)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)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/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: i128)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: i16)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: i32)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: i64)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: i8)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: isize)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: u128)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: u16)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: u16)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: u16)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: u16)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: u16)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: u16)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: u16)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: u16)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: u16)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: u16)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: u16)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: u16)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: u32)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: u64)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: u8)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)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/up/up/portable-simd/crates/core_simd/src/vector.rs.html#670)### impl SimdElement for u16
#### type Mask = i16
🔬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.
[source](https://doc.rust-lang.org/src/core/iter/range.rs.html#391-394)### impl Step for u16
[source](https://doc.rust-lang.org/src/core/iter/range.rs.html#391-394)#### unsafe fn forward\_unchecked(start: u16, n: usize) -> u16
🔬This is a nightly-only experimental API. (`step_trait` [#42168](https://github.com/rust-lang/rust/issues/42168))
Returns the value that would be obtained by taking the *successor* of `self` `count` times. [Read more](iter/trait.step#method.forward_unchecked)
[source](https://doc.rust-lang.org/src/core/iter/range.rs.html#391-394)#### unsafe fn backward\_unchecked(start: u16, n: usize) -> u16
🔬This is a nightly-only experimental API. (`step_trait` [#42168](https://github.com/rust-lang/rust/issues/42168))
Returns the value that would be obtained by taking the *predecessor* of `self` `count` times. [Read more](iter/trait.step#method.backward_unchecked)
[source](https://doc.rust-lang.org/src/core/iter/range.rs.html#391-394)#### fn forward(start: u16, n: usize) -> u16
🔬This is a nightly-only experimental API. (`step_trait` [#42168](https://github.com/rust-lang/rust/issues/42168))
Returns the value that would be obtained by taking the *successor* of `self` `count` times. [Read more](iter/trait.step#method.forward)
[source](https://doc.rust-lang.org/src/core/iter/range.rs.html#391-394)#### fn backward(start: u16, n: usize) -> u16
🔬This is a nightly-only experimental API. (`step_trait` [#42168](https://github.com/rust-lang/rust/issues/42168))
Returns the value that would be obtained by taking the *predecessor* of `self` `count` times. [Read more](iter/trait.step#method.backward)
[source](https://doc.rust-lang.org/src/core/iter/range.rs.html#391-394)#### fn steps\_between(start: &u16, end: &u16) -> Option<usize>
🔬This is a nightly-only experimental API. (`step_trait` [#42168](https://github.com/rust-lang/rust/issues/42168))
Returns the number of *successor* steps required to get from `start` to `end`. [Read more](iter/trait.step#tymethod.steps_between)
[source](https://doc.rust-lang.org/src/core/iter/range.rs.html#391-394)#### fn forward\_checked(start: u16, n: usize) -> Option<u16>
🔬This is a nightly-only experimental API. (`step_trait` [#42168](https://github.com/rust-lang/rust/issues/42168))
Returns the value that would be obtained by taking the *successor* of `self` `count` times. [Read more](iter/trait.step#tymethod.forward_checked)
[source](https://doc.rust-lang.org/src/core/iter/range.rs.html#391-394)#### fn backward\_checked(start: u16, n: usize) -> Option<u16>
🔬This is a nightly-only experimental API. (`step_trait` [#42168](https://github.com/rust-lang/rust/issues/42168))
Returns the value that would be obtained by taking the *predecessor* of `self` `count` times. [Read more](iter/trait.step#tymethod.backward_checked)
[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
The resulting type after applying the `-` operator.
[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") · #### fn sub(self, other: &u16) -> <u16 as Sub<u16>>::Output
Performs the `-` operation. [Read more](ops/trait.sub#tymethod.sub)
[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
The resulting type after applying the `-` operator.
[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") · #### fn sub(self, other: &u16) -> <u16 as Sub<u16>>::Output
Performs the `-` operation. [Read more](ops/trait.sub#tymethod.sub)
[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
The resulting type after applying the `-` operator.
[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") · #### fn sub(self, other: u16) -> <u16 as Sub<u16>>::Output
Performs the `-` operation. [Read more](ops/trait.sub#tymethod.sub)
[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
The resulting type after applying the `-` operator.
[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") · #### fn sub(self, other: u16) -> u16
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<&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/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/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/ops/arith.rs.html#853)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/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/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/ops/arith.rs.html#853)1.8.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/ops/arith.rs.html#853)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/iter/traits/accum.rs.html#141)1.12.0 · ### impl<'a> Sum<&'a u16> for u16
[source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)#### fn sum<I>(iter: I) -> u16where I: [Iterator](iter/trait.iterator "trait std::iter::Iterator")<Item = &'a [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.12.0 · ### impl Sum<u16> for u16
[source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)#### fn sum<I>(iter: I) -> u16where I: [Iterator](iter/trait.iterator "trait std::iter::Iterator")<Item = [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/convert/num.rs.html#294)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<i128> for u16
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#294)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: i128) -> Result<u16, <u16 as TryFrom<i128>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#287)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<i16> for u16
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#287)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: i16) -> Result<u16, <u16 as TryFrom<i16>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#292)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<i32> for u16
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#292)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: i32) -> Result<u16, <u16 as TryFrom<i32>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#293)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<i64> for u16
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#293)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: i64) -> Result<u16, <u16 as TryFrom<i64>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#286)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<i8> for u16
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#286)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: i8) -> Result<u16, <u16 as TryFrom<i8>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#359)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<isize> for u16
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#359)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: isize) -> Result<u16, <u16 as TryFrom<isize>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#271)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<u128> for u16
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#271)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: u128) -> Result<u16, <u16 as TryFrom<u128>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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/convert/num.rs.html#280)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<u16> for i16
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#280)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: u16) -> Result<i16, <i16 as TryFrom<u16>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#280)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<u16> for i8
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#280)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: u16) -> Result<i8, <i8 as TryFrom<u16>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#369)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<u16> for isize
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#369)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(value: u16) -> Result<isize, <isize as TryFrom<u16>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#268)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<u16> for u8
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#268)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: u16) -> Result<u8, <u8 as TryFrom<u16>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#269)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<u32> for u16
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#269)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: u32) -> Result<u16, <u16 as TryFrom<u32>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#270)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<u64> for u16
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#270)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: u64) -> Result<u16, <u16 as TryFrom<u64>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#354)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<usize> for u16
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#354)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: usize) -> Result<u16, <u16 as TryFrom<usize>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### type Error = TryFromIntError
The type returned in the event of a conversion error.
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#465-468)1.42.0 · ### impl UpperExp for u16
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#465-468)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error>
Formats the value using the given formatter.
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#176)### impl UpperHex for u16
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#176)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error>
Formats the value using the given formatter.
[source](https://doc.rust-lang.org/src/core/marker.rs.html#830-835)### impl Copy for u16
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1377)### impl Eq for u16
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#38)### impl FloatToInt<u16> for f32
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#39)### impl FloatToInt<u16> for f64
[source](https://doc.rust-lang.org/src/core/iter/range.rs.html#17)### impl TrustedStep for u16
Auto Trait Implementations
--------------------------
### impl RefUnwindSafe for u16
### impl Send for u16
### impl Sync for u16
### impl Unpin for u16
### impl UnwindSafe for u16
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 Macro std::concat Macro std::concat
=================
```
macro_rules! concat {
($($e:expr),* $(,)?) => { ... };
}
```
Concatenates literals into a static string slice.
This macro takes any number of comma-separated literals, yielding an expression of type `&'static str` which represents all of the literals concatenated left-to-right.
Integer and floating point literals are stringified in order to be concatenated.
Examples
--------
```
let s = concat!("test", 10, 'b', true);
assert_eq!(s, "test10btrue");
```
rust Keyword true Keyword true
============
A value of type [`bool`](primitive.bool "bool") representing logical **true**.
Logically `true` is not equal to [`false`](keyword.false).
### Control structures that check for **true**
Several of Rust’s control structures will check for a `bool` condition evaluating to **true**.
* The condition in an [`if`](keyword.if) expression must be of type `bool`. Whenever that condition evaluates to **true**, the `if` expression takes on the value of the first block. If however, the condition evaluates to `false`, the expression takes on value of the `else` block if there is one.
* [`while`](keyword.while) is another control flow construct expecting a `bool`-typed condition. As long as the condition evaluates to **true**, the `while` loop will continually evaluate its associated block.
* [`match`](../reference/expressions/match-expr#match-guards) arms can have guard clauses on them.
rust Keyword break Keyword break
=============
Exit early from a loop.
When `break` is encountered, execution of the associated loop body is immediately terminated.
```
let mut last = 0;
for x in 1..100 {
if x > 12 {
break;
}
last = x;
}
assert_eq!(last, 12);
println!("{last}");
```
A break expression is normally associated with the innermost loop enclosing the `break` but a label can be used to specify which enclosing loop is affected.
```
'outer: for i in 1..=5 {
println!("outer iteration (i): {i}");
'_inner: for j in 1..=200 {
println!(" inner iteration (j): {j}");
if j >= 3 {
// breaks from inner loop, lets outer loop continue.
break;
}
if i >= 2 {
// breaks from outer loop, and directly to "Bye".
break 'outer;
}
}
}
println!("Bye.");
```
When associated with `loop`, a break expression may be used to return a value from that loop. This is only valid with `loop` and not with any other type of loop. If no value is specified, `break;` returns `()`. Every `break` within a loop must return the same type.
```
let (mut a, mut b) = (1, 1);
let result = loop {
if b > 10 {
break b;
}
let c = a + b;
a = b;
b = c;
};
// first number in Fibonacci sequence over 10:
assert_eq!(result, 13);
println!("{result}");
```
For more details consult the [Reference on “break expression”](../reference/expressions/loop-expr#break-expressions) and the [Reference on “break and loop values”](../reference/expressions/loop-expr#break-and-loop-values).
rust Primitive Type bool Primitive Type bool
===================
The boolean type.
The `bool` represents a value, which could only be either [`true`](keyword.true) or [`false`](keyword.false). If you cast a `bool` into an integer, [`true`](keyword.true) will be 1 and [`false`](keyword.false) will be 0.
Basic usage
-----------
`bool` implements various traits, such as [`BitAnd`](ops/trait.bitand), [`BitOr`](ops/trait.bitor), [`Not`](ops/trait.not), etc., which allow us to perform boolean operations using `&`, `|` and `!`.
[`if`](keyword.if) requires a `bool` value as its conditional. [`assert!`](macro.assert "assert!"), which is an important macro in testing, checks whether an expression is [`true`](keyword.true) and panics if it isn’t.
```
let bool_val = true & false | false;
assert!(!bool_val);
```
Examples
--------
A trivial example of the usage of `bool`:
```
let praise_the_borrow_checker = true;
// using the `if` conditional
if praise_the_borrow_checker {
println!("oh, yeah!");
} else {
println!("what?!!");
}
// ... or, a match pattern
match praise_the_borrow_checker {
true => println!("keep praising!"),
false => println!("you should praise!"),
}
```
Also, since `bool` implements the [`Copy`](marker/trait.copy "Copy") trait, we don’t have to worry about the move semantics (just like the integer and float primitives).
Now an example of `bool` cast to integer type:
```
assert_eq!(true as i32, 1);
assert_eq!(false as i32, 0);
```
Implementations
---------------
[source](https://doc.rust-lang.org/src/core/bool.rs.html#5)### impl bool
[source](https://doc.rust-lang.org/src/core/bool.rs.html#24-26)1.62.0 (const: [unstable](https://github.com/rust-lang/rust/issues/91917 "Tracking issue for const_bool_to_option")) · #### pub fn then\_some<T>(self, t: T) -> Option<T>
Returns `Some(t)` if the `bool` is [`true`](keyword.true), or `None` otherwise.
Arguments passed to `then_some` are eagerly evaluated; if you are passing the result of a function call, it is recommended to use [`then`](primitive.bool#method.then), which is lazily evaluated.
##### Examples
```
assert_eq!(false.then_some(0), None);
assert_eq!(true.then_some(0), Some(0));
```
[source](https://doc.rust-lang.org/src/core/bool.rs.html#43-46)1.50.0 (const: [unstable](https://github.com/rust-lang/rust/issues/91917 "Tracking issue for const_bool_to_option")) · #### pub fn then<T, F>(self, f: F) -> Option<T>where F: [FnOnce](ops/trait.fnonce "trait std::ops::FnOnce")() -> T,
Returns `Some(f())` if the `bool` is [`true`](keyword.true), or `None` otherwise.
##### Examples
```
assert_eq!(false.then(|| 0), None);
assert_eq!(true.then(|| 0), Some(0));
```
Trait Implementations
---------------------
[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
The resulting type after applying the `&` operator.
[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") · #### fn bitand(self, other: &bool) -> <bool as BitAnd<bool>>::Output
Performs the `&` operation. [Read more](ops/trait.bitand#tymethod.bitand)
[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
The resulting type after applying the `&` operator.
[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") · #### fn bitand(self, other: &bool) -> <bool as BitAnd<bool>>::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/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>
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/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
The resulting type after applying the `&` operator.
[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") · #### fn bitand(self, other: bool) -> <bool as BitAnd<bool>>::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/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>
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/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
The resulting type after applying the `&` operator.
[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") · #### fn bitand(self, rhs: bool) -> bool
Performs the `&` operation. [Read more](ops/trait.bitand#tymethod.bitand)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitand\_assign(&mut self, other: &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#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#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/ops/bit.rs.html#734)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitand\_assign(&mut self, other: bool)
Performs the `&=` operation. [Read more](ops/trait.bitandassign#tymethod.bitand_assign)
[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
The resulting type after applying the `|` operator.
[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") · #### fn bitor(self, other: &bool) -> <bool as BitOr<bool>>::Output
Performs the `|` operation. [Read more](ops/trait.bitor#tymethod.bitor)
[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
The resulting type after applying the `|` operator.
[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") · #### fn bitor(self, other: &bool) -> <bool as BitOr<bool>>::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/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>
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/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
The resulting type after applying the `|` operator.
[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") · #### fn bitor(self, other: bool) -> <bool as BitOr<bool>>::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/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>
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/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
The resulting type after applying the `|` operator.
[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") · #### fn bitor(self, rhs: bool) -> bool
Performs the `|` operation. [Read more](ops/trait.bitor#tymethod.bitor)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor\_assign(&mut self, other: &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#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#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/ops/bit.rs.html#806)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitor\_assign(&mut self, other: bool)
Performs the `|=` operation. [Read more](ops/trait.bitorassign#tymethod.bitor_assign)
[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
The resulting type after applying the `^` operator.
[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") · #### fn bitxor(self, other: &bool) -> <bool as BitXor<bool>>::Output
Performs the `^` operation. [Read more](ops/trait.bitxor#tymethod.bitxor)
[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
The resulting type after applying the `^` operator.
[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") · #### fn bitxor(self, other: &bool) -> <bool 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#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>
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/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
The resulting type after applying the `^` operator.
[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") · #### fn bitxor(self, other: bool) -> <bool 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#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>
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/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
The resulting type after applying the `^` operator.
[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") · #### fn bitxor(self, other: bool) -> bool
Performs the `^` operation. [Read more](ops/trait.bitxor#tymethod.bitxor)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitxor\_assign(&mut self, other: &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#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#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/ops/bit.rs.html#878)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn bitxor\_assign(&mut self, other: bool)
Performs the `^=` operation. [Read more](ops/trait.bitxorassign#tymethod.bitxor_assign)
[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") · #### fn clone(&self) -> bool
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#2393)### impl Debug for bool
[source](https://doc.rust-lang.org/src/core/fmt/mod.rs.html#2395)#### 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/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#204)const: [unstable](https://github.com/rust-lang/rust/issues/87864 "Tracking issue for const_default_impls") · #### fn default() -> bool
Returns the default value of `false`
[source](https://doc.rust-lang.org/src/core/fmt/mod.rs.html#2401)### impl Display for bool
[source](https://doc.rust-lang.org/src/core/fmt/mod.rs.html#2402)#### 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/sync/atomic.rs.html#1778)1.24.0 (const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert")) · ### impl From<bool> for AtomicBool
[source](https://doc.rust-lang.org/src/core/sync/atomic.rs.html#1789)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn from(b: bool) -> AtomicBool
Converts a `bool` into an `AtomicBool`.
##### Examples
```
use std::sync::atomic::AtomicBool;
let atomic_bool = AtomicBool::from(true);
assert_eq!(format!("{atomic_bool:?}"), "true")
```
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#96)1.28.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<bool> for i128
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#96)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: bool) -> i128
Converts a `bool` to a `i128`. The resulting value is `0` for `false` and `1` for `true` values.
##### Examples
```
assert_eq!(i128::from(true), 1);
assert_eq!(i128::from(false), 0);
```
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#93)1.28.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<bool> for i16
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#93)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: bool) -> i16
Converts a `bool` to a `i16`. The resulting value is `0` for `false` and `1` for `true` values.
##### Examples
```
assert_eq!(i16::from(true), 1);
assert_eq!(i16::from(false), 0);
```
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#94)1.28.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<bool> for i32
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#94)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: bool) -> i32
Converts a `bool` to a `i32`. The resulting value is `0` for `false` and `1` for `true` values.
##### Examples
```
assert_eq!(i32::from(true), 1);
assert_eq!(i32::from(false), 0);
```
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#95)1.28.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<bool> for i64
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#95)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: bool) -> i64
Converts a `bool` to a `i64`. The resulting value is `0` for `false` and `1` for `true` values.
##### Examples
```
assert_eq!(i64::from(true), 1);
assert_eq!(i64::from(false), 0);
```
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#92)1.28.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<bool> for i8
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#92)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: bool) -> i8
Converts a `bool` to a `i8`. The resulting value is `0` for `false` and `1` for `true` values.
##### Examples
```
assert_eq!(i8::from(true), 1);
assert_eq!(i8::from(false), 0);
```
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#97)1.28.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<bool> for isize
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#97)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: bool) -> isize
Converts a `bool` to a `isize`. The resulting value is `0` for `false` and `1` for `true` values.
##### Examples
```
assert_eq!(isize::from(true), 1);
assert_eq!(isize::from(false), 0);
```
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#90)1.28.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<bool> for u128
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#90)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: bool) -> u128
Converts a `bool` to a `u128`. The resulting value is `0` for `false` and `1` for `true` values.
##### Examples
```
assert_eq!(u128::from(true), 1);
assert_eq!(u128::from(false), 0);
```
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#87)1.28.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<bool> for u16
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#87)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: bool) -> u16
Converts a `bool` to a `u16`. The resulting value is `0` for `false` and `1` for `true` values.
##### Examples
```
assert_eq!(u16::from(true), 1);
assert_eq!(u16::from(false), 0);
```
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#88)1.28.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<bool> for u32
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#88)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: bool) -> u32
Converts a `bool` to a `u32`. The resulting value is `0` for `false` and `1` for `true` values.
##### Examples
```
assert_eq!(u32::from(true), 1);
assert_eq!(u32::from(false), 0);
```
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#89)1.28.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<bool> for u64
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#89)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: bool) -> u64
Converts a `bool` to a `u64`. The resulting value is `0` for `false` and `1` for `true` values.
##### Examples
```
assert_eq!(u64::from(true), 1);
assert_eq!(u64::from(false), 0);
```
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#86)1.28.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<bool> for u8
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#86)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: bool) -> u8
Converts a `bool` to a `u8`. The resulting value is `0` for `false` and `1` for `true` values.
##### Examples
```
assert_eq!(u8::from(true), 1);
assert_eq!(u8::from(false), 0);
```
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#91)1.28.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<bool> for usize
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#91)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: bool) -> usize
Converts a `bool` to a `usize`. The resulting value is `0` for `false` and `1` for `true` values.
##### Examples
```
assert_eq!(usize::from(true), 1);
assert_eq!(usize::from(false), 0);
```
[source](https://doc.rust-lang.org/src/core/str/traits.rs.html#571)### impl FromStr for bool
[source](https://doc.rust-lang.org/src/core/str/traits.rs.html#597)#### fn from\_str(s: &str) -> Result<bool, ParseBoolError>
Parse a `bool` from a string.
Yields a `Result<bool, ParseBoolError>`, because `s` may or may not actually be parseable.
##### Examples
```
use std::str::FromStr;
assert_eq!(FromStr::from_str("true"), Ok(true));
assert_eq!(FromStr::from_str("false"), Ok(false));
assert!(<bool as FromStr>::from_str("not even a boolean").is_err());
```
Note, in many cases, the `.parse()` method on `str` is more proper.
```
assert_eq!("true".parse(), Ok(true));
assert_eq!("false".parse(), Ok(false));
assert!("not even a boolean".parse::<bool>().is_err());
```
#### type Err = ParseBoolError
The associated error which can be returned from parsing.
[source](https://doc.rust-lang.org/src/core/hash/mod.rs.html#845)### impl Hash for bool
[source](https://doc.rust-lang.org/src/core/hash/mod.rs.html#847)#### 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/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
The resulting type after applying the `!` operator.
[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") · #### fn not(self) -> <bool as Not>::Output
Performs the unary `!` operation. [Read more](ops/trait.not#tymethod.not)
[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
The resulting type after applying the `!` operator.
[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") · #### fn not(self) -> bool
Performs the unary `!` operation. [Read more](ops/trait.not#tymethod.not)
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1470)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · ### impl Ord for bool
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1472)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · #### fn cmp(&self, other: &bool) -> 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/cmp.rs.html#1366-1368)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · ### impl PartialEq<bool> for bool
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1366-1368)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · #### fn eq(&self, other: &bool) -> 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#1366-1368)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · #### fn ne(&self, other: &bool) -> 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/cmp.rs.html#1416)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · ### impl PartialOrd<bool> for bool
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1418)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · #### fn partial\_cmp(&self, other: &bool) -> 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/marker.rs.html#830-835)### impl Copy for bool
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1377)### impl Eq for bool
Auto Trait Implementations
--------------------------
### impl RefUnwindSafe for bool
### impl Send for bool
### impl Sync for bool
### impl Unpin for bool
### impl UnwindSafe for bool
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 Macro std::dbg Macro std::dbg
==============
```
macro_rules! dbg {
() => { ... };
($val:expr $(,)?) => { ... };
($($val:expr),+ $(,)?) => { ... };
}
```
Prints and returns the value of a given expression for quick and dirty debugging.
An example:
```
let a = 2;
let b = dbg!(a * 2) + 1;
// ^-- prints: [src/main.rs:2] a * 2 = 4
assert_eq!(b, 5);
```
The macro works by using the `Debug` implementation of the type of the given expression to print the value to [stderr](https://en.wikipedia.org/wiki/Standard_streams#Standard_error_(stderr)) along with the source location of the macro invocation as well as the source code of the expression.
Invoking the macro on an expression moves and takes ownership of it before returning the evaluated expression unchanged. If the type of the expression does not implement `Copy` and you don’t want to give up ownership, you can instead borrow with `dbg!(&expr)` for some expression `expr`.
The `dbg!` macro works exactly the same in release builds. This is useful when debugging issues that only occur in release builds or when debugging in release mode is significantly faster.
Note that the macro is intended as a debugging tool and therefore you should avoid having uses of it in version control for long periods (other than in tests and similar). Debug output from production code is better done with other facilities such as the [`debug!`](https://docs.rs/log/*/log/macro.debug.html) macro from the [`log`](https://crates.io/crates/log) crate.
Stability
---------
The exact output printed by this macro should not be relied upon and is subject to future changes.
Panics
------
Panics if writing to `io::stderr` fails.
Further examples
----------------
With a method call:
```
fn foo(n: usize) {
if let Some(_) = dbg!(n.checked_sub(4)) {
// ...
}
}
foo(3)
```
This prints to [stderr](https://en.wikipedia.org/wiki/Standard_streams#Standard_error_(stderr)):
```
[src/main.rs:4] n.checked_sub(4) = None
```
Naive factorial implementation:
```
fn factorial(n: u32) -> u32 {
if dbg!(n <= 1) {
dbg!(1)
} else {
dbg!(n * factorial(n - 1))
}
}
dbg!(factorial(4));
```
This prints to [stderr](https://en.wikipedia.org/wiki/Standard_streams#Standard_error_(stderr)):
```
[src/main.rs:3] n <= 1 = false
[src/main.rs:3] n <= 1 = false
[src/main.rs:3] n <= 1 = false
[src/main.rs:3] n <= 1 = true
[src/main.rs:4] 1 = 1
[src/main.rs:5] n * factorial(n - 1) = 2
[src/main.rs:5] n * factorial(n - 1) = 6
[src/main.rs:5] n * factorial(n - 1) = 24
[src/main.rs:11] factorial(4) = 24
```
The `dbg!(..)` macro moves the input:
ⓘ
```
/// A wrapper around `usize` which importantly is not Copyable.
#[derive(Debug)]
struct NoCopy(usize);
let a = NoCopy(42);
let _ = dbg!(a); // <-- `a` is moved here.
let _ = dbg!(a); // <-- `a` is moved again; error!
```
You can also use `dbg!()` without a value to just print the file and line whenever it’s reached.
Finally, if you want to `dbg!(..)` multiple values, it will treat them as a tuple (and return it, too):
```
assert_eq!(dbg!(1usize, 2u32), (1, 2));
```
However, a single argument with a trailing comma will still not be treated as a tuple, following the convention of ignoring trailing commas in macro invocations. You can use a 1-tuple directly if you need one:
```
assert_eq!(1, dbg!(1u32,)); // trailing comma ignored
assert_eq!((1,), dbg!((1u32,))); // 1-tuple
```
rust Keyword extern Keyword extern
==============
Link to or import external code.
The `extern` keyword is used in two places in Rust. One is in conjunction with the [`crate`](keyword.crate) keyword to make your Rust code aware of other Rust crates in your project, i.e., `extern crate lazy_static;`. The other use is in foreign function interfaces (FFI).
`extern` is used in two different contexts within FFI. The first is in the form of external blocks, for declaring function interfaces that Rust code can call foreign code by.
ⓘ
```
#[link(name = "my_c_library")]
extern "C" {
fn my_c_function(x: i32) -> bool;
}
```
This code would attempt to link with `libmy_c_library.so` on unix-like systems and `my_c_library.dll` on Windows at runtime, and panic if it can’t find something to link to. Rust code could then use `my_c_function` as if it were any other unsafe Rust function. Working with non-Rust languages and FFI is inherently unsafe, so wrappers are usually built around C APIs.
The mirror use case of FFI is also done via the `extern` keyword:
```
#[no_mangle]
pub extern "C" fn callable_from_c(x: i32) -> bool {
x % 3 == 0
}
```
If compiled as a dylib, the resulting .so could then be linked to from a C library, and the function could be used as if it was from any other library.
For more information on FFI, check the [Rust book](../book/ch19-01-unsafe-rust#using-extern-functions-to-call-external-code) or the [Reference](../reference/items/external-blocks).
rust Macro std::trace_macros Macro std::trace\_macros
========================
```
macro_rules! trace_macros {
(true) => { ... };
(false) => { ... };
}
```
🔬This is a nightly-only experimental API. (`trace_macros` [#29598](https://github.com/rust-lang/rust/issues/29598))
Enables or disables tracing functionality used for debugging other macros.
rust Keyword impl Keyword impl
============
Implement some functionality for a type.
The `impl` keyword is primarily used to define implementations on types. Inherent implementations are standalone, while trait implementations are used to implement traits for types, or other traits.
Functions and consts can both be defined in an implementation. A function defined in an `impl` block can be standalone, meaning it would be called like `Foo::bar()`. If the function takes `self`, `&self`, or `&mut self` as its first argument, it can also be called using method-call syntax, a familiar feature to any object oriented programmer, like `foo.bar()`.
```
struct Example {
number: i32,
}
impl Example {
fn boo() {
println!("boo! Example::boo() was called!");
}
fn answer(&mut self) {
self.number += 42;
}
fn get_number(&self) -> i32 {
self.number
}
}
trait Thingy {
fn do_thingy(&self);
}
impl Thingy for Example {
fn do_thingy(&self) {
println!("doing a thing! also, number is {}!", self.number);
}
}
```
For more information on implementations, see the [Rust book](../book/ch05-03-method-syntax) or the [Reference](../reference/items/implementations).
The other use of the `impl` keyword is in `impl Trait` syntax, which can be seen as a shorthand for “a concrete type that implements this trait”. Its primary use is working with closures, which have type definitions generated at compile time that can’t be simply typed out.
```
fn thing_returning_closure() -> impl Fn(i32) -> bool {
println!("here's a closure for you!");
|x: i32| x % 3 == 0
}
```
For more information on `impl Trait` syntax, see the [Rust book](../book/ch10-02-traits#returning-types-that-implement-traits).
rust Keyword dyn Keyword dyn
===========
`dyn` is a prefix of a [trait object](../book/ch17-02-trait-objects)’s type.
The `dyn` keyword is used to highlight that calls to methods on the associated `Trait` are [dynamically dispatched](https://en.wikipedia.org/wiki/Dynamic_dispatch). To use the trait this way, it must be ‘object safe’.
Unlike generic parameters or `impl Trait`, the compiler does not know the concrete type that is being passed. That is, the type has been [erased](https://en.wikipedia.org/wiki/Type_erasure). As such, a `dyn Trait` reference contains *two* pointers. One pointer goes to the data (e.g., an instance of a struct). Another pointer goes to a map of method call names to function pointers (known as a virtual method table or vtable).
At run-time, when a method needs to be called on the `dyn Trait`, the vtable is consulted to get the function pointer and then that function pointer is called.
See the Reference for more information on [trait objects](../reference/types/trait-object) and [object safety](../reference/items/traits#object-safety).
### Trade-offs
The above indirection is the additional runtime cost of calling a function on a `dyn Trait`. Methods called by dynamic dispatch generally cannot be inlined by the compiler.
However, `dyn Trait` is likely to produce smaller code than `impl Trait` / generic parameters as the method won’t be duplicated for each concrete type.
rust Macro std::write Macro std::write
================
```
macro_rules! write {
($dst:expr, $($arg:tt)*) => { ... };
}
```
Writes formatted data into a buffer.
This macro accepts a ‘writer’, a format string, and a list of arguments. Arguments will be formatted according to the specified format string and the result will be passed to the writer. The writer may be any value with a `write_fmt` method; generally this comes from an implementation of either the [`fmt::Write`](fmt/trait.write) or the [`io::Write`](io/trait.write) trait. The macro returns whatever the `write_fmt` method returns; commonly a [`fmt::Result`](fmt/type.result), or an [`io::Result`](io/type.result).
See [`std::fmt`](fmt/index) for more information on the format string syntax.
Examples
--------
```
use std::io::Write;
fn main() -> std::io::Result<()> {
let mut w = Vec::new();
write!(&mut w, "test")?;
write!(&mut w, "formatted {}", "arguments")?;
assert_eq!(w, b"testformatted arguments");
Ok(())
}
```
A module can import both `std::fmt::Write` and `std::io::Write` and call `write!` on objects implementing either, as objects do not typically implement both. However, the module must avoid conflict between the trait names, such as by importing them as `_` or otherwise renaming them:
```
use std::fmt::Write as _;
use std::io::Write as _;
fn main() -> Result<(), Box<dyn std::error::Error>> {
let mut s = String::new();
let mut v = Vec::new();
write!(&mut s, "{} {}", "abc", 123)?; // uses fmt::Write::write_fmt
write!(&mut v, "s = {:?}", s)?; // uses io::Write::write_fmt
assert_eq!(v, b"s = \"abc 123\"");
Ok(())
}
```
If you also need the trait names themselves, such as to implement one or both on your types, import the containing module and then name them with a prefix:
```
use std::fmt::{self, Write as _};
use std::io::{self, Write as _};
struct Example;
impl fmt::Write for Example {
fn write_str(&mut self, _s: &str) -> core::fmt::Result {
unimplemented!();
}
}
```
Note: This macro can be used in `no_std` setups as well. In a `no_std` setup you are responsible for the implementation details of the components.
```
use core::fmt::Write;
struct Example;
impl Write for Example {
fn write_str(&mut self, _s: &str) -> core::fmt::Result {
unimplemented!();
}
}
let mut m = Example{};
write!(&mut m, "Hello World").expect("Not written");
```
rust Keyword const Keyword const
=============
Compile-time constants, compile-time evaluable functions, and raw pointers.
### Compile-time constants
Sometimes a certain value is used many times throughout a program, and it can become inconvenient to copy it over and over. What’s more, it’s not always possible or desirable to make it a variable that gets carried around to each function that needs it. In these cases, the `const` keyword provides a convenient alternative to code duplication:
```
const THING: u32 = 0xABAD1DEA;
let foo = 123 + THING;
```
Constants must be explicitly typed; unlike with `let`, you can’t ignore their type and let the compiler figure it out. Any constant value can be defined in a `const`, which in practice happens to be most things that would be reasonable to have in a constant (barring `const fn`s). For example, you can’t have a [`File`](fs/struct.file) as a `const`.
The only lifetime allowed in a constant is `'static`, which is the lifetime that encompasses all others in a Rust program. For example, if you wanted to define a constant string, it would look like this:
```
const WORDS: &'static str = "hello rust!";
```
Thanks to static lifetime elision, you usually don’t have to explicitly use `'static`:
```
const WORDS: &str = "hello convenience!";
```
`const` items looks remarkably similar to `static` items, which introduces some confusion as to which one should be used at which times. To put it simply, constants are inlined wherever they’re used, making using them identical to simply replacing the name of the `const` with its value. Static variables, on the other hand, point to a single location in memory, which all accesses share. This means that, unlike with constants, they can’t have destructors, and act as a single value across the entire codebase.
Constants, like statics, should always be in `SCREAMING_SNAKE_CASE`.
For more detail on `const`, see the [Rust Book](../book/ch03-01-variables-and-mutability#constants) or the [Reference](../reference/items/constant-items).
### Compile-time evaluable functions
The other main use of the `const` keyword is in `const fn`. This marks a function as being callable in the body of a `const` or `static` item and in array initializers (commonly called “const contexts”). `const fn` are restricted in the set of operations they can perform, to ensure that they can be evaluated at compile-time. See the [Reference](../reference/const_eval) for more detail.
Turning a `fn` into a `const fn` has no effect on run-time uses of that function.
### Other uses of `const`
The `const` keyword is also used in raw pointers in combination with `mut`, as seen in `*const T` and `*mut T`. More about `const` as used in raw pointers can be read at the Rust docs for the [pointer primitive](primitive.pointer).
rust Macro std::writeln Macro std::writeln
==================
```
macro_rules! writeln {
($dst:expr $(,)?) => { ... };
($dst:expr, $($arg:tt)*) => { ... };
}
```
Write formatted data into a buffer, with a newline appended.
On all platforms, the newline is the LINE FEED character (`\n`/`U+000A`) alone (no additional CARRIAGE RETURN (`\r`/`U+000D`).
For more information, see [`write!`](macro.write "write!"). For information on the format string syntax, see [`std::fmt`](fmt/index).
Examples
--------
```
use std::io::{Write, Result};
fn main() -> Result<()> {
let mut w = Vec::new();
writeln!(&mut w)?;
writeln!(&mut w, "test")?;
writeln!(&mut w, "formatted {}", "arguments")?;
assert_eq!(&w[..], "\ntest\nformatted arguments\n".as_bytes());
Ok(())
}
```
rust Keyword enum Keyword enum
============
A type that can be any one of several variants.
Enums in Rust are similar to those of other compiled languages like C, but have important differences that make them considerably more powerful. What Rust calls enums are more commonly known as [Algebraic Data Types](https://en.wikipedia.org/wiki/Algebraic_data_type) if you’re coming from a functional programming background. The important detail is that each enum variant can have data to go along with it.
```
enum SimpleEnum {
FirstVariant,
SecondVariant,
ThirdVariant,
}
enum Location {
Unknown,
Anonymous,
Known(Coord),
}
enum ComplexEnum {
Nothing,
Something(u32),
LotsOfThings {
usual_struct_stuff: bool,
blah: String,
}
}
enum EmptyEnum { }
```
The first enum shown is the usual kind of enum you’d find in a C-style language. The second shows off a hypothetical example of something storing location data, with `Coord` being any other type that’s needed, for example a struct. The third example demonstrates the kind of data a variant can store, ranging from nothing, to a tuple, to an anonymous struct.
Instantiating enum variants involves explicitly using the enum’s name as its namespace, followed by one of its variants. `SimpleEnum::SecondVariant` would be an example from above. When data follows along with a variant, such as with rust’s built-in [`Option`](option/enum.option "Option") type, the data is added as the type describes, for example `Option::Some(123)`. The same follows with struct-like variants, with things looking like `ComplexEnum::LotsOfThings { usual_struct_stuff: true, blah: "hello!".to_string(), }`. Empty Enums are similar to [`!`](primitive.never "!") in that they cannot be instantiated at all, and are used mainly to mess with the type system in interesting ways.
For more information, take a look at the [Rust Book](../book/ch06-01-defining-an-enum) or the [Reference](../reference/items/enumerations)
rust Primitive Type pointer Primitive Type pointer
======================
Raw, unsafe pointers, `*const T`, and `*mut T`.
*[See also the `std::ptr` module](ptr/index).*
Working with raw pointers in Rust is uncommon, typically limited to a few patterns. Raw pointers can be unaligned or [`null`](ptr/fn.null). However, when a raw pointer is dereferenced (using the `*` operator), it must be non-null and aligned.
Storing through a raw pointer using `*ptr = data` calls `drop` on the old value, so [`write`](ptr/fn.write) must be used if the type has drop glue and memory is not already initialized - otherwise `drop` would be called on the uninitialized memory.
Use the [`null`](ptr/fn.null) and [`null_mut`](ptr/fn.null_mut) functions to create null pointers, and the [`is_null`](primitive.pointer#method.is_null) method of the `*const T` and `*mut T` types to check for null. The `*const T` and `*mut T` types also define the [`offset`](primitive.pointer#method.offset) method, for pointer math.
Common ways to create raw pointers
----------------------------------
### 1. Coerce a reference (`&T`) or mutable reference (`&mut T`).
```
let my_num: i32 = 10;
let my_num_ptr: *const i32 = &my_num;
let mut my_speed: i32 = 88;
let my_speed_ptr: *mut i32 = &mut my_speed;
```
To get a pointer to a boxed value, dereference the box:
```
let my_num: Box<i32> = Box::new(10);
let my_num_ptr: *const i32 = &*my_num;
let mut my_speed: Box<i32> = Box::new(88);
let my_speed_ptr: *mut i32 = &mut *my_speed;
```
This does not take ownership of the original allocation and requires no resource management later, but you must not use the pointer after its lifetime.
### 2. Consume a box (`Box<T>`).
The [`into_raw`](boxed/struct.box#method.into_raw) function consumes a box and returns the raw pointer. It doesn’t destroy `T` or deallocate any memory.
```
let my_speed: Box<i32> = Box::new(88);
let my_speed: *mut i32 = Box::into_raw(my_speed);
// By taking ownership of the original `Box<T>` though
// we are obligated to put it together later to be destroyed.
unsafe {
drop(Box::from_raw(my_speed));
}
```
Note that here the call to [`drop`](mem/fn.drop) is for clarity - it indicates that we are done with the given value and it should be destroyed.
### 3. Create it using `ptr::addr_of!`
Instead of coercing a reference to a raw pointer, you can use the macros [`ptr::addr_of!`](ptr/macro.addr_of "ptr::addr_of!") (for `*const T`) and [`ptr::addr_of_mut!`](ptr/macro.addr_of_mut "ptr::addr_of_mut!") (for `*mut T`). These macros allow you to create raw pointers to fields to which you cannot create a reference (without causing undefined behaviour), such as an unaligned field. This might be necessary if packed structs or uninitialized memory is involved.
```
#[derive(Debug, Default, Copy, Clone)]
#[repr(C, packed)]
struct S {
aligned: u8,
unaligned: u32,
}
let s = S::default();
let p = std::ptr::addr_of!(s.unaligned); // not allowed with coercion
```
### 4. Get it from C.
```
extern crate libc;
use std::mem;
unsafe {
let my_num: *mut i32 = libc::malloc(mem::size_of::<i32>()) as *mut i32;
if my_num.is_null() {
panic!("failed to allocate memory");
}
libc::free(my_num as *mut libc::c_void);
}
```
Usually you wouldn’t literally use `malloc` and `free` from Rust, but C APIs hand out a lot of pointers generally, so are a common source of raw pointers in Rust.
Implementations
---------------
[source](https://doc.rust-lang.org/src/core/ptr/const_ptr.rs.html#1364)### impl<T> \*const [T]
[source](https://doc.rust-lang.org/src/core/ptr/const_ptr.rs.html#1385)const: [unstable](https://github.com/rust-lang/rust/issues/71146 "Tracking issue for const_slice_ptr_len") · #### pub fn len(self) -> usize
🔬This is a nightly-only experimental API. (`slice_ptr_len` [#71146](https://github.com/rust-lang/rust/issues/71146))
Returns the length of a raw slice.
The returned value is the number of **elements**, not the number of bytes.
This function is safe, even when the raw slice cannot be cast to a slice reference because the pointer is null or unaligned.
##### Examples
```
#![feature(slice_ptr_len)]
use std::ptr;
let slice: *const [i8] = ptr::slice_from_raw_parts(ptr::null(), 3);
assert_eq!(slice.len(), 3);
```
[source](https://doc.rust-lang.org/src/core/ptr/const_ptr.rs.html#1405)const: [unstable](https://github.com/rust-lang/rust/issues/74265 "Tracking issue for slice_ptr_get") · #### pub fn as\_ptr(self) -> \*const 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.
This is equivalent to casting `self` to `*const T`, but more type-safe.
##### Examples
```
#![feature(slice_ptr_get)]
use std::ptr;
let slice: *const [i8] = ptr::slice_from_raw_parts(ptr::null(), 3);
assert_eq!(slice.as_ptr(), ptr::null());
```
[source](https://doc.rust-lang.org/src/core/ptr/const_ptr.rs.html#1431-1433)const: unstable · #### pub unsafe fn get\_unchecked<I>( self, index: I) -> \*const <I as SliceIndex<[T]>>::Outputwhere 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)]
let x = &[1, 2, 4] as *const [i32];
unsafe {
assert_eq!(x.get_unchecked(1), x.as_ptr().add(1));
}
```
[source](https://doc.rust-lang.org/src/core/ptr/const_ptr.rs.html#1479)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) -> Option<&'a [MaybeUninit<T>]>
🔬This is a nightly-only experimental API. (`ptr_as_uninit` [#75402](https://github.com/rust-lang/rust/issues/75402))
Returns `None` if the pointer is null, or else returns a shared slice to the value wrapped in `Some`. In contrast to [`as_ref`](#method.as_ref), this does not require that the value has to be initialized.
##### Safety
When calling this method, you have to ensure that *either* the pointer is null *or* all of the following is true:
* The pointer must be [valid](ptr/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](ptr/index#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()`](ptr/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/const_ptr.rs.html#7)### impl<T> \*const Twhere T: ?[Sized](marker/trait.sized "trait std::marker::Sized"),
[source](https://doc.rust-lang.org/src/core/ptr/const_ptr.rs.html#36)const: [unstable](https://github.com/rust-lang/rust/issues/74939 "Tracking issue for const_ptr_is_null") · #### pub fn is\_null(self) -> bool
Returns `true` if the pointer is null.
Note that unsized types have many possible null pointers, as only the raw data pointer is considered, not their length, vtable, etc. Therefore, two pointers that are null may still not compare equal to each other.
###### [Behavior during const evaluation](#behavior-during-const-evaluation)
When this function is used during const evaluation, it may return `false` for pointers that turn out to be null at runtime. Specifically, when a pointer to some memory is offset beyond its bounds in such a way that the resulting pointer is null, the function will still return `false`. There is no way for CTFE to know the absolute position of that memory, so we cannot tell if the pointer is null or not.
##### Examples
Basic usage:
```
let s: &str = "Follow the rabbit";
let ptr: *const u8 = s.as_ptr();
assert!(!ptr.is_null());
```
[source](https://doc.rust-lang.org/src/core/ptr/const_ptr.rs.html#49)1.38.0 (const: 1.38.0) · #### pub const fn cast<U>(self) -> \*const U
Casts to a pointer of another type.
[source](https://doc.rust-lang.org/src/core/ptr/const_ptr.rs.html#84-86)#### pub fn with\_metadata\_of<U>(self, val: \*const U) -> \*const Uwhere U: ?[Sized](marker/trait.sized "trait std::marker::Sized"),
🔬This is a nightly-only experimental API. (`set_ptr_value` [#75091](https://github.com/rust-lang/rust/issues/75091))
Use the pointer value in a new pointer of another type.
In case `val` is a (fat) pointer to an unsized type, this operation will ignore the pointer part, whereas for (thin) pointers to sized types, this has the same effect as a simple cast.
The resulting pointer will have provenance of `self`, i.e., for a fat pointer, this operation is semantically the same as creating a new fat pointer with the data pointer value of `self` but the metadata of `val`.
##### Examples
This function is primarily useful for allowing byte-wise pointer arithmetic on potentially fat pointers:
```
#![feature(set_ptr_value)]
let arr: [i32; 3] = [1, 2, 3];
let mut ptr = arr.as_ptr() as *const dyn Debug;
let thin = ptr as *const u8;
unsafe {
ptr = thin.add(8).with_metadata_of(ptr);
println!("{:?}", &*ptr); // will print "3"
}
```
[source](https://doc.rust-lang.org/src/core/ptr/const_ptr.rs.html#103)1.65.0 (const: 1.65.0) · #### pub const fn cast\_mut(self) -> \*mut T
Changes constness without changing the type.
This is a bit safer than `as` because it wouldn’t silently change the type if the code is refactored.
[source](https://doc.rust-lang.org/src/core/ptr/const_ptr.rs.html#127-129)#### pub fn to\_bits(self) -> usize
🔬This is a nightly-only experimental API. (`ptr_to_from_bits` [#91126](https://github.com/rust-lang/rust/issues/91126))
Casts a pointer to its raw bits.
This is equivalent to `as usize`, but is more specific to enhance readability. The inverse method is [`from_bits`](#method.from_bits).
In particular, `*p as usize` and `p as usize` will both compile for pointers to numeric types but do very different things, so using this helps emphasize that reading the bits was intentional.
##### Examples
```
#![feature(ptr_to_from_bits)]
let array = [13, 42];
let p0: *const i32 = &array[0];
assert_eq!(<*const _>::from_bits(p0.to_bits()), p0);
let p1: *const i32 = &array[1];
assert_eq!(p1.to_bits() - p0.to_bits(), 4);
```
[source](https://doc.rust-lang.org/src/core/ptr/const_ptr.rs.html#148-150)#### pub fn from\_bits(bits: usize) -> \*const T
🔬This is a nightly-only experimental API. (`ptr_to_from_bits` [#91126](https://github.com/rust-lang/rust/issues/91126))
Creates a pointer from its raw bits.
This is equivalent to `as *const T`, but is more specific to enhance readability. The inverse method is [`to_bits`](#method.to_bits).
##### Examples
```
#![feature(ptr_to_from_bits)]
use std::ptr::NonNull;
let dangling: *const u8 = NonNull::dangling().as_ptr();
assert_eq!(<*const u8>::from_bits(1), dangling);
```
[source](https://doc.rust-lang.org/src/core/ptr/const_ptr.rs.html#181-183)#### pub fn addr(self) -> usize
🔬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.
This is similar to `self as usize`, which semantically discards *provenance* and *address-space* information. However, unlike `self as usize`, casting the returned address back to a pointer yields [`invalid`](ptr/fn.invalid "invalid"), which is undefined behavior to dereference. To properly restore the lost information and obtain a dereferenceable pointer, use [`with_addr`](primitive.pointer#method.with_addr "pointer::with_addr") or [`map_addr`](primitive.pointer#method.map_addr "pointer::map_addr").
If using those APIs is not possible because there is no way to preserve a pointer with the required provenance, use [`expose_addr`](primitive.pointer#method.expose_addr "pointer::expose_addr") and [`from_exposed_addr`](ptr/fn.from_exposed_addr "from_exposed_addr") instead. However, note that this makes your code less portable and less amenable to tools that check for compliance with the Rust memory model.
On most platforms this will produce a value with the same bytes as the original pointer, because all the bytes are dedicated to describing the address. Platforms which need to store additional information in the pointer may perform a change of representation to produce a value containing only the address portion of the pointer. What that means is up to the platform to define.
This API and its claimed semantics are part of the Strict Provenance experiment, and as such might change in the future (including possibly weakening this so it becomes wholly equivalent to `self as usize`). See the [module documentation](ptr/index "crate::ptr") for details.
[source](https://doc.rust-lang.org/src/core/ptr/const_ptr.rs.html#218-220)#### pub fn expose\_addr(self) -> usize
🔬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, and ‘exposes’ the “provenance” part for future use in [`from_exposed_addr`](ptr/fn.from_exposed_addr).
This is equivalent to `self as usize`, which semantically discards *provenance* and *address-space* information. Furthermore, this (like the `as` cast) has the implicit side-effect of marking the provenance as ‘exposed’, so on platforms that support it you can later call [`from_exposed_addr`](ptr/fn.from_exposed_addr) to reconstitute the original pointer including its provenance. (Reconstructing address space information, if required, is your responsibility.)
Using this method means that code is *not* following Strict Provenance rules. Supporting [`from_exposed_addr`](ptr/fn.from_exposed_addr) 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 [`addr`](primitive.pointer#method.addr "pointer::addr") wherever possible.
On most platforms this will produce a value with the same bytes as the original pointer, because all the bytes are dedicated to describing the address. Platforms which need to store additional information in the pointer may not support this operation, since the ‘expose’ side-effect which is required for [`from_exposed_addr`](ptr/fn.from_exposed_addr) to work is typically not available.
This API and its claimed semantics are part of the Strict Provenance experiment, see the [module documentation](ptr/index "crate::ptr") for details.
[source](https://doc.rust-lang.org/src/core/ptr/const_ptr.rs.html#241-243)#### pub fn with\_addr(self, addr: usize) -> \*const 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.
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`](primitive.pointer#method.wrapping_offset "pointer::wrapping_offset") to offset `self` to the given address, and therefore has all the same capabilities and restrictions.
This API and its claimed semantics are part of the Strict Provenance experiment, see the [module documentation](ptr/index "crate::ptr") for details.
[source](https://doc.rust-lang.org/src/core/ptr/const_ptr.rs.html#267-269)#### pub fn map\_addr(self, f: impl FnOnce(usize) -> usize) -> \*const 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.
This is a convenience for [`with_addr`](primitive.pointer#method.with_addr "pointer::with_addr"), see that method for details.
This API and its claimed semantics are part of the Strict Provenance experiment, see the [module documentation](ptr/index "crate::ptr") for details.
[source](https://doc.rust-lang.org/src/core/ptr/const_ptr.rs.html#280)const: [unstable](https://github.com/rust-lang/rust/issues/81513 "Tracking issue for ptr_metadata") · #### pub fn to\_raw\_parts(self) -> (\*const (), <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 [`from_raw_parts`](ptr/fn.from_raw_parts "from_raw_parts").
[source](https://doc.rust-lang.org/src/core/ptr/const_ptr.rs.html#343)1.9.0 (const: [unstable](https://github.com/rust-lang/rust/issues/91822 "Tracking issue for const_ptr_as_ref")) · #### pub unsafe fn as\_ref<'a>(self) -> Option<&'a T>
Returns `None` if the pointer is null, or else returns a shared reference to the value wrapped in `Some`. If the value may be uninitialized, [`as_uninit_ref`](#method.as_uninit_ref) must be used instead.
##### Safety
When calling this method, you have to ensure that *either* the pointer is null *or* all of the following is true:
* The pointer must be properly aligned.
* It must be “dereferenceable” in the sense defined in [the module documentation](ptr/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
Basic usage:
```
let ptr: *const u8 = &10u8 as *const u8;
unsafe {
if let Some(val_back) = ptr.as_ref() {
println!("We got back the value: {val_back}!");
}
}
```
##### Null-unchecked version
If you are sure the pointer can never be null and are looking for some kind of `as_ref_unchecked` that returns the `&T` instead of `Option<&T>`, know that you can dereference the pointer directly.
```
let ptr: *const u8 = &10u8 as *const u8;
unsafe {
let val_back = &*ptr;
println!("We got back the value: {val_back}!");
}
```
[source](https://doc.rust-lang.org/src/core/ptr/const_ptr.rs.html#391-393)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) -> Option<&'a MaybeUninit<T>>
🔬This is a nightly-only experimental API. (`ptr_as_uninit` [#75402](https://github.com/rust-lang/rust/issues/75402))
Returns `None` if the pointer is null, or else returns a shared reference to the value wrapped in `Some`. In contrast to [`as_ref`](#method.as_ref), this does not require that the value has to be initialized.
##### Safety
When calling this method, you have to ensure that *either* the pointer is null *or* all of the following is true:
* The pointer must be properly aligned.
* It must be “dereferenceable” in the sense defined in [the module documentation](ptr/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!
##### Examples
Basic usage:
```
#![feature(ptr_as_uninit)]
let ptr: *const u8 = &10u8 as *const u8;
unsafe {
if let Some(val_back) = ptr.as_uninit_ref() {
println!("We got back the value: {}!", val_back.assume_init());
}
}
```
[source](https://doc.rust-lang.org/src/core/ptr/const_ptr.rs.html#456-458)const: 1.61.0 · #### pub const unsafe fn offset(self, count: isize) -> \*const T
Calculates the offset from a pointer.
`count` is in units of T; e.g., a `count` of 3 represents a pointer offset of `3 * size_of::<T>()` bytes.
##### Safety
If any of the following conditions are violated, the result is Undefined Behavior:
* Both the starting and resulting pointer must be either in bounds or one byte past the end of the same [allocated object](ptr/index#allocated-object).
* The computed offset, **in bytes**, cannot overflow an `isize`.
* The offset being in bounds cannot rely on “wrapping around” the address space. That is, the infinite-precision sum, **in bytes** must fit in a usize.
The compiler and standard library generally tries to ensure allocations never reach a size where an offset is a concern. For instance, `Vec` and `Box` ensure they never allocate more than `isize::MAX` bytes, so `vec.as_ptr().add(vec.len())` is always safe.
Most platforms fundamentally can’t even construct such an allocation. For instance, no known 64-bit platform can ever serve a request for 263 bytes due to page-table limitations or splitting the address space. However, some 32-bit and 16-bit platforms may successfully serve a request for more than `isize::MAX` bytes with things like Physical Address Extension. As such, memory acquired directly from allocators or memory mapped files *may* be too large to handle with this function.
Consider using [`wrapping_offset`](#method.wrapping_offset) instead if these constraints are difficult to satisfy. The only advantage of this method is that it enables more aggressive compiler optimizations.
##### Examples
Basic usage:
```
let s: &str = "123";
let ptr: *const u8 = s.as_ptr();
unsafe {
println!("{}", *ptr.offset(1) as char);
println!("{}", *ptr.offset(2) as char);
}
```
[source](https://doc.rust-lang.org/src/core/ptr/const_ptr.rs.html#479)const: [unstable](https://github.com/rust-lang/rust/issues/96283 "Tracking issue for const_pointer_byte_offsets") · #### pub unsafe fn byte\_offset(self, count: isize) -> \*const T
🔬This is a nightly-only experimental API. (`pointer_byte_offsets` [#96283](https://github.com/rust-lang/rust/issues/96283))
Calculates the offset from a pointer in bytes.
`count` is in units of **bytes**.
This is purely a convenience for casting to a `u8` pointer and using [offset](primitive.pointer#method.offset "pointer::offset") on it. See that method for documentation and safety requirements.
For non-`Sized` pointees this operation changes only the data pointer, leaving the metadata untouched.
[source](https://doc.rust-lang.org/src/core/ptr/const_ptr.rs.html#539-541)1.16.0 (const: 1.61.0) · #### pub const fn wrapping\_offset(self, count: isize) -> \*const T
Calculates the offset from a pointer using wrapping arithmetic.
`count` is in units of T; e.g., a `count` of 3 represents a pointer offset of `3 * size_of::<T>()` bytes.
##### Safety
This operation itself is always safe, but using the resulting pointer is not.
The resulting pointer “remembers” the [allocated object](ptr/index#allocated-object) that `self` points to; it must not be used to read or write other allocated objects.
In other words, `let z = x.wrapping_offset((y as isize) - (x as isize))` does *not* make `z` the same as `y` even if we assume `T` has size `1` and there is no overflow: `z` is still attached to the object `x` is attached to, and dereferencing it is Undefined Behavior unless `x` and `y` point into the same allocated object.
Compared to [`offset`](#method.offset), this method basically delays the requirement of staying within the same allocated object: [`offset`](#method.offset) is immediate Undefined Behavior when crossing object boundaries; `wrapping_offset` produces a pointer but still leads to Undefined Behavior if a pointer is dereferenced when it is out-of-bounds of the object it is attached to. [`offset`](#method.offset) can be optimized better and is thus preferable in performance-sensitive code.
The delayed check only considers the value of the pointer that was dereferenced, not the intermediate values used during the computation of the final result. For example, `x.wrapping_offset(o).wrapping_offset(o.wrapping_neg())` is always the same as `x`. In other words, leaving the allocated object and then re-entering it later is permitted.
##### Examples
Basic usage:
```
// Iterate using a raw pointer in increments of two elements
let data = [1u8, 2, 3, 4, 5];
let mut ptr: *const u8 = data.as_ptr();
let step = 2;
let end_rounded_up = ptr.wrapping_offset(6);
// This loop prints "1, 3, 5, "
while ptr != end_rounded_up {
unsafe {
print!("{}, ", *ptr);
}
ptr = ptr.wrapping_offset(step);
}
```
[source](https://doc.rust-lang.org/src/core/ptr/const_ptr.rs.html#561)const: [unstable](https://github.com/rust-lang/rust/issues/96283 "Tracking issue for const_pointer_byte_offsets") · #### pub fn wrapping\_byte\_offset(self, count: isize) -> \*const T
🔬This is a nightly-only experimental API. (`pointer_byte_offsets` [#96283](https://github.com/rust-lang/rust/issues/96283))
Calculates the offset from a pointer in bytes using wrapping arithmetic.
`count` is in units of **bytes**.
This is purely a convenience for casting to a `u8` pointer and using [wrapping\_offset](primitive.pointer#method.wrapping_offset "pointer::wrapping_offset") on it. See that method for documentation.
For non-`Sized` pointees this operation changes only the data pointer, leaving the metadata untouched.
[source](https://doc.rust-lang.org/src/core/ptr/const_ptr.rs.html#575)#### pub fn mask(self, mask: usize) -> \*const T
🔬This is a nightly-only experimental API. (`ptr_mask` [#98290](https://github.com/rust-lang/rust/issues/98290))
Masks out bits of the pointer according to a mask.
This is convenience for `ptr.map_addr(|a| a & mask)`.
For non-`Sized` pointees this operation changes only the data pointer, leaving the metadata untouched.
[source](https://doc.rust-lang.org/src/core/ptr/const_ptr.rs.html#665-667)1.47.0 (const: 1.65.0) · #### pub const unsafe fn offset\_from(self, origin: \*const T) -> isize
Calculates the distance between two pointers. The returned value is in units of T: the distance in bytes divided by `mem::size_of::<T>()`.
This function is the inverse of [`offset`](#method.offset).
##### Safety
If any of the following conditions are violated, the result is Undefined Behavior:
* Both the starting and other pointer must be either in bounds or one byte past the end of the same [allocated object](ptr/index#allocated-object).
* Both pointers must be *derived from* a pointer to the same object. (See below for an example.)
* The distance between the pointers, in bytes, must be an exact multiple of the size of `T`.
* The distance between the pointers, **in bytes**, cannot overflow an `isize`.
* The distance being in bounds cannot rely on “wrapping around” the address space.
Rust types are never larger than `isize::MAX` and Rust allocations never wrap around the address space, so two pointers within some value of any Rust type `T` will always satisfy the last two conditions. The standard library also generally ensures that allocations never reach a size where an offset is a concern. For instance, `Vec` and `Box` ensure they never allocate more than `isize::MAX` bytes, so `ptr_into_vec.offset_from(vec.as_ptr())` always satisfies the last two conditions.
Most platforms fundamentally can’t even construct such a large allocation. For instance, no known 64-bit platform can ever serve a request for 263 bytes due to page-table limitations or splitting the address space. However, some 32-bit and 16-bit platforms may successfully serve a request for more than `isize::MAX` bytes with things like Physical Address Extension. As such, memory acquired directly from allocators or memory mapped files *may* be too large to handle with this function. (Note that [`offset`](#method.offset) and [`add`](#method.add) also have a similar limitation and hence cannot be used on such large allocations either.)
##### Panics
This function panics if `T` is a Zero-Sized Type (“ZST”).
##### Examples
Basic usage:
```
let a = [0; 5];
let ptr1: *const i32 = &a[1];
let ptr2: *const i32 = &a[3];
unsafe {
assert_eq!(ptr2.offset_from(ptr1), 2);
assert_eq!(ptr1.offset_from(ptr2), -2);
assert_eq!(ptr1.offset(2), ptr2);
assert_eq!(ptr2.offset(-2), ptr1);
}
```
*Incorrect* usage:
```
let ptr1 = Box::into_raw(Box::new(0u8)) as *const u8;
let ptr2 = Box::into_raw(Box::new(1u8)) as *const u8;
let diff = (ptr2 as isize).wrapping_sub(ptr1 as isize);
// Make ptr2_other an "alias" of ptr2, but derived from ptr1.
let ptr2_other = (ptr1 as *const u8).wrapping_offset(diff);
assert_eq!(ptr2 as usize, ptr2_other as usize);
// Since ptr2_other and ptr2 are derived from pointers to different objects,
// computing their offset is undefined behavior, even though
// they point to the same address!
unsafe {
let zero = ptr2_other.offset_from(ptr2); // Undefined Behavior
}
```
[source](https://doc.rust-lang.org/src/core/ptr/const_ptr.rs.html#688)const: [unstable](https://github.com/rust-lang/rust/issues/96283 "Tracking issue for const_pointer_byte_offsets") · #### pub unsafe fn byte\_offset\_from(self, origin: \*const T) -> isize
🔬This is a nightly-only experimental API. (`pointer_byte_offsets` [#96283](https://github.com/rust-lang/rust/issues/96283))
Calculates the distance between two pointers. The returned value is in units of **bytes**.
This is purely a convenience for casting to a `u8` pointer and using [offset\_from](primitive.pointer#method.offset_from "pointer::offset_from") on it. See that method for documentation and safety requirements.
For non-`Sized` pointees this operation considers only the data pointers, ignoring the metadata.
[source](https://doc.rust-lang.org/src/core/ptr/const_ptr.rs.html#757-759)const: [unstable](https://github.com/rust-lang/rust/issues/95892 "Tracking issue for const_ptr_sub_ptr") · #### pub unsafe fn sub\_ptr(self, origin: \*const T) -> usize
🔬This is a nightly-only experimental API. (`ptr_sub_ptr` [#95892](https://github.com/rust-lang/rust/issues/95892))
Calculates the distance between two pointers, *where it’s known that `self` is equal to or greater than `origin`*. The returned value is in units of T: the distance in bytes is divided by `mem::size_of::<T>()`.
This computes the same value that [`offset_from`](#method.offset_from) would compute, but with the added precondition that that the offset is guaranteed to be non-negative. This method is equivalent to `usize::from(self.offset_from(origin)).unwrap_unchecked()`, but it provides slightly more information to the optimizer, which can sometimes allow it to optimize slightly better with some backends.
This method can be though of as recovering the `count` that was passed to [`add`](#method.add) (or, with the parameters in the other order, to [`sub`](#method.sub)). The following are all equivalent, assuming that their safety preconditions are met:
```
ptr.sub_ptr(origin) == count
origin.add(count) == ptr
ptr.sub(count) == origin
```
##### Safety
* The distance between the pointers must be non-negative (`self >= origin`)
* *All* the safety conditions of [`offset_from`](#method.offset_from) apply to this method as well; see it for the full details.
Importantly, despite the return type of this method being able to represent a larger offset, it’s still *not permitted* to pass pointers which differ by more than `isize::MAX` *bytes*. As such, the result of this method will always be less than or equal to `isize::MAX as usize`.
##### Panics
This function panics if `T` is a Zero-Sized Type (“ZST”).
##### Examples
```
#![feature(ptr_sub_ptr)]
let a = [0; 5];
let ptr1: *const i32 = &a[1];
let ptr2: *const i32 = &a[3];
unsafe {
assert_eq!(ptr2.sub_ptr(ptr1), 2);
assert_eq!(ptr1.add(2), ptr2);
assert_eq!(ptr2.sub(2), ptr1);
assert_eq!(ptr2.sub_ptr(ptr2), 0);
}
// This would be incorrect, as the pointers are not correctly ordered:
// ptr1.sub_ptr(ptr2)
```
[source](https://doc.rust-lang.org/src/core/ptr/const_ptr.rs.html#794-796)const: [unstable](https://github.com/rust-lang/rust/issues/53020 "Tracking issue for const_raw_ptr_comparison") · #### pub fn guaranteed\_eq(self, other: \*const T) -> Option<bool>
🔬This is a nightly-only experimental API. (`const_raw_ptr_comparison` [#53020](https://github.com/rust-lang/rust/issues/53020))
Returns whether two pointers are guaranteed to be equal.
At runtime this function behaves like `Some(self == other)`. However, in some contexts (e.g., compile-time evaluation), it is not always possible to determine equality of two pointers, so this function may spuriously return `None` for pointers that later actually turn out to have its equality known. But when it returns `Some`, the pointers’ equality is guaranteed to be known.
The return value may change from `Some` to `None` and vice versa depending on the compiler version and unsafe code must not rely on the result of this function for soundness. It is suggested to only use this function for performance optimizations where spurious `None` return values by this function do not affect the outcome, but just the performance. The consequences of using this method to make runtime and compile-time code behave differently have not been explored. This method should not be used to introduce such differences, and it should also not be stabilized before we have a better understanding of this issue.
[source](https://doc.rust-lang.org/src/core/ptr/const_ptr.rs.html#824-826)const: [unstable](https://github.com/rust-lang/rust/issues/53020 "Tracking issue for const_raw_ptr_comparison") · #### pub fn guaranteed\_ne(self, other: \*const T) -> Option<bool>
🔬This is a nightly-only experimental API. (`const_raw_ptr_comparison` [#53020](https://github.com/rust-lang/rust/issues/53020))
Returns whether two pointers are guaranteed to be inequal.
At runtime this function behaves like `Some(self == other)`. However, in some contexts (e.g., compile-time evaluation), it is not always possible to determine inequality of two pointers, so this function may spuriously return `None` for pointers that later actually turn out to have its inequality known. But when it returns `Some`, the pointers’ inequality is guaranteed to be known.
The return value may change from `Some` to `None` and vice versa depending on the compiler version and unsafe code must not rely on the result of this function for soundness. It is suggested to only use this function for performance optimizations where spurious `None` return values by this function do not affect the outcome, but just the performance. The consequences of using this method to make runtime and compile-time code behave differently have not been explored. This method should not be used to introduce such differences, and it should also not be stabilized before we have a better understanding of this issue.
[source](https://doc.rust-lang.org/src/core/ptr/const_ptr.rs.html#890-892)1.26.0 (const: 1.61.0) · #### pub const unsafe fn add(self, count: usize) -> \*const T
Calculates the offset from a pointer (convenience for `.offset(count as isize)`).
`count` is in units of T; e.g., a `count` of 3 represents a pointer offset of `3 * size_of::<T>()` bytes.
##### Safety
If any of the following conditions are violated, the result is Undefined Behavior:
* Both the starting and resulting pointer must be either in bounds or one byte past the end of the same [allocated object](ptr/index#allocated-object).
* The computed offset, **in bytes**, cannot overflow an `isize`.
* The offset being in bounds cannot rely on “wrapping around” the address space. That is, the infinite-precision sum must fit in a `usize`.
The compiler and standard library generally tries to ensure allocations never reach a size where an offset is a concern. For instance, `Vec` and `Box` ensure they never allocate more than `isize::MAX` bytes, so `vec.as_ptr().add(vec.len())` is always safe.
Most platforms fundamentally can’t even construct such an allocation. For instance, no known 64-bit platform can ever serve a request for 263 bytes due to page-table limitations or splitting the address space. However, some 32-bit and 16-bit platforms may successfully serve a request for more than `isize::MAX` bytes with things like Physical Address Extension. As such, memory acquired directly from allocators or memory mapped files *may* be too large to handle with this function.
Consider using [`wrapping_add`](#method.wrapping_add) instead if these constraints are difficult to satisfy. The only advantage of this method is that it enables more aggressive compiler optimizations.
##### Examples
Basic usage:
```
let s: &str = "123";
let ptr: *const u8 = s.as_ptr();
unsafe {
println!("{}", *ptr.add(1) as char);
println!("{}", *ptr.add(2) as char);
}
```
[source](https://doc.rust-lang.org/src/core/ptr/const_ptr.rs.html#913)const: [unstable](https://github.com/rust-lang/rust/issues/96283 "Tracking issue for const_pointer_byte_offsets") · #### pub unsafe fn byte\_add(self, count: usize) -> \*const T
🔬This is a nightly-only experimental API. (`pointer_byte_offsets` [#96283](https://github.com/rust-lang/rust/issues/96283))
Calculates the offset from a pointer in bytes (convenience for `.byte_offset(count as isize)`).
`count` is in units of bytes.
This is purely a convenience for casting to a `u8` pointer and using [add](primitive.pointer#method.add "pointer::add") on it. See that method for documentation and safety requirements.
For non-`Sized` pointees this operation changes only the data pointer, leaving the metadata untouched.
[source](https://doc.rust-lang.org/src/core/ptr/const_ptr.rs.html#976-978)1.26.0 (const: 1.61.0) · #### pub const unsafe fn sub(self, count: usize) -> \*const T
Calculates the offset from a pointer (convenience for `.offset((count as isize).wrapping_neg())`).
`count` is in units of T; e.g., a `count` of 3 represents a pointer offset of `3 * size_of::<T>()` bytes.
##### Safety
If any of the following conditions are violated, the result is Undefined Behavior:
* Both the starting and resulting pointer must be either in bounds or one byte past the end of the same [allocated object](ptr/index#allocated-object).
* The computed offset cannot exceed `isize::MAX` **bytes**.
* The offset being in bounds cannot rely on “wrapping around” the address space. That is, the infinite-precision sum must fit in a usize.
The compiler and standard library generally tries to ensure allocations never reach a size where an offset is a concern. For instance, `Vec` and `Box` ensure they never allocate more than `isize::MAX` bytes, so `vec.as_ptr().add(vec.len()).sub(vec.len())` is always safe.
Most platforms fundamentally can’t even construct such an allocation. For instance, no known 64-bit platform can ever serve a request for 263 bytes due to page-table limitations or splitting the address space. However, some 32-bit and 16-bit platforms may successfully serve a request for more than `isize::MAX` bytes with things like Physical Address Extension. As such, memory acquired directly from allocators or memory mapped files *may* be too large to handle with this function.
Consider using [`wrapping_sub`](#method.wrapping_sub) instead if these constraints are difficult to satisfy. The only advantage of this method is that it enables more aggressive compiler optimizations.
##### Examples
Basic usage:
```
let s: &str = "123";
unsafe {
let end: *const u8 = s.as_ptr().add(3);
println!("{}", *end.sub(1) as char);
println!("{}", *end.sub(2) as char);
}
```
[source](https://doc.rust-lang.org/src/core/ptr/const_ptr.rs.html#1000)const: [unstable](https://github.com/rust-lang/rust/issues/96283 "Tracking issue for const_pointer_byte_offsets") · #### pub unsafe fn byte\_sub(self, count: usize) -> \*const T
🔬This is a nightly-only experimental API. (`pointer_byte_offsets` [#96283](https://github.com/rust-lang/rust/issues/96283))
Calculates the offset from a pointer in bytes (convenience for `.byte_offset((count as isize).wrapping_neg())`).
`count` is in units of bytes.
This is purely a convenience for casting to a `u8` pointer and using [sub](primitive.pointer#method.sub "pointer::sub") on it. See that method for documentation and safety requirements.
For non-`Sized` pointees this operation changes only the data pointer, leaving the metadata untouched.
[source](https://doc.rust-lang.org/src/core/ptr/const_ptr.rs.html#1061-1063)1.26.0 (const: 1.61.0) · #### pub const fn wrapping\_add(self, count: usize) -> \*const T
Calculates the offset from a pointer using wrapping arithmetic. (convenience for `.wrapping_offset(count as isize)`)
`count` is in units of T; e.g., a `count` of 3 represents a pointer offset of `3 * size_of::<T>()` bytes.
##### Safety
This operation itself is always safe, but using the resulting pointer is not.
The resulting pointer “remembers” the [allocated object](ptr/index#allocated-object) that `self` points to; it must not be used to read or write other allocated objects.
In other words, `let z = x.wrapping_add((y as usize) - (x as usize))` does *not* make `z` the same as `y` even if we assume `T` has size `1` and there is no overflow: `z` is still attached to the object `x` is attached to, and dereferencing it is Undefined Behavior unless `x` and `y` point into the same allocated object.
Compared to [`add`](#method.add), this method basically delays the requirement of staying within the same allocated object: [`add`](#method.add) is immediate Undefined Behavior when crossing object boundaries; `wrapping_add` produces a pointer but still leads to Undefined Behavior if a pointer is dereferenced when it is out-of-bounds of the object it is attached to. [`add`](#method.add) can be optimized better and is thus preferable in performance-sensitive code.
The delayed check only considers the value of the pointer that was dereferenced, not the intermediate values used during the computation of the final result. For example, `x.wrapping_add(o).wrapping_sub(o)` is always the same as `x`. In other words, leaving the allocated object and then re-entering it later is permitted.
##### Examples
Basic usage:
```
// Iterate using a raw pointer in increments of two elements
let data = [1u8, 2, 3, 4, 5];
let mut ptr: *const u8 = data.as_ptr();
let step = 2;
let end_rounded_up = ptr.wrapping_add(6);
// This loop prints "1, 3, 5, "
while ptr != end_rounded_up {
unsafe {
print!("{}, ", *ptr);
}
ptr = ptr.wrapping_add(step);
}
```
[source](https://doc.rust-lang.org/src/core/ptr/const_ptr.rs.html#1082)const: [unstable](https://github.com/rust-lang/rust/issues/96283 "Tracking issue for const_pointer_byte_offsets") · #### pub fn wrapping\_byte\_add(self, count: usize) -> \*const T
🔬This is a nightly-only experimental API. (`pointer_byte_offsets` [#96283](https://github.com/rust-lang/rust/issues/96283))
Calculates the offset from a pointer in bytes using wrapping arithmetic. (convenience for `.wrapping_byte_offset(count as isize)`)
`count` is in units of bytes.
This is purely a convenience for casting to a `u8` pointer and using [wrapping\_add](primitive.pointer#method.wrapping_add "pointer::wrapping_add") on it. See that method for documentation.
For non-`Sized` pointees this operation changes only the data pointer, leaving the metadata untouched.
[source](https://doc.rust-lang.org/src/core/ptr/const_ptr.rs.html#1141-1143)1.26.0 (const: 1.61.0) · #### pub const fn wrapping\_sub(self, count: usize) -> \*const T
Calculates the offset from a pointer using wrapping arithmetic. (convenience for `.wrapping_offset((count as isize).wrapping_neg())`)
`count` is in units of T; e.g., a `count` of 3 represents a pointer offset of `3 * size_of::<T>()` bytes.
##### Safety
This operation itself is always safe, but using the resulting pointer is not.
The resulting pointer “remembers” the [allocated object](ptr/index#allocated-object) that `self` points to; it must not be used to read or write other allocated objects.
In other words, `let z = x.wrapping_sub((x as usize) - (y as usize))` does *not* make `z` the same as `y` even if we assume `T` has size `1` and there is no overflow: `z` is still attached to the object `x` is attached to, and dereferencing it is Undefined Behavior unless `x` and `y` point into the same allocated object.
Compared to [`sub`](#method.sub), this method basically delays the requirement of staying within the same allocated object: [`sub`](#method.sub) is immediate Undefined Behavior when crossing object boundaries; `wrapping_sub` produces a pointer but still leads to Undefined Behavior if a pointer is dereferenced when it is out-of-bounds of the object it is attached to. [`sub`](#method.sub) can be optimized better and is thus preferable in performance-sensitive code.
The delayed check only considers the value of the pointer that was dereferenced, not the intermediate values used during the computation of the final result. For example, `x.wrapping_add(o).wrapping_sub(o)` is always the same as `x`. In other words, leaving the allocated object and then re-entering it later is permitted.
##### Examples
Basic usage:
```
// Iterate using a raw pointer in increments of two elements (backwards)
let data = [1u8, 2, 3, 4, 5];
let mut ptr: *const u8 = data.as_ptr();
let start_rounded_down = ptr.wrapping_sub(2);
ptr = ptr.wrapping_add(4);
let step = 2;
// This loop prints "5, 3, 1, "
while ptr != start_rounded_down {
unsafe {
print!("{}, ", *ptr);
}
ptr = ptr.wrapping_sub(step);
}
```
[source](https://doc.rust-lang.org/src/core/ptr/const_ptr.rs.html#1162)const: [unstable](https://github.com/rust-lang/rust/issues/96283 "Tracking issue for const_pointer_byte_offsets") · #### pub fn wrapping\_byte\_sub(self, count: usize) -> \*const T
🔬This is a nightly-only experimental API. (`pointer_byte_offsets` [#96283](https://github.com/rust-lang/rust/issues/96283))
Calculates the offset from a pointer in bytes using wrapping arithmetic. (convenience for `.wrapping_offset((count as isize).wrapping_neg())`)
`count` is in units of bytes.
This is purely a convenience for casting to a `u8` pointer and using [wrapping\_sub](primitive.pointer#method.wrapping_sub "pointer::wrapping_sub") on it. See that method for documentation.
For non-`Sized` pointees this operation changes only the data pointer, leaving the metadata untouched.
[source](https://doc.rust-lang.org/src/core/ptr/const_ptr.rs.html#1176-1178)1.26.0 (const: [unstable](https://github.com/rust-lang/rust/issues/80377 "Tracking issue for const_ptr_read")) · #### pub unsafe fn read(self) -> T
Reads the value from `self` without moving it. This leaves the memory in `self` unchanged.
See [`ptr::read`](ptr/fn.read) for safety concerns and examples.
[source](https://doc.rust-lang.org/src/core/ptr/const_ptr.rs.html#1197-1199)1.26.0 · #### pub unsafe fn read\_volatile(self) -> T
Performs a volatile read of the value from `self` without moving it. This leaves the memory in `self` 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.
See [`ptr::read_volatile`](ptr/fn.read_volatile) for safety concerns and examples.
[source](https://doc.rust-lang.org/src/core/ptr/const_ptr.rs.html#1217-1219)1.26.0 (const: [unstable](https://github.com/rust-lang/rust/issues/80377 "Tracking issue for const_ptr_read")) · #### pub unsafe fn read\_unaligned(self) -> T
Reads the value from `self` without moving it. This leaves the memory in `self` unchanged.
Unlike `read`, the pointer may be unaligned.
See [`ptr::read_unaligned`](ptr/fn.read_unaligned) for safety concerns and examples.
[source](https://doc.rust-lang.org/src/core/ptr/const_ptr.rs.html#1237-1239)1.26.0 (const: 1.63.0) · #### pub const unsafe fn copy\_to(self, dest: \*mut T, count: usize)
Copies `count * size_of<T>` bytes from `self` to `dest`. The source and destination may overlap.
NOTE: this has the *same* argument order as [`ptr::copy`](ptr/fn.copy).
See [`ptr::copy`](ptr/fn.copy) for safety concerns and examples.
[source](https://doc.rust-lang.org/src/core/ptr/const_ptr.rs.html#1257-1259)1.26.0 (const: 1.63.0) · #### pub const unsafe fn copy\_to\_nonoverlapping(self, dest: \*mut T, count: usize)
Copies `count * size_of<T>` bytes from `self` to `dest`. The source and destination may *not* overlap.
NOTE: this has the *same* argument order as [`ptr::copy_nonoverlapping`](ptr/fn.copy_nonoverlapping).
See [`ptr::copy_nonoverlapping`](ptr/fn.copy_nonoverlapping) for safety concerns and examples.
[source](https://doc.rust-lang.org/src/core/ptr/const_ptr.rs.html#1307-1309)1.36.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90962 "Tracking issue for const_align_offset")) · #### pub fn align\_offset(self, align: usize) -> usize
Computes the offset that needs to be applied to the pointer in order to make it aligned to `align`.
If it is not possible to align the pointer, the implementation returns `usize::MAX`. It is permissible for the implementation to *always* return `usize::MAX`. Only your algorithm’s performance can depend on getting a usable offset here, not its correctness.
The offset is expressed in number of `T` elements, and not bytes. The value returned can be used with the `wrapping_add` method.
There are no guarantees whatsoever that offsetting the pointer will not overflow or go beyond the allocation that the pointer points into. It is up to the caller to ensure that the returned offset is correct in all terms other than alignment.
##### Panics
The function panics if `align` is not a power-of-two.
##### Examples
Accessing adjacent `u8` as `u16`
```
use std::mem::align_of;
let x = [5_u8, 6, 7, 8, 9];
let ptr = x.as_ptr();
let offset = ptr.align_offset(align_of::<u16>());
if offset < x.len() - 1 {
let u16_ptr = ptr.add(offset).cast::<u16>();
assert!(*u16_ptr == u16::from_ne_bytes([5, 6]) || *u16_ptr == u16::from_ne_bytes([6, 7]));
} else {
// while the pointer can be aligned via `offset`, it would point
// outside the allocation
}
```
[source](https://doc.rust-lang.org/src/core/ptr/const_ptr.rs.html#1336-1338)#### pub fn is\_aligned(self) -> bool
🔬This is a nightly-only experimental API. (`pointer_is_aligned` [#96284](https://github.com/rust-lang/rust/issues/96284))
Returns whether the pointer is properly aligned for `T`.
[source](https://doc.rust-lang.org/src/core/ptr/const_ptr.rs.html#1354)#### pub fn is\_aligned\_to(self, align: usize) -> bool
🔬This is a nightly-only experimental API. (`pointer_is_aligned` [#96284](https://github.com/rust-lang/rust/issues/96284))
Returns whether the pointer is aligned to `align`.
For non-`Sized` pointees this operation considers only the data pointer, ignoring the metadata.
##### Panics
The function panics if `align` is not a power-of-two (this includes 0).
[source](https://doc.rust-lang.org/src/core/ptr/mut_ptr.rs.html#1635)### impl<T> \*mut [T]
[source](https://doc.rust-lang.org/src/core/ptr/mut_ptr.rs.html#1655)const: [unstable](https://github.com/rust-lang/rust/issues/71146 "Tracking issue for const_slice_ptr_len") · #### pub fn len(self) -> usize
🔬This is a nightly-only experimental API. (`slice_ptr_len` [#71146](https://github.com/rust-lang/rust/issues/71146))
Returns the length of a raw slice.
The returned value is the number of **elements**, not the number of bytes.
This function is safe, even when the raw slice cannot be cast to a slice reference because the pointer is null or unaligned.
##### Examples
```
#![feature(slice_ptr_len)]
use std::ptr;
let slice: *mut [i8] = ptr::slice_from_raw_parts_mut(ptr::null_mut(), 3);
assert_eq!(slice.len(), 3);
```
[source](https://doc.rust-lang.org/src/core/ptr/mut_ptr.rs.html#1673)const: [unstable](https://github.com/rust-lang/rust/issues/71146 "Tracking issue for const_slice_ptr_len") · #### pub fn is\_empty(self) -> bool
🔬This is a nightly-only experimental API. (`slice_ptr_len` [#71146](https://github.com/rust-lang/rust/issues/71146))
Returns `true` if the raw slice has a length of 0.
##### Examples
```
#![feature(slice_ptr_len)]
let mut a = [1, 2, 3];
let ptr = &mut a as *mut [_];
assert!(!ptr.is_empty());
```
[source](https://doc.rust-lang.org/src/core/ptr/mut_ptr.rs.html#1720)#### pub unsafe fn split\_at\_mut(self, mid: usize) -> (\*mut [T], \*mut [T])
🔬This is a nightly-only experimental API. (`raw_slice_split` [#95595](https://github.com/rust-lang/rust/issues/95595))
Divides one mutable raw 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`.
##### Safety
`mid` must be [in-bounds](#method.add) of the underlying [allocated object](ptr/index#allocated-object). Which means `self` must be dereferenceable and span a single allocation that is at least `mid * size_of::<T>()` bytes long. Not upholding these requirements is *[undefined behavior](../reference/behavior-considered-undefined)* even if the resulting pointers are not used.
Since `len` being in-bounds it is not a safety invariant of `*mut [T]` the safety requirements of this method are the same as for [`split_at_mut_unchecked`](#method.split_at_mut_unchecked). The explicit bounds check is only as useful as `len` is correct.
##### Examples
```
#![feature(raw_slice_split)]
#![feature(slice_ptr_get)]
let mut v = [1, 0, 3, 0, 5, 6];
let ptr = &mut v as *mut [_];
unsafe {
let (left, right) = ptr.split_at_mut(2);
assert_eq!(&*left, [1, 0]);
assert_eq!(&*right, [3, 0, 5, 6]);
}
```
[source](https://doc.rust-lang.org/src/core/ptr/mut_ptr.rs.html#1763)#### pub unsafe fn split\_at\_mut\_unchecked(self, mid: usize) -> (\*mut [T], \*mut [T])
🔬This is a nightly-only experimental API. (`raw_slice_split` [#95595](https://github.com/rust-lang/rust/issues/95595))
Divides one mutable raw 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).
##### Safety
`mid` must be [in-bounds](#method.add) of the underlying [allocated object]. Which means `self` must be dereferenceable and span a single allocation that is at least `mid * size_of::<T>()` bytes long. Not upholding these requirements is *[undefined behavior](../reference/behavior-considered-undefined)* even if the resulting pointers are not used.
##### Examples
```
#![feature(raw_slice_split)]
let mut v = [1, 0, 3, 0, 5, 6];
// scoped to restrict the lifetime of the borrows
unsafe {
let ptr = &mut v as *mut [_];
let (left, right) = ptr.split_at_mut_unchecked(2);
assert_eq!(&*left, [1, 0]);
assert_eq!(&*right, [3, 0, 5, 6]);
(&mut *left)[1] = 2;
(&mut *right)[1] = 4;
}
assert_eq!(v, [1, 2, 3, 4, 5, 6]);
```
[source](https://doc.rust-lang.org/src/core/ptr/mut_ptr.rs.html#1791)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.
This is equivalent to casting `self` to `*mut T`, but more type-safe.
##### Examples
```
#![feature(slice_ptr_get)]
use std::ptr;
let slice: *mut [i8] = ptr::slice_from_raw_parts_mut(ptr::null_mut(), 3);
assert_eq!(slice.as_mut_ptr(), ptr::null_mut());
```
[source](https://doc.rust-lang.org/src/core/ptr/mut_ptr.rs.html#1818-1820)const: unstable · #### pub unsafe fn get\_unchecked\_mut<I>( self, index: I) -> \*mut <I as SliceIndex<[T]>>::Outputwhere 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](#method.add) 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)]
let x = &mut [1, 2, 4] as *mut [i32];
unsafe {
assert_eq!(x.get_unchecked_mut(1), x.as_mut_ptr().add(1));
}
```
[source](https://doc.rust-lang.org/src/core/ptr/mut_ptr.rs.html#1869)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) -> Option<&'a [MaybeUninit<T>]>
🔬This is a nightly-only experimental API. (`ptr_as_uninit` [#75402](https://github.com/rust-lang/rust/issues/75402))
Returns `None` if the pointer is null, or else returns a shared slice to the value wrapped in `Some`. In contrast to [`as_ref`](#method.as_ref-1), this does not require that the value has to be initialized.
For the mutable counterpart see [`as_uninit_slice_mut`](#method.as_uninit_slice_mut).
##### Safety
When calling this method, you have to ensure that *either* the pointer is null *or* all of the following is true:
* The pointer must be [valid](ptr/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](ptr/index#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()`](ptr/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/mut_ptr.rs.html#1921)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) -> Option<&'a mut [MaybeUninit<T>]>
🔬This is a nightly-only experimental API. (`ptr_as_uninit` [#75402](https://github.com/rust-lang/rust/issues/75402))
Returns `None` if the pointer is null, or else returns a unique slice to the value wrapped in `Some`. In contrast to [`as_mut`](#method.as_mut), this does not require that the value has to be initialized.
For the shared counterpart see [`as_uninit_slice`](#method.as_uninit_slice-1).
##### Safety
When calling this method, you have to ensure that *either* the pointer is null *or* all of the following is true:
* The pointer must be [valid](ptr/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](ptr/index#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()`](ptr/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").
[source](https://doc.rust-lang.org/src/core/ptr/mut_ptr.rs.html#6)### impl<T> \*mut Twhere T: ?[Sized](marker/trait.sized "trait std::marker::Sized"),
[source](https://doc.rust-lang.org/src/core/ptr/mut_ptr.rs.html#35)const: [unstable](https://github.com/rust-lang/rust/issues/74939 "Tracking issue for const_ptr_is_null") · #### pub fn is\_null(self) -> bool
Returns `true` if the pointer is null.
Note that unsized types have many possible null pointers, as only the raw data pointer is considered, not their length, vtable, etc. Therefore, two pointers that are null may still not compare equal to each other.
###### [Behavior during const evaluation](#behavior-during-const-evaluation-1)
When this function is used during const evaluation, it may return `false` for pointers that turn out to be null at runtime. Specifically, when a pointer to some memory is offset beyond its bounds in such a way that the resulting pointer is null, the function will still return `false`. There is no way for CTFE to know the absolute position of that memory, so we cannot tell if the pointer is null or not.
##### Examples
Basic usage:
```
let mut s = [1, 2, 3];
let ptr: *mut u32 = s.as_mut_ptr();
assert!(!ptr.is_null());
```
[source](https://doc.rust-lang.org/src/core/ptr/mut_ptr.rs.html#48)1.38.0 (const: 1.38.0) · #### pub const fn cast<U>(self) -> \*mut U
Casts to a pointer of another type.
[source](https://doc.rust-lang.org/src/core/ptr/mut_ptr.rs.html#83-85)#### pub fn with\_metadata\_of<U>(self, val: \*mut U) -> \*mut Uwhere U: ?[Sized](marker/trait.sized "trait std::marker::Sized"),
🔬This is a nightly-only experimental API. (`set_ptr_value` [#75091](https://github.com/rust-lang/rust/issues/75091))
Use the pointer value in a new pointer of another type.
In case `val` is a (fat) pointer to an unsized type, this operation will ignore the pointer part, whereas for (thin) pointers to sized types, this has the same effect as a simple cast.
The resulting pointer will have provenance of `self`, i.e., for a fat pointer, this operation is semantically the same as creating a new fat pointer with the data pointer value of `self` but the metadata of `val`.
##### Examples
This function is primarily useful for allowing byte-wise pointer arithmetic on potentially fat pointers:
```
#![feature(set_ptr_value)]
let mut arr: [i32; 3] = [1, 2, 3];
let mut ptr = arr.as_mut_ptr() as *mut dyn Debug;
let thin = ptr as *mut u8;
unsafe {
ptr = thin.add(8).with_metadata_of(ptr);
println!("{:?}", &*ptr); // will print "3"
}
```
[source](https://doc.rust-lang.org/src/core/ptr/mut_ptr.rs.html#108)1.65.0 (const: 1.65.0) · #### pub const fn cast\_const(self) -> \*const T
Changes constness without changing the type.
This is a bit safer than `as` because it wouldn’t silently change the type if the code is refactored.
While not strictly required (`*mut T` coerces to `*const T`), this is provided for symmetry with [`cast_mut`](#method.cast_mut) on `*const T` and may have documentation value if used instead of implicit coercion.
[source](https://doc.rust-lang.org/src/core/ptr/mut_ptr.rs.html#133-135)#### pub fn to\_bits(self) -> usize
🔬This is a nightly-only experimental API. (`ptr_to_from_bits` [#91126](https://github.com/rust-lang/rust/issues/91126))
Casts a pointer to its raw bits.
This is equivalent to `as usize`, but is more specific to enhance readability. The inverse method is [`from_bits`](#method.from_bits-1).
In particular, `*p as usize` and `p as usize` will both compile for pointers to numeric types but do very different things, so using this helps emphasize that reading the bits was intentional.
##### Examples
```
#![feature(ptr_to_from_bits)]
let mut array = [13, 42];
let mut it = array.iter_mut();
let p0: *mut i32 = it.next().unwrap();
assert_eq!(<*mut _>::from_bits(p0.to_bits()), p0);
let p1: *mut i32 = it.next().unwrap();
assert_eq!(p1.to_bits() - p0.to_bits(), 4);
```
[source](https://doc.rust-lang.org/src/core/ptr/mut_ptr.rs.html#154-156)#### pub fn from\_bits(bits: usize) -> \*mut T
🔬This is a nightly-only experimental API. (`ptr_to_from_bits` [#91126](https://github.com/rust-lang/rust/issues/91126))
Creates a pointer from its raw bits.
This is equivalent to `as *mut T`, but is more specific to enhance readability. The inverse method is [`to_bits`](#method.to_bits-1).
##### Examples
```
#![feature(ptr_to_from_bits)]
use std::ptr::NonNull;
let dangling: *mut u8 = NonNull::dangling().as_ptr();
assert_eq!(<*mut u8>::from_bits(1), dangling);
```
[source](https://doc.rust-lang.org/src/core/ptr/mut_ptr.rs.html#187-189)#### pub fn addr(self) -> usize
🔬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.
This is similar to `self as usize`, which semantically discards *provenance* and *address-space* information. However, unlike `self as usize`, casting the returned address back to a pointer yields [`invalid`](ptr/fn.invalid "invalid"), which is undefined behavior to dereference. To properly restore the lost information and obtain a dereferenceable pointer, use [`with_addr`](primitive.pointer#method.with_addr "pointer::with_addr") or [`map_addr`](primitive.pointer#method.map_addr "pointer::map_addr").
If using those APIs is not possible because there is no way to preserve a pointer with the required provenance, use [`expose_addr`](primitive.pointer#method.expose_addr "pointer::expose_addr") and [`from_exposed_addr_mut`](ptr/fn.from_exposed_addr_mut "from_exposed_addr_mut") instead. However, note that this makes your code less portable and less amenable to tools that check for compliance with the Rust memory model.
On most platforms this will produce a value with the same bytes as the original pointer, because all the bytes are dedicated to describing the address. Platforms which need to store additional information in the pointer may perform a change of representation to produce a value containing only the address portion of the pointer. What that means is up to the platform to define.
This API and its claimed semantics are part of the Strict Provenance experiment, and as such might change in the future (including possibly weakening this so it becomes wholly equivalent to `self as usize`). See the [module documentation](ptr/index "crate::ptr") for details.
[source](https://doc.rust-lang.org/src/core/ptr/mut_ptr.rs.html#224-226)#### pub fn expose\_addr(self) -> usize
🔬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, and ‘exposes’ the “provenance” part for future use in [`from_exposed_addr`](ptr/fn.from_exposed_addr "from_exposed_addr").
This is equivalent to `self as usize`, which semantically discards *provenance* and *address-space* information. Furthermore, this (like the `as` cast) has the implicit side-effect of marking the provenance as ‘exposed’, so on platforms that support it you can later call [`from_exposed_addr_mut`](ptr/fn.from_exposed_addr_mut) to reconstitute the original pointer including its provenance. (Reconstructing address space information, if required, is your responsibility.)
Using this method means that code is *not* following Strict Provenance rules. Supporting [`from_exposed_addr_mut`](ptr/fn.from_exposed_addr_mut) 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 [`addr`](primitive.pointer#method.addr "pointer::addr") wherever possible.
On most platforms this will produce a value with the same bytes as the original pointer, because all the bytes are dedicated to describing the address. Platforms which need to store additional information in the pointer may not support this operation, since the ‘expose’ side-effect which is required for [`from_exposed_addr_mut`](ptr/fn.from_exposed_addr_mut) to work is typically not available.
This API and its claimed semantics are part of the Strict Provenance experiment, see the [module documentation](ptr/index "crate::ptr") for details.
[source](https://doc.rust-lang.org/src/core/ptr/mut_ptr.rs.html#247-249)#### pub fn with\_addr(self, addr: usize) -> \*mut 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.
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`](primitive.pointer#method.wrapping_offset "pointer::wrapping_offset") to offset `self` to the given address, and therefore has all the same capabilities and restrictions.
This API and its claimed semantics are part of the Strict Provenance experiment, see the [module documentation](ptr/index "crate::ptr") for details.
[source](https://doc.rust-lang.org/src/core/ptr/mut_ptr.rs.html#273-275)#### pub fn map\_addr(self, f: impl FnOnce(usize) -> usize) -> \*mut 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.
This is a convenience for [`with_addr`](primitive.pointer#method.with_addr "pointer::with_addr"), see that method for details.
This API and its claimed semantics are part of the Strict Provenance experiment, see the [module documentation](ptr/index "crate::ptr") for details.
[source](https://doc.rust-lang.org/src/core/ptr/mut_ptr.rs.html#286)const: [unstable](https://github.com/rust-lang/rust/issues/81513 "Tracking issue for ptr_metadata") · #### pub fn to\_raw\_parts(self) -> (\*mut (), <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 [`from_raw_parts_mut`](ptr/fn.from_raw_parts_mut "from_raw_parts_mut").
[source](https://doc.rust-lang.org/src/core/ptr/mut_ptr.rs.html#352)1.9.0 (const: [unstable](https://github.com/rust-lang/rust/issues/91822 "Tracking issue for const_ptr_as_ref")) · #### pub unsafe fn as\_ref<'a>(self) -> Option<&'a T>
Returns `None` if the pointer is null, or else returns a shared reference to the value wrapped in `Some`. If the value may be uninitialized, [`as_uninit_ref`](#method.as_uninit_ref-1) must be used instead.
For the mutable counterpart see [`as_mut`](#method.as_mut).
##### Safety
When calling this method, you have to ensure that *either* the pointer is null *or* all of the following is true:
* The pointer must be properly aligned.
* It must be “dereferenceable” in the sense defined in [the module documentation](ptr/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
Basic usage:
```
let ptr: *mut u8 = &mut 10u8 as *mut u8;
unsafe {
if let Some(val_back) = ptr.as_ref() {
println!("We got back the value: {val_back}!");
}
}
```
##### Null-unchecked version
If you are sure the pointer can never be null and are looking for some kind of `as_ref_unchecked` that returns the `&T` instead of `Option<&T>`, know that you can dereference the pointer directly.
```
let ptr: *mut u8 = &mut 10u8 as *mut u8;
unsafe {
let val_back = &*ptr;
println!("We got back the value: {val_back}!");
}
```
[source](https://doc.rust-lang.org/src/core/ptr/mut_ptr.rs.html#403-405)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) -> Option<&'a MaybeUninit<T>>
🔬This is a nightly-only experimental API. (`ptr_as_uninit` [#75402](https://github.com/rust-lang/rust/issues/75402))
Returns `None` if the pointer is null, or else returns a shared reference to the value wrapped in `Some`. In contrast to [`as_ref`](#method.as_ref-1), this does not require that the value has to be initialized.
For the mutable counterpart see [`as_uninit_mut`](#method.as_uninit_mut).
##### Safety
When calling this method, you have to ensure that *either* the pointer is null *or* all of the following is true:
* The pointer must be properly aligned.
* It must be “dereferenceable” in the sense defined in [the module documentation](ptr/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!
##### Examples
Basic usage:
```
#![feature(ptr_as_uninit)]
let ptr: *mut u8 = &mut 10u8 as *mut u8;
unsafe {
if let Some(val_back) = ptr.as_uninit_ref() {
println!("We got back the value: {}!", val_back.assume_init());
}
}
```
[source](https://doc.rust-lang.org/src/core/ptr/mut_ptr.rs.html#468-470)const: 1.61.0 · #### pub const unsafe fn offset(self, count: isize) -> \*mut T
Calculates the offset from a pointer.
`count` is in units of T; e.g., a `count` of 3 represents a pointer offset of `3 * size_of::<T>()` bytes.
##### Safety
If any of the following conditions are violated, the result is Undefined Behavior:
* Both the starting and resulting pointer must be either in bounds or one byte past the end of the same [allocated object](ptr/index#allocated-object).
* The computed offset, **in bytes**, cannot overflow an `isize`.
* The offset being in bounds cannot rely on “wrapping around” the address space. That is, the infinite-precision sum, **in bytes** must fit in a usize.
The compiler and standard library generally tries to ensure allocations never reach a size where an offset is a concern. For instance, `Vec` and `Box` ensure they never allocate more than `isize::MAX` bytes, so `vec.as_ptr().add(vec.len())` is always safe.
Most platforms fundamentally can’t even construct such an allocation. For instance, no known 64-bit platform can ever serve a request for 263 bytes due to page-table limitations or splitting the address space. However, some 32-bit and 16-bit platforms may successfully serve a request for more than `isize::MAX` bytes with things like Physical Address Extension. As such, memory acquired directly from allocators or memory mapped files *may* be too large to handle with this function.
Consider using [`wrapping_offset`](#method.wrapping_offset) instead if these constraints are difficult to satisfy. The only advantage of this method is that it enables more aggressive compiler optimizations.
##### Examples
Basic usage:
```
let mut s = [1, 2, 3];
let ptr: *mut u32 = s.as_mut_ptr();
unsafe {
println!("{}", *ptr.offset(1));
println!("{}", *ptr.offset(2));
}
```
[source](https://doc.rust-lang.org/src/core/ptr/mut_ptr.rs.html#493)const: [unstable](https://github.com/rust-lang/rust/issues/96283 "Tracking issue for const_pointer_byte_offsets") · #### pub unsafe fn byte\_offset(self, count: isize) -> \*mut T
🔬This is a nightly-only experimental API. (`pointer_byte_offsets` [#96283](https://github.com/rust-lang/rust/issues/96283))
Calculates the offset from a pointer in bytes.
`count` is in units of **bytes**.
This is purely a convenience for casting to a `u8` pointer and using [offset](primitive.pointer#method.offset "pointer::offset") on it. See that method for documentation and safety requirements.
For non-`Sized` pointees this operation changes only the data pointer, leaving the metadata untouched.
[source](https://doc.rust-lang.org/src/core/ptr/mut_ptr.rs.html#552-554)1.16.0 (const: 1.61.0) · #### pub const fn wrapping\_offset(self, count: isize) -> \*mut T
Calculates the offset from a pointer using wrapping arithmetic. `count` is in units of T; e.g., a `count` of 3 represents a pointer offset of `3 * size_of::<T>()` bytes.
##### Safety
This operation itself is always safe, but using the resulting pointer is not.
The resulting pointer “remembers” the [allocated object](ptr/index#allocated-object) that `self` points to; it must not be used to read or write other allocated objects.
In other words, `let z = x.wrapping_offset((y as isize) - (x as isize))` does *not* make `z` the same as `y` even if we assume `T` has size `1` and there is no overflow: `z` is still attached to the object `x` is attached to, and dereferencing it is Undefined Behavior unless `x` and `y` point into the same allocated object.
Compared to [`offset`](#method.offset), this method basically delays the requirement of staying within the same allocated object: [`offset`](#method.offset) is immediate Undefined Behavior when crossing object boundaries; `wrapping_offset` produces a pointer but still leads to Undefined Behavior if a pointer is dereferenced when it is out-of-bounds of the object it is attached to. [`offset`](#method.offset) can be optimized better and is thus preferable in performance-sensitive code.
The delayed check only considers the value of the pointer that was dereferenced, not the intermediate values used during the computation of the final result. For example, `x.wrapping_offset(o).wrapping_offset(o.wrapping_neg())` is always the same as `x`. In other words, leaving the allocated object and then re-entering it later is permitted.
##### Examples
Basic usage:
```
// Iterate using a raw pointer in increments of two elements
let mut data = [1u8, 2, 3, 4, 5];
let mut ptr: *mut u8 = data.as_mut_ptr();
let step = 2;
let end_rounded_up = ptr.wrapping_offset(6);
while ptr != end_rounded_up {
unsafe {
*ptr = 0;
}
ptr = ptr.wrapping_offset(step);
}
assert_eq!(&data, &[0, 2, 0, 4, 0]);
```
[source](https://doc.rust-lang.org/src/core/ptr/mut_ptr.rs.html#574)const: [unstable](https://github.com/rust-lang/rust/issues/96283 "Tracking issue for const_pointer_byte_offsets") · #### pub fn wrapping\_byte\_offset(self, count: isize) -> \*mut T
🔬This is a nightly-only experimental API. (`pointer_byte_offsets` [#96283](https://github.com/rust-lang/rust/issues/96283))
Calculates the offset from a pointer in bytes using wrapping arithmetic.
`count` is in units of **bytes**.
This is purely a convenience for casting to a `u8` pointer and using [wrapping\_offset](primitive.pointer#method.wrapping_offset "pointer::wrapping_offset") on it. See that method for documentation.
For non-`Sized` pointees this operation changes only the data pointer, leaving the metadata untouched.
[source](https://doc.rust-lang.org/src/core/ptr/mut_ptr.rs.html#591)#### pub fn mask(self, mask: usize) -> \*mut T
🔬This is a nightly-only experimental API. (`ptr_mask` [#98290](https://github.com/rust-lang/rust/issues/98290))
Masks out bits of the pointer according to a mask.
This is convenience for `ptr.map_addr(|a| a & mask)`.
For non-`Sized` pointees this operation changes only the data pointer, leaving the metadata untouched.
[source](https://doc.rust-lang.org/src/core/ptr/mut_ptr.rs.html#657)1.9.0 (const: [unstable](https://github.com/rust-lang/rust/issues/91822 "Tracking issue for const_ptr_as_ref")) · #### pub unsafe fn as\_mut<'a>(self) -> Option<&'a mut T>
Returns `None` if the pointer is null, or else returns a unique reference to the value wrapped in `Some`. If the value may be uninitialized, [`as_uninit_mut`](#method.as_uninit_mut) must be used instead.
For the shared counterpart see [`as_ref`](#method.as_ref-1).
##### Safety
When calling this method, you have to ensure that *either* the pointer is null *or* all of the following is true:
* The pointer must be properly aligned.
* It must be “dereferenceable” in the sense defined in [the module documentation](ptr/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
Basic usage:
```
let mut s = [1, 2, 3];
let ptr: *mut u32 = s.as_mut_ptr();
let first_value = unsafe { ptr.as_mut().unwrap() };
*first_value = 4;
println!("{s:?}"); // It'll print: "[4, 2, 3]".
```
##### Null-unchecked version
If you are sure the pointer can never be null and are looking for some kind of `as_mut_unchecked` that returns the `&mut T` instead of `Option<&mut T>`, know that you can dereference the pointer directly.
```
let mut s = [1, 2, 3];
let ptr: *mut u32 = s.as_mut_ptr();
let first_value = unsafe { &mut *ptr };
*first_value = 4;
println!("{s:?}"); // It'll print: "[4, 2, 3]".
```
[source](https://doc.rust-lang.org/src/core/ptr/mut_ptr.rs.html#692-694)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) -> Option<&'a mut MaybeUninit<T>>
🔬This is a nightly-only experimental API. (`ptr_as_uninit` [#75402](https://github.com/rust-lang/rust/issues/75402))
Returns `None` if the pointer is null, or else returns a unique reference to the value wrapped in `Some`. In contrast to [`as_mut`](#method.as_mut), this does not require that the value has to be initialized.
For the shared counterpart see [`as_uninit_ref`](#method.as_uninit_ref-1).
##### Safety
When calling this method, you have to ensure that *either* the pointer is null *or* all of the following is true:
* The pointer must be properly aligned.
* It must be “dereferenceable” in the sense defined in [the module documentation](ptr/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/mut_ptr.rs.html#721-723)const: [unstable](https://github.com/rust-lang/rust/issues/53020 "Tracking issue for const_raw_ptr_comparison") · #### pub fn guaranteed\_eq(self, other: \*mut T) -> Option<bool>
🔬This is a nightly-only experimental API. (`const_raw_ptr_comparison` [#53020](https://github.com/rust-lang/rust/issues/53020))
Returns whether two pointers are guaranteed to be equal.
At runtime this function behaves like `Some(self == other)`. However, in some contexts (e.g., compile-time evaluation), it is not always possible to determine equality of two pointers, so this function may spuriously return `None` for pointers that later actually turn out to have its equality known. But when it returns `Some`, the pointers’ equality is guaranteed to be known.
The return value may change from `Some` to `None` and vice versa depending on the compiler version and unsafe code must not rely on the result of this function for soundness. It is suggested to only use this function for performance optimizations where spurious `None` return values by this function do not affect the outcome, but just the performance. The consequences of using this method to make runtime and compile-time code behave differently have not been explored. This method should not be used to introduce such differences, and it should also not be stabilized before we have a better understanding of this issue.
[source](https://doc.rust-lang.org/src/core/ptr/mut_ptr.rs.html#748-750)const: [unstable](https://github.com/rust-lang/rust/issues/53020 "Tracking issue for const_raw_ptr_comparison") · #### pub fn guaranteed\_ne(self, other: \*mut T) -> Option<bool>
🔬This is a nightly-only experimental API. (`const_raw_ptr_comparison` [#53020](https://github.com/rust-lang/rust/issues/53020))
Returns whether two pointers are guaranteed to be inequal.
At runtime this function behaves like `Some(self == other)`. However, in some contexts (e.g., compile-time evaluation), it is not always possible to determine inequality of two pointers, so this function may spuriously return `None` for pointers that later actually turn out to have its inequality known. But when it returns `Some`, the pointers’ inequality is guaranteed to be known.
The return value may change from `Some` to `None` and vice versa depending on the compiler version and unsafe code must not rely on the result of this function for soundness. It is suggested to only use this function for performance optimizations where spurious `None` return values by this function do not affect the outcome, but just the performance. The consequences of using this method to make runtime and compile-time code behave differently have not been explored. This method should not be used to introduce such differences, and it should also not be stabilized before we have a better understanding of this issue.
[source](https://doc.rust-lang.org/src/core/ptr/mut_ptr.rs.html#840-842)1.47.0 (const: 1.65.0) · #### pub const unsafe fn offset\_from(self, origin: \*const T) -> isize
Calculates the distance between two pointers. The returned value is in units of T: the distance in bytes divided by `mem::size_of::<T>()`.
This function is the inverse of [`offset`](#method.offset-1).
##### Safety
If any of the following conditions are violated, the result is Undefined Behavior:
* Both the starting and other pointer must be either in bounds or one byte past the end of the same [allocated object](ptr/index#allocated-object).
* Both pointers must be *derived from* a pointer to the same object. (See below for an example.)
* The distance between the pointers, in bytes, must be an exact multiple of the size of `T`.
* The distance between the pointers, **in bytes**, cannot overflow an `isize`.
* The distance being in bounds cannot rely on “wrapping around” the address space.
Rust types are never larger than `isize::MAX` and Rust allocations never wrap around the address space, so two pointers within some value of any Rust type `T` will always satisfy the last two conditions. The standard library also generally ensures that allocations never reach a size where an offset is a concern. For instance, `Vec` and `Box` ensure they never allocate more than `isize::MAX` bytes, so `ptr_into_vec.offset_from(vec.as_ptr())` always satisfies the last two conditions.
Most platforms fundamentally can’t even construct such a large allocation. For instance, no known 64-bit platform can ever serve a request for 263 bytes due to page-table limitations or splitting the address space. However, some 32-bit and 16-bit platforms may successfully serve a request for more than `isize::MAX` bytes with things like Physical Address Extension. As such, memory acquired directly from allocators or memory mapped files *may* be too large to handle with this function. (Note that [`offset`](#method.offset-1) and [`add`](#method.add) also have a similar limitation and hence cannot be used on such large allocations either.)
##### Panics
This function panics if `T` is a Zero-Sized Type (“ZST”).
##### Examples
Basic usage:
```
let mut a = [0; 5];
let ptr1: *mut i32 = &mut a[1];
let ptr2: *mut i32 = &mut a[3];
unsafe {
assert_eq!(ptr2.offset_from(ptr1), 2);
assert_eq!(ptr1.offset_from(ptr2), -2);
assert_eq!(ptr1.offset(2), ptr2);
assert_eq!(ptr2.offset(-2), ptr1);
}
```
*Incorrect* usage:
```
let ptr1 = Box::into_raw(Box::new(0u8));
let ptr2 = Box::into_raw(Box::new(1u8));
let diff = (ptr2 as isize).wrapping_sub(ptr1 as isize);
// Make ptr2_other an "alias" of ptr2, but derived from ptr1.
let ptr2_other = (ptr1 as *mut u8).wrapping_offset(diff);
assert_eq!(ptr2 as usize, ptr2_other as usize);
// Since ptr2_other and ptr2 are derived from pointers to different objects,
// computing their offset is undefined behavior, even though
// they point to the same address!
unsafe {
let zero = ptr2_other.offset_from(ptr2); // Undefined Behavior
}
```
[source](https://doc.rust-lang.org/src/core/ptr/mut_ptr.rs.html#861)const: [unstable](https://github.com/rust-lang/rust/issues/96283 "Tracking issue for const_pointer_byte_offsets") · #### pub unsafe fn byte\_offset\_from(self, origin: \*const T) -> isize
🔬This is a nightly-only experimental API. (`pointer_byte_offsets` [#96283](https://github.com/rust-lang/rust/issues/96283))
Calculates the distance between two pointers. The returned value is in units of **bytes**.
This is purely a convenience for casting to a `u8` pointer and using [offset\_from](primitive.pointer#method.offset_from "pointer::offset_from") on it. See that method for documentation and safety requirements.
For non-`Sized` pointees this operation considers only the data pointers, ignoring the metadata.
[source](https://doc.rust-lang.org/src/core/ptr/mut_ptr.rs.html#931-933)const: [unstable](https://github.com/rust-lang/rust/issues/95892 "Tracking issue for const_ptr_sub_ptr") · #### pub unsafe fn sub\_ptr(self, origin: \*const T) -> usize
🔬This is a nightly-only experimental API. (`ptr_sub_ptr` [#95892](https://github.com/rust-lang/rust/issues/95892))
Calculates the distance between two pointers, *where it’s known that `self` is equal to or greater than `origin`*. The returned value is in units of T: the distance in bytes is divided by `mem::size_of::<T>()`.
This computes the same value that [`offset_from`](#method.offset_from) would compute, but with the added precondition that that the offset is guaranteed to be non-negative. This method is equivalent to `usize::from(self.offset_from(origin)).unwrap_unchecked()`, but it provides slightly more information to the optimizer, which can sometimes allow it to optimize slightly better with some backends.
This method can be though of as recovering the `count` that was passed to [`add`](#method.add) (or, with the parameters in the other order, to [`sub`](#method.sub)). The following are all equivalent, assuming that their safety preconditions are met:
```
ptr.sub_ptr(origin) == count
origin.add(count) == ptr
ptr.sub(count) == origin
```
##### Safety
* The distance between the pointers must be non-negative (`self >= origin`)
* *All* the safety conditions of [`offset_from`](#method.offset_from) apply to this method as well; see it for the full details.
Importantly, despite the return type of this method being able to represent a larger offset, it’s still *not permitted* to pass pointers which differ by more than `isize::MAX` *bytes*. As such, the result of this method will always be less than or equal to `isize::MAX as usize`.
##### Panics
This function panics if `T` is a Zero-Sized Type (“ZST”).
##### Examples
```
#![feature(ptr_sub_ptr)]
let mut a = [0; 5];
let p: *mut i32 = a.as_mut_ptr();
unsafe {
let ptr1: *mut i32 = p.add(1);
let ptr2: *mut i32 = p.add(3);
assert_eq!(ptr2.sub_ptr(ptr1), 2);
assert_eq!(ptr1.add(2), ptr2);
assert_eq!(ptr2.sub(2), ptr1);
assert_eq!(ptr2.sub_ptr(ptr2), 0);
}
// This would be incorrect, as the pointers are not correctly ordered:
// ptr1.offset_from(ptr2)
```
[source](https://doc.rust-lang.org/src/core/ptr/mut_ptr.rs.html#995-997)1.26.0 (const: 1.61.0) · #### pub const unsafe fn add(self, count: usize) -> \*mut T
Calculates the offset from a pointer (convenience for `.offset(count as isize)`).
`count` is in units of T; e.g., a `count` of 3 represents a pointer offset of `3 * size_of::<T>()` bytes.
##### Safety
If any of the following conditions are violated, the result is Undefined Behavior:
* Both the starting and resulting pointer must be either in bounds or one byte past the end of the same [allocated object](ptr/index#allocated-object).
* The computed offset, **in bytes**, cannot overflow an `isize`.
* The offset being in bounds cannot rely on “wrapping around” the address space. That is, the infinite-precision sum must fit in a `usize`.
The compiler and standard library generally tries to ensure allocations never reach a size where an offset is a concern. For instance, `Vec` and `Box` ensure they never allocate more than `isize::MAX` bytes, so `vec.as_ptr().add(vec.len())` is always safe.
Most platforms fundamentally can’t even construct such an allocation. For instance, no known 64-bit platform can ever serve a request for 263 bytes due to page-table limitations or splitting the address space. However, some 32-bit and 16-bit platforms may successfully serve a request for more than `isize::MAX` bytes with things like Physical Address Extension. As such, memory acquired directly from allocators or memory mapped files *may* be too large to handle with this function.
Consider using [`wrapping_add`](#method.wrapping_add) instead if these constraints are difficult to satisfy. The only advantage of this method is that it enables more aggressive compiler optimizations.
##### Examples
Basic usage:
```
let s: &str = "123";
let ptr: *const u8 = s.as_ptr();
unsafe {
println!("{}", *ptr.add(1) as char);
println!("{}", *ptr.add(2) as char);
}
```
[source](https://doc.rust-lang.org/src/core/ptr/mut_ptr.rs.html#1018)const: [unstable](https://github.com/rust-lang/rust/issues/96283 "Tracking issue for const_pointer_byte_offsets") · #### pub unsafe fn byte\_add(self, count: usize) -> \*mut T
🔬This is a nightly-only experimental API. (`pointer_byte_offsets` [#96283](https://github.com/rust-lang/rust/issues/96283))
Calculates the offset from a pointer in bytes (convenience for `.byte_offset(count as isize)`).
`count` is in units of bytes.
This is purely a convenience for casting to a `u8` pointer and using [add](primitive.pointer#method.add "pointer::add") on it. See that method for documentation and safety requirements.
For non-`Sized` pointees this operation changes only the data pointer, leaving the metadata untouched.
[source](https://doc.rust-lang.org/src/core/ptr/mut_ptr.rs.html#1081-1083)1.26.0 (const: 1.61.0) · #### pub const unsafe fn sub(self, count: usize) -> \*mut T
Calculates the offset from a pointer (convenience for `.offset((count as isize).wrapping_neg())`).
`count` is in units of T; e.g., a `count` of 3 represents a pointer offset of `3 * size_of::<T>()` bytes.
##### Safety
If any of the following conditions are violated, the result is Undefined Behavior:
* Both the starting and resulting pointer must be either in bounds or one byte past the end of the same [allocated object](ptr/index#allocated-object).
* The computed offset cannot exceed `isize::MAX` **bytes**.
* The offset being in bounds cannot rely on “wrapping around” the address space. That is, the infinite-precision sum must fit in a usize.
The compiler and standard library generally tries to ensure allocations never reach a size where an offset is a concern. For instance, `Vec` and `Box` ensure they never allocate more than `isize::MAX` bytes, so `vec.as_ptr().add(vec.len()).sub(vec.len())` is always safe.
Most platforms fundamentally can’t even construct such an allocation. For instance, no known 64-bit platform can ever serve a request for 263 bytes due to page-table limitations or splitting the address space. However, some 32-bit and 16-bit platforms may successfully serve a request for more than `isize::MAX` bytes with things like Physical Address Extension. As such, memory acquired directly from allocators or memory mapped files *may* be too large to handle with this function.
Consider using [`wrapping_sub`](#method.wrapping_sub) instead if these constraints are difficult to satisfy. The only advantage of this method is that it enables more aggressive compiler optimizations.
##### Examples
Basic usage:
```
let s: &str = "123";
unsafe {
let end: *const u8 = s.as_ptr().add(3);
println!("{}", *end.sub(1) as char);
println!("{}", *end.sub(2) as char);
}
```
[source](https://doc.rust-lang.org/src/core/ptr/mut_ptr.rs.html#1105)const: [unstable](https://github.com/rust-lang/rust/issues/96283 "Tracking issue for const_pointer_byte_offsets") · #### pub unsafe fn byte\_sub(self, count: usize) -> \*mut T
🔬This is a nightly-only experimental API. (`pointer_byte_offsets` [#96283](https://github.com/rust-lang/rust/issues/96283))
Calculates the offset from a pointer in bytes (convenience for `.byte_offset((count as isize).wrapping_neg())`).
`count` is in units of bytes.
This is purely a convenience for casting to a `u8` pointer and using [sub](primitive.pointer#method.sub "pointer::sub") on it. See that method for documentation and safety requirements.
For non-`Sized` pointees this operation changes only the data pointer, leaving the metadata untouched.
[source](https://doc.rust-lang.org/src/core/ptr/mut_ptr.rs.html#1166-1168)1.26.0 (const: 1.61.0) · #### pub const fn wrapping\_add(self, count: usize) -> \*mut T
Calculates the offset from a pointer using wrapping arithmetic. (convenience for `.wrapping_offset(count as isize)`)
`count` is in units of T; e.g., a `count` of 3 represents a pointer offset of `3 * size_of::<T>()` bytes.
##### Safety
This operation itself is always safe, but using the resulting pointer is not.
The resulting pointer “remembers” the [allocated object](ptr/index#allocated-object) that `self` points to; it must not be used to read or write other allocated objects.
In other words, `let z = x.wrapping_add((y as usize) - (x as usize))` does *not* make `z` the same as `y` even if we assume `T` has size `1` and there is no overflow: `z` is still attached to the object `x` is attached to, and dereferencing it is Undefined Behavior unless `x` and `y` point into the same allocated object.
Compared to [`add`](#method.add), this method basically delays the requirement of staying within the same allocated object: [`add`](#method.add) is immediate Undefined Behavior when crossing object boundaries; `wrapping_add` produces a pointer but still leads to Undefined Behavior if a pointer is dereferenced when it is out-of-bounds of the object it is attached to. [`add`](#method.add) can be optimized better and is thus preferable in performance-sensitive code.
The delayed check only considers the value of the pointer that was dereferenced, not the intermediate values used during the computation of the final result. For example, `x.wrapping_add(o).wrapping_sub(o)` is always the same as `x`. In other words, leaving the allocated object and then re-entering it later is permitted.
##### Examples
Basic usage:
```
// Iterate using a raw pointer in increments of two elements
let data = [1u8, 2, 3, 4, 5];
let mut ptr: *const u8 = data.as_ptr();
let step = 2;
let end_rounded_up = ptr.wrapping_add(6);
// This loop prints "1, 3, 5, "
while ptr != end_rounded_up {
unsafe {
print!("{}, ", *ptr);
}
ptr = ptr.wrapping_add(step);
}
```
[source](https://doc.rust-lang.org/src/core/ptr/mut_ptr.rs.html#1187)const: [unstable](https://github.com/rust-lang/rust/issues/96283 "Tracking issue for const_pointer_byte_offsets") · #### pub fn wrapping\_byte\_add(self, count: usize) -> \*mut T
🔬This is a nightly-only experimental API. (`pointer_byte_offsets` [#96283](https://github.com/rust-lang/rust/issues/96283))
Calculates the offset from a pointer in bytes using wrapping arithmetic. (convenience for `.wrapping_byte_offset(count as isize)`)
`count` is in units of bytes.
This is purely a convenience for casting to a `u8` pointer and using [wrapping\_add](primitive.pointer#method.wrapping_add "pointer::wrapping_add") on it. See that method for documentation.
For non-`Sized` pointees this operation changes only the data pointer, leaving the metadata untouched.
[source](https://doc.rust-lang.org/src/core/ptr/mut_ptr.rs.html#1246-1248)1.26.0 (const: 1.61.0) · #### pub const fn wrapping\_sub(self, count: usize) -> \*mut T
Calculates the offset from a pointer using wrapping arithmetic. (convenience for `.wrapping_offset((count as isize).wrapping_neg())`)
`count` is in units of T; e.g., a `count` of 3 represents a pointer offset of `3 * size_of::<T>()` bytes.
##### Safety
This operation itself is always safe, but using the resulting pointer is not.
The resulting pointer “remembers” the [allocated object](ptr/index#allocated-object) that `self` points to; it must not be used to read or write other allocated objects.
In other words, `let z = x.wrapping_sub((x as usize) - (y as usize))` does *not* make `z` the same as `y` even if we assume `T` has size `1` and there is no overflow: `z` is still attached to the object `x` is attached to, and dereferencing it is Undefined Behavior unless `x` and `y` point into the same allocated object.
Compared to [`sub`](#method.sub), this method basically delays the requirement of staying within the same allocated object: [`sub`](#method.sub) is immediate Undefined Behavior when crossing object boundaries; `wrapping_sub` produces a pointer but still leads to Undefined Behavior if a pointer is dereferenced when it is out-of-bounds of the object it is attached to. [`sub`](#method.sub) can be optimized better and is thus preferable in performance-sensitive code.
The delayed check only considers the value of the pointer that was dereferenced, not the intermediate values used during the computation of the final result. For example, `x.wrapping_add(o).wrapping_sub(o)` is always the same as `x`. In other words, leaving the allocated object and then re-entering it later is permitted.
##### Examples
Basic usage:
```
// Iterate using a raw pointer in increments of two elements (backwards)
let data = [1u8, 2, 3, 4, 5];
let mut ptr: *const u8 = data.as_ptr();
let start_rounded_down = ptr.wrapping_sub(2);
ptr = ptr.wrapping_add(4);
let step = 2;
// This loop prints "5, 3, 1, "
while ptr != start_rounded_down {
unsafe {
print!("{}, ", *ptr);
}
ptr = ptr.wrapping_sub(step);
}
```
[source](https://doc.rust-lang.org/src/core/ptr/mut_ptr.rs.html#1267)const: [unstable](https://github.com/rust-lang/rust/issues/96283 "Tracking issue for const_pointer_byte_offsets") · #### pub fn wrapping\_byte\_sub(self, count: usize) -> \*mut T
🔬This is a nightly-only experimental API. (`pointer_byte_offsets` [#96283](https://github.com/rust-lang/rust/issues/96283))
Calculates the offset from a pointer in bytes using wrapping arithmetic. (convenience for `.wrapping_offset((count as isize).wrapping_neg())`)
`count` is in units of bytes.
This is purely a convenience for casting to a `u8` pointer and using [wrapping\_sub](primitive.pointer#method.wrapping_sub "pointer::wrapping_sub") on it. See that method for documentation.
For non-`Sized` pointees this operation changes only the data pointer, leaving the metadata untouched.
[source](https://doc.rust-lang.org/src/core/ptr/mut_ptr.rs.html#1281-1283)1.26.0 (const: [unstable](https://github.com/rust-lang/rust/issues/80377 "Tracking issue for const_ptr_read")) · #### pub unsafe fn read(self) -> T
Reads the value from `self` without moving it. This leaves the memory in `self` unchanged.
See [`ptr::read`](ptr/fn.read) for safety concerns and examples.
[source](https://doc.rust-lang.org/src/core/ptr/mut_ptr.rs.html#1302-1304)1.26.0 · #### pub unsafe fn read\_volatile(self) -> T
Performs a volatile read of the value from `self` without moving it. This leaves the memory in `self` 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.
See [`ptr::read_volatile`](ptr/fn.read_volatile) for safety concerns and examples.
[source](https://doc.rust-lang.org/src/core/ptr/mut_ptr.rs.html#1322-1324)1.26.0 (const: [unstable](https://github.com/rust-lang/rust/issues/80377 "Tracking issue for const_ptr_read")) · #### pub unsafe fn read\_unaligned(self) -> T
Reads the value from `self` without moving it. This leaves the memory in `self` unchanged.
Unlike `read`, the pointer may be unaligned.
See [`ptr::read_unaligned`](ptr/fn.read_unaligned) for safety concerns and examples.
[source](https://doc.rust-lang.org/src/core/ptr/mut_ptr.rs.html#1342-1344)1.26.0 (const: 1.63.0) · #### pub const unsafe fn copy\_to(self, dest: \*mut T, count: usize)
Copies `count * size_of<T>` bytes from `self` to `dest`. The source and destination may overlap.
NOTE: this has the *same* argument order as [`ptr::copy`](ptr/fn.copy).
See [`ptr::copy`](ptr/fn.copy) for safety concerns and examples.
[source](https://doc.rust-lang.org/src/core/ptr/mut_ptr.rs.html#1362-1364)1.26.0 (const: 1.63.0) · #### pub const unsafe fn copy\_to\_nonoverlapping(self, dest: \*mut T, count: usize)
Copies `count * size_of<T>` bytes from `self` to `dest`. The source and destination may *not* overlap.
NOTE: this has the *same* argument order as [`ptr::copy_nonoverlapping`](ptr/fn.copy_nonoverlapping).
See [`ptr::copy_nonoverlapping`](ptr/fn.copy_nonoverlapping) for safety concerns and examples.
[source](https://doc.rust-lang.org/src/core/ptr/mut_ptr.rs.html#1382-1384)1.26.0 (const: 1.63.0) · #### pub const unsafe fn copy\_from(self, src: \*const T, count: usize)
Copies `count * size_of<T>` bytes from `src` to `self`. The source and destination may overlap.
NOTE: this has the *opposite* argument order of [`ptr::copy`](ptr/fn.copy).
See [`ptr::copy`](ptr/fn.copy) for safety concerns and examples.
[source](https://doc.rust-lang.org/src/core/ptr/mut_ptr.rs.html#1402-1404)1.26.0 (const: 1.63.0) · #### pub const unsafe fn copy\_from\_nonoverlapping(self, src: \*const T, count: usize)
Copies `count * size_of<T>` bytes from `src` to `self`. The source and destination may *not* overlap.
NOTE: this has the *opposite* argument order of [`ptr::copy_nonoverlapping`](ptr/fn.copy_nonoverlapping).
See [`ptr::copy_nonoverlapping`](ptr/fn.copy_nonoverlapping) for safety concerns and examples.
[source](https://doc.rust-lang.org/src/core/ptr/mut_ptr.rs.html#1417)1.26.0 · #### pub unsafe fn drop\_in\_place(self)
Executes the destructor (if any) of the pointed-to value.
See [`ptr::drop_in_place`](ptr/fn.drop_in_place) for safety concerns and examples.
[source](https://doc.rust-lang.org/src/core/ptr/mut_ptr.rs.html#1432-1434)1.26.0 (const: [unstable](https://github.com/rust-lang/rust/issues/86302 "Tracking issue for const_ptr_write")) · #### pub unsafe fn write(self, val: T)
Overwrites a memory location with the given value without reading or dropping the old value.
See [`ptr::write`](ptr/fn.write) for safety concerns and examples.
[source](https://doc.rust-lang.org/src/core/ptr/mut_ptr.rs.html#1451-1453)1.26.0 (const: [unstable](https://github.com/rust-lang/rust/issues/86302 "Tracking issue for const_ptr_write")) · #### pub unsafe fn write\_bytes(self, val: u8, count: usize)
Invokes memset on the specified pointer, setting `count * size_of::<T>()` bytes of memory starting at `self` to `val`.
See [`ptr::write_bytes`](ptr/fn.write_bytes) for safety concerns and examples.
[source](https://doc.rust-lang.org/src/core/ptr/mut_ptr.rs.html#1472-1474)1.26.0 · #### pub unsafe fn write\_volatile(self, val: 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.
See [`ptr::write_volatile`](ptr/fn.write_volatile) for safety concerns and examples.
[source](https://doc.rust-lang.org/src/core/ptr/mut_ptr.rs.html#1492-1494)1.26.0 (const: [unstable](https://github.com/rust-lang/rust/issues/86302 "Tracking issue for const_ptr_write")) · #### pub unsafe fn write\_unaligned(self, val: T)
Overwrites a memory location with the given value without reading or dropping the old value.
Unlike `write`, the pointer may be unaligned.
See [`ptr::write_unaligned`](ptr/fn.write_unaligned) for safety concerns and examples.
[source](https://doc.rust-lang.org/src/core/ptr/mut_ptr.rs.html#1508-1510)1.26.0 · #### pub unsafe fn replace(self, src: T) -> T
Replaces the value at `self` with `src`, returning the old value, without dropping either.
See [`ptr::replace`](ptr/fn.replace) for safety concerns and examples.
[source](https://doc.rust-lang.org/src/core/ptr/mut_ptr.rs.html#1526-1528)1.26.0 (const: [unstable](https://github.com/rust-lang/rust/issues/83163 "Tracking issue for const_swap")) · #### pub unsafe fn swap(self, with: \*mut T)
Swaps the values at two mutable locations of the same type, without deinitializing either. They may overlap, unlike `mem::swap` which is otherwise equivalent.
See [`ptr::swap`](ptr/fn.swap) for safety concerns and examples.
[source](https://doc.rust-lang.org/src/core/ptr/mut_ptr.rs.html#1578-1580)1.36.0 (const: [unstable](https://github.com/rust-lang/rust/issues/90962 "Tracking issue for const_align_offset")) · #### pub fn align\_offset(self, align: usize) -> usize
Computes the offset that needs to be applied to the pointer in order to make it aligned to `align`.
If it is not possible to align the pointer, the implementation returns `usize::MAX`. It is permissible for the implementation to *always* return `usize::MAX`. Only your algorithm’s performance can depend on getting a usable offset here, not its correctness.
The offset is expressed in number of `T` elements, and not bytes. The value returned can be used with the `wrapping_add` method.
There are no guarantees whatsoever that offsetting the pointer will not overflow or go beyond the allocation that the pointer points into. It is up to the caller to ensure that the returned offset is correct in all terms other than alignment.
##### Panics
The function panics if `align` is not a power-of-two.
##### Examples
Accessing adjacent `u8` as `u16`
```
use std::mem::align_of;
let mut x = [5_u8, 6, 7, 8, 9];
let ptr = x.as_mut_ptr();
let offset = ptr.align_offset(align_of::<u16>());
if offset < x.len() - 1 {
let u16_ptr = ptr.add(offset).cast::<u16>();
*u16_ptr = 0;
assert!(x == [0, 0, 7, 8, 9] || x == [5, 0, 0, 8, 9]);
} else {
// while the pointer can be aligned via `offset`, it would point
// outside the allocation
}
```
[source](https://doc.rust-lang.org/src/core/ptr/mut_ptr.rs.html#1607-1609)#### pub fn is\_aligned(self) -> bool
🔬This is a nightly-only experimental API. (`pointer_is_aligned` [#96284](https://github.com/rust-lang/rust/issues/96284))
Returns whether the pointer is properly aligned for `T`.
[source](https://doc.rust-lang.org/src/core/ptr/mut_ptr.rs.html#1625)#### pub fn is\_aligned\_to(self, align: usize) -> bool
🔬This is a nightly-only experimental API. (`pointer_is_aligned` [#96284](https://github.com/rust-lang/rust/issues/96284))
Returns whether the pointer is aligned to `align`.
For non-`Sized` pointees this operation considers only the data pointer, ignoring the metadata.
##### Panics
The function panics if `align` is not a power-of-two (this includes 0).
Trait Implementations
---------------------
[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#217)const: [unstable](https://github.com/rust-lang/rust/issues/91805 "Tracking issue for const_clone") · #### fn clone(&self) -> \*const 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/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#226)const: [unstable](https://github.com/rust-lang/rust/issues/91805 "Tracking issue for const_clone") · #### fn clone(&self) -> \*mut 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#2529)### impl<T> Debug for \*const Twhere T: ?[Sized](marker/trait.sized "trait std::marker::Sized"),
[source](https://doc.rust-lang.org/src/core/fmt/mod.rs.html#2530)#### 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/fmt/mod.rs.html#2535)### impl<T> Debug for \*mut Twhere T: ?[Sized](marker/trait.sized "trait std::marker::Sized"),
[source](https://doc.rust-lang.org/src/core/fmt/mod.rs.html#2536)#### 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/sync/atomic.rs.html#1797)1.23.0 (const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert")) · ### impl<T> From<\*mut T> for AtomicPtr<T>
[source](https://doc.rust-lang.org/src/core/sync/atomic.rs.html#1800)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn from(p: \*mut T) -> AtomicPtr<T>
Converts a `*mut T` into an `AtomicPtr<T>`.
[source](https://doc.rust-lang.org/src/core/hash/mod.rs.html#960)### impl<T> Hash for \*const Twhere T: ?[Sized](marker/trait.sized "trait std::marker::Sized"),
[source](https://doc.rust-lang.org/src/core/hash/mod.rs.html#962)#### 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/hash/mod.rs.html#970)### impl<T> Hash for \*mut Twhere T: ?[Sized](marker/trait.sized "trait std::marker::Sized"),
[source](https://doc.rust-lang.org/src/core/hash/mod.rs.html#972)#### 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/const_ptr.rs.html#1503)### impl<T> Ord for \*const Twhere T: ?[Sized](marker/trait.sized "trait std::marker::Sized"),
[source](https://doc.rust-lang.org/src/core/ptr/const_ptr.rs.html#1505)#### fn cmp(&self, other: &\*const 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/mut_ptr.rs.html#1944)### impl<T> Ord for \*mut Twhere T: ?[Sized](marker/trait.sized "trait std::marker::Sized"),
[source](https://doc.rust-lang.org/src/core/ptr/mut_ptr.rs.html#1946)#### fn cmp(&self, other: &\*mut 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/const_ptr.rs.html#1491)### impl<T> PartialEq<\*const T> for \*const Twhere T: ?[Sized](marker/trait.sized "trait std::marker::Sized"),
[source](https://doc.rust-lang.org/src/core/ptr/const_ptr.rs.html#1493)#### fn eq(&self, other: &\*const 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/ptr/mut_ptr.rs.html#1933)### impl<T> PartialEq<\*mut T> for \*mut Twhere T: ?[Sized](marker/trait.sized "trait std::marker::Sized"),
[source](https://doc.rust-lang.org/src/core/ptr/mut_ptr.rs.html#1935)#### fn eq(&self, other: &\*mut 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/ptr/const_ptr.rs.html#1517)### impl<T> PartialOrd<\*const T> for \*const Twhere T: ?[Sized](marker/trait.sized "trait std::marker::Sized"),
[source](https://doc.rust-lang.org/src/core/ptr/const_ptr.rs.html#1519)#### fn partial\_cmp(&self, other: &\*const 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/ptr/const_ptr.rs.html#1524)#### fn lt(&self, other: &\*const 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/ptr/const_ptr.rs.html#1529)#### fn le(&self, other: &\*const 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/ptr/const_ptr.rs.html#1534)#### fn gt(&self, other: &\*const 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/ptr/const_ptr.rs.html#1539)#### fn ge(&self, other: &\*const 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/ptr/mut_ptr.rs.html#1958)### impl<T> PartialOrd<\*mut T> for \*mut Twhere T: ?[Sized](marker/trait.sized "trait std::marker::Sized"),
[source](https://doc.rust-lang.org/src/core/ptr/mut_ptr.rs.html#1960)#### fn partial\_cmp(&self, other: &\*mut 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/ptr/mut_ptr.rs.html#1965)#### fn lt(&self, other: &\*mut 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/ptr/mut_ptr.rs.html#1970)#### fn le(&self, other: &\*mut 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/ptr/mut_ptr.rs.html#1975)#### fn gt(&self, other: &\*mut 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/ptr/mut_ptr.rs.html#1980)#### fn ge(&self, other: &\*mut 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/fmt/mod.rs.html#2466)### impl<T> Pointer for \*const Twhere T: ?[Sized](marker/trait.sized "trait std::marker::Sized"),
[source](https://doc.rust-lang.org/src/core/fmt/mod.rs.html#2467)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error>
Formats the value using the given formatter.
[source](https://doc.rust-lang.org/src/core/fmt/mod.rs.html#2506)### impl<T> Pointer for \*mut Twhere T: ?[Sized](marker/trait.sized "trait std::marker::Sized"),
[source](https://doc.rust-lang.org/src/core/fmt/mod.rs.html#2507)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error>
Formats the value using the given formatter.
[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#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#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#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/marker.rs.html#841)### impl<T> Copy for \*const Twhere T: ?[Sized](marker/trait.sized "trait std::marker::Sized"),
[source](https://doc.rust-lang.org/src/core/marker.rs.html#844)### impl<T> Copy for \*mut Twhere T: ?[Sized](marker/trait.sized "trait std::marker::Sized"),
[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/core/ptr/const_ptr.rs.html#1499)### impl<T> Eq for \*const Twhere T: ?[Sized](marker/trait.sized "trait std::marker::Sized"),
[source](https://doc.rust-lang.org/src/core/ptr/mut_ptr.rs.html#1941)### impl<T> Eq for \*mut Twhere T: ?[Sized](marker/trait.sized "trait std::marker::Sized"),
[source](https://doc.rust-lang.org/src/core/marker.rs.html#43)### impl<T> !Send for \*const Twhere T: ?[Sized](marker/trait.sized "trait std::marker::Sized"),
[source](https://doc.rust-lang.org/src/core/marker.rs.html#45)### impl<T> !Send for \*mut Twhere T: ?[Sized](marker/trait.sized "trait std::marker::Sized"),
[source](https://doc.rust-lang.org/src/core/marker.rs.html#481)### impl<T> !Sync for \*const Twhere T: ?[Sized](marker/trait.sized "trait std::marker::Sized"),
[source](https://doc.rust-lang.org/src/core/marker.rs.html#483)### impl<T> !Sync for \*mut Twhere T: ?[Sized](marker/trait.sized "trait std::marker::Sized"),
[source](https://doc.rust-lang.org/src/core/marker.rs.html#789)1.38.0 · ### impl<T> Unpin for \*const Twhere T: ?[Sized](marker/trait.sized "trait std::marker::Sized"),
[source](https://doc.rust-lang.org/src/core/marker.rs.html#792)1.38.0 · ### impl<T> Unpin 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)1.9.0 · ### impl<T> UnwindSafe for \*const Twhere T: [RefUnwindSafe](panic/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)1.9.0 · ### impl<T> UnwindSafe for \*mut Twhere 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 \*const Twhere 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/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 Macro std::debug_assert Macro std::debug\_assert
========================
```
macro_rules! debug_assert {
($($arg:tt)*) => { ... };
}
```
Asserts that a boolean expression is `true` at runtime.
This will invoke the [`panic!`](https://doc.rust-lang.org/core/macro.panic.html "panic!") macro if the provided expression cannot be evaluated to `true` at runtime.
Like [`assert!`](macro.assert "assert!"), this macro also has a second version, where a custom panic message can be provided.
Uses
----
Unlike [`assert!`](macro.assert "assert!"), `debug_assert!` statements are only enabled in non optimized builds by default. An optimized build will not execute `debug_assert!` statements unless `-C debug-assertions` is passed to the compiler. This makes `debug_assert!` useful for checks that are too expensive to be present in a release build but may be helpful during development. The result of expanding `debug_assert!` is always type checked.
An unchecked assertion allows a program in an inconsistent state to keep running, which might have unexpected consequences but does not introduce unsafety as long as this only happens in safe code. The performance cost of assertions, however, is not measurable in general. Replacing [`assert!`](macro.assert "assert!") with `debug_assert!` is thus only encouraged after thorough profiling, and more importantly, only in safe code!
Examples
--------
```
// the panic message for these assertions is the stringified value of the
// expression given.
debug_assert!(true);
fn some_expensive_computation() -> bool { true } // a very simple function
debug_assert!(some_expensive_computation());
// assert with a custom message
let x = true;
debug_assert!(x, "x wasn't true!");
let a = 3; let b = 27;
debug_assert!(a + b == 30, "a = {}, b = {}", a, b);
```
rust Keyword mod Keyword mod
===========
Organize code into [modules](../reference/items/modules).
Use `mod` to create new [modules](../reference/items/modules) to encapsulate code, including other modules:
```
mod foo {
mod bar {
type MyType = (u8, u8);
fn baz() {}
}
}
```
Like [`struct`](keyword.struct)s and [`enum`](keyword.enum)s, a module and its content are private by default, inaccessible to code outside of the module.
To learn more about allowing access, see the documentation for the [`pub`](keyword.pub) keyword.
rust Macro std::option_env Macro std::option\_env
======================
```
macro_rules! option_env {
($name:expr $(,)?) => { ... };
}
```
Optionally inspects an environment variable at compile time.
If the named environment variable is present at compile time, this will expand into an expression of type `Option<&'static str>` whose value is `Some` of the value of the environment variable. If the environment variable is not present, then this will expand to `None`. See [`Option<T>`](option/enum.option "Option") for more information on this type. Use [`std::env::var`](env/fn.var) instead if you want to read the value at runtime.
A compile time error is never emitted when using this macro regardless of whether the environment variable is present or not.
Examples
--------
```
let key: Option<&'static str> = option_env!("SECRET_KEY");
println!("the secret key might be: {key:?}");
```
rust Macro std::compile_error Macro std::compile\_error
=========================
```
macro_rules! compile_error {
($msg:expr $(,)?) => { ... };
}
```
Causes compilation to fail with the given error message when encountered.
This macro should be used when a crate uses a conditional compilation strategy to provide better error messages for erroneous conditions. It’s the compiler-level form of [`panic!`](https://doc.rust-lang.org/core/macro.panic.html "panic!"), but emits an error during *compilation* rather than at *runtime*.
Examples
--------
Two such examples are macros and `#[cfg]` environments.
Emit a better compiler error if a macro is passed invalid values. Without the final branch, the compiler would still emit an error, but the error’s message would not mention the two valid values.
ⓘ
```
macro_rules! give_me_foo_or_bar {
(foo) => {};
(bar) => {};
($x:ident) => {
compile_error!("This macro only accepts `foo` or `bar`");
}
}
give_me_foo_or_bar!(neither);
// ^ will fail at compile time with message "This macro only accepts `foo` or `bar`"
```
Emit a compiler error if one of a number of features isn’t available.
ⓘ
```
#[cfg(not(any(feature = "foo", feature = "bar")))]
compile_error!("Either feature \"foo\" or \"bar\" must be enabled for this crate.");
```
rust Primitive Type slice Primitive Type slice
====================
A dynamically-sized view into a contiguous sequence, `[T]`. Contiguous here means that elements are laid out so that every element is the same distance from its neighbors.
*[See also the `std::slice` module](slice/index).*
Slices are a view into a block of memory represented as a pointer and a length.
```
// slicing a Vec
let vec = vec![1, 2, 3];
let int_slice = &vec[..];
// coercing an array to a slice
let str_slice: &[&str] = &["one", "two", "three"];
```
Slices are either mutable or shared. The shared slice type is `&[T]`, while the mutable slice type is `&mut [T]`, where `T` represents the element type. For example, you can mutate the block of memory that a mutable slice points to:
```
let mut x = [1, 2, 3];
let x = &mut x[..]; // Take a full slice of `x`.
x[1] = 7;
assert_eq!(x, &[1, 7, 3]);
```
As slices store the length of the sequence they refer to, they have twice the size of pointers to [`Sized`](marker/trait.sized) types. Also see the reference on [dynamically sized types](../reference/dynamically-sized-types).
```
let pointer_size = std::mem::size_of::<&u8>();
assert_eq!(2 * pointer_size, std::mem::size_of::<&[u8]>());
assert_eq!(2 * pointer_size, std::mem::size_of::<*const [u8]>());
assert_eq!(2 * pointer_size, std::mem::size_of::<Box<[u8]>>());
assert_eq!(2 * pointer_size, std::mem::size_of::<Rc<[u8]>>());
```
### Trait Implementations
Some traits are implemented for slices if the element type implements that trait. This includes [`Eq`](cmp/trait.eq "Eq"), [`Hash`](hash/trait.hash) and [`Ord`](cmp/trait.ord "Ord").
### Iteration
The slices implement `IntoIterator`. The iterator yields references to the slice elements.
```
let numbers: &[i32] = &[0, 1, 2];
for n in numbers {
println!("{n} is a number!");
}
```
The mutable slice yields mutable references to the elements:
```
let mut scores: &mut [i32] = &mut [7, 8, 9];
for score in scores {
*score += 1;
}
```
This iterator yields mutable references to the slice’s elements, so while the element type of the slice is `i32`, the element type of the iterator is `&mut i32`.
* [`.iter`](primitive.slice#method.iter) and [`.iter_mut`](primitive.slice#method.iter_mut) are the explicit methods to return the default iterators.
* Further methods that return iterators are [`.split`](primitive.slice#method.split), [`.splitn`](primitive.slice#method.splitn), [`.chunks`](primitive.slice#method.chunks), [`.windows`](primitive.slice#method.windows) and more.
Implementations
---------------
[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](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. (`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](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. (`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](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. (`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](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. (`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#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](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. (`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/core/slice/mod.rs.html#4038)### impl<T, const N: usize> [[T; N]]
[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#4149)### impl [f64]
[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#4120)### impl [f32]
[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#114)### impl<T> [T]
[source](https://doc.rust-lang.org/src/core/slice/mod.rs.html#129)const: 1.39.0 · #### pub const 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)const: 1.39.0 · #### pub const 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)const: 1.56.0 · #### pub const 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)const: [unstable](https://github.com/rust-lang/rust/issues/83570 "Tracking issue for const_slice_first_last") · #### 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 (const: 1.56.0) · #### pub const 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 (const: [unstable](https://github.com/rust-lang/rust/issues/83570 "Tracking issue for const_slice_first_last")) · #### 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 (const: 1.56.0) · #### pub const 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 (const: [unstable](https://github.com/rust-lang/rust/issues/83570 "Tracking issue for const_slice_first_last")) · #### 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)const: 1.56.0 · #### pub const 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)const: [unstable](https://github.com/rust-lang/rust/issues/83570 "Tracking issue for const_slice_first_last") · #### 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)const: unstable · #### 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)const: unstable · #### 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)const: unstable · #### 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)const: unstable · #### 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)const: 1.32.0 · #### pub const 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)const: 1.61.0 · #### pub const 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 (const: 1.61.0) · #### pub const 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 (const: 1.61.0) · #### pub const 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)const: [unstable](https://github.com/rust-lang/rust/issues/83163 "Tracking issue for const_swap") · #### 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)const: [unstable](https://github.com/rust-lang/rust/issues/83163 "Tracking issue for const_swap") · #### 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)const: [unstable](https://github.com/rust-lang/rust/issues/100784 "Tracking issue for const_reverse") · #### 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)const: [unstable](https://github.com/rust-lang/rust/issues/101158 "Tracking issue for const_slice_split_at_not_mut") · #### 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)const: [unstable](https://github.com/rust-lang/rust/issues/76014 "Tracking issue for slice_split_at_unchecked") · #### 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#10)### impl [u8]
[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 const 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 const 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 const 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#602)### impl [u8]
[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](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](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#173)### impl<T> [T]
[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](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](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#458)#### pub fn into\_vec<A>(self: Box<[T], A>) -> Vec<T, A>where A: [Allocator](alloc/trait.allocator "trait std::alloc::Allocator"),
Notable traits for [Vec](vec/struct.vec "struct std::vec::Vec")<[u8](primitive.u8), A>
```
impl<A: Allocator> Write for Vec<u8, A>
```
Converts `self` into a vector without clones or allocation.
The resulting vector can be converted back into a box via `Vec<T>`’s `into_boxed_slice` method.
##### Examples
```
let s: Box<[i32]> = Box::new([10, 40, 30]);
let x = s.into_vec();
// `s` cannot be used anymore because it has been converted into `x`.
assert_eq!(x, vec![10, 40, 30]);
```
[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](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/core/array/mod.rs.html#164)### impl<T, const N: usize> AsMut<[T]> for [T; N]
[source](https://doc.rust-lang.org/src/core/array/mod.rs.html#166)#### 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/convert/mod.rs.html#624)### impl<T> AsMut<[T]> for [T]
[source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#625)#### 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#610)### impl<T, const LANES: usize> AsMut<[T]> 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/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/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/core/array/mod.rs.html#156)### impl<T, const N: usize> AsRef<[T]> for [T; N]
[source](https://doc.rust-lang.org/src/core/array/mod.rs.html#158)#### 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/convert/mod.rs.html#617)### impl<T> AsRef<[T]> for [T]
[source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#618)#### 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#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/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/core/slice/iter.rs.html#155)1.13.0 · ### impl<T> AsRef<[T]> for Iter<'\_, T>
[source](https://doc.rust-lang.org/src/core/slice/iter.rs.html#156)#### 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/slice/iter.rs.html#353)1.53.0 · ### impl<T> AsRef<[T]> for IterMut<'\_, T>
[source](https://doc.rust-lang.org/src/core/slice/iter.rs.html#354)#### 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/vector.rs.html#599)### impl<T, const LANES: usize> AsRef<[T]> 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/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/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/string.rs.html#2921)1.55.0 · ### impl<'a> AsRef<[u8]> for Drain<'a>
[source](https://doc.rust-lang.org/src/alloc/string.rs.html#2922)#### fn as\_ref(&self) -> &[u8]
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/string.rs.html#2612)### impl AsRef<[u8]> for String
[source](https://doc.rust-lang.org/src/alloc/string.rs.html#2614)#### fn as\_ref(&self) -> &[u8]
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/str/mod.rs.html#2563)### impl AsRef<[u8]> for str
[source](https://doc.rust-lang.org/src/core/str/mod.rs.html#2565)#### fn as\_ref(&self) -> &[u8]
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/std/ascii.rs.html#196-200)### impl AsciiExt for [u8]
#### type Owned = Vec<u8, Global>
👎Deprecated since 1.26.0: use inherent methods instead
Container type for copied ASCII characters.
[source](https://doc.rust-lang.org/src/std/ascii.rs.html#199)#### fn is\_ascii(&self) -> bool
👎Deprecated since 1.26.0: use inherent methods instead
Checks if the value is within the ASCII range. [Read more](ascii/trait.asciiext#tymethod.is_ascii)
[source](https://doc.rust-lang.org/src/std/ascii.rs.html#199)#### fn to\_ascii\_uppercase(&self) -> Self::Owned
👎Deprecated since 1.26.0: use inherent methods instead
Makes a copy of the value in its ASCII upper case equivalent. [Read more](ascii/trait.asciiext#tymethod.to_ascii_uppercase)
[source](https://doc.rust-lang.org/src/std/ascii.rs.html#199)#### fn to\_ascii\_lowercase(&self) -> Self::Owned
👎Deprecated since 1.26.0: use inherent methods instead
Makes a copy of the value in its ASCII lower case equivalent. [Read more](ascii/trait.asciiext#tymethod.to_ascii_lowercase)
[source](https://doc.rust-lang.org/src/std/ascii.rs.html#199)#### fn eq\_ignore\_ascii\_case(&self, o: &Self) -> bool
👎Deprecated since 1.26.0: use inherent methods instead
Checks that two values are an ASCII case-insensitive match. [Read more](ascii/trait.asciiext#tymethod.eq_ignore_ascii_case)
[source](https://doc.rust-lang.org/src/std/ascii.rs.html#199)#### fn make\_ascii\_uppercase(&mut self)
👎Deprecated since 1.26.0: use inherent methods instead
Converts this type to its ASCII upper case equivalent in-place. [Read more](ascii/trait.asciiext#tymethod.make_ascii_uppercase)
[source](https://doc.rust-lang.org/src/std/ascii.rs.html#199)#### fn make\_ascii\_lowercase(&mut self)
👎Deprecated since 1.26.0: use inherent methods instead
Converts this type to its ASCII lower case equivalent in-place. [Read more](ascii/trait.asciiext#tymethod.make_ascii_lowercase)
[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]
[source](https://doc.rust-lang.org/src/core/array/mod.rs.html#174)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### 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#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/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]
[source](https://doc.rust-lang.org/src/core/array/mod.rs.html#182)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### 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/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/std/io/impls.rs.html#313-323)### impl BufRead for &[u8]
[source](https://doc.rust-lang.org/src/std/io/impls.rs.html#315-317)#### 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#320-322)#### 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/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#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](io/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](io/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](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](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/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/slice.rs.html#704)### impl<T, V> Concat<T> for [V]where T: [Clone](clone/trait.clone "trait std::clone::Clone"), V: [Borrow](borrow/trait.borrow "trait std::borrow::Borrow")<[[T]](primitive.slice)>,
#### type Output = Vec<T, Global>
🔬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/alloc/slice.rs.html#707)#### fn concat(slice: &[V]) -> 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>
```
🔬This is a nightly-only experimental API. (`slice_concat_trait` [#27747](https://github.com/rust-lang/rust/issues/27747))
Implementation of [`[T]::concat`](primitive.slice#method.concat)
[source](https://doc.rust-lang.org/src/alloc/str.rs.html#61)### impl<S> Concat<str> for [S]where S: [Borrow](borrow/trait.borrow "trait std::borrow::Borrow")<[str](primitive.str)>,
Note: `str` in `Concat<str>` is not meaningful here. This type parameter of the trait only exists to enable another impl.
#### type Output = String
🔬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/alloc/str.rs.html#64)#### fn concat(slice: &[S]) -> String
🔬This is a nightly-only experimental API. (`slice_concat_trait` [#27747](https://github.com/rust-lang/rust/issues/27747))
Implementation of [`[T]::concat`](primitive.slice#method.concat)
[source](https://doc.rust-lang.org/src/core/fmt/mod.rs.html#2590)### impl<T> Debug for [T]where T: [Debug](fmt/trait.debug "trait std::fmt::Debug"),
[source](https://doc.rust-lang.org/src/core/fmt/mod.rs.html#2591)#### 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/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#4213)const: [unstable](https://github.com/rust-lang/rust/issues/87864 "Tracking issue for const_default_impls") · #### fn default() -> &[T]
Notable traits for &[[u8](primitive.u8)]
```
impl Read for &[u8]
impl Write for &mut [u8]
```
Creates an empty slice.
[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/slice/mod.rs.html#4222)const: [unstable](https://github.com/rust-lang/rust/issues/87864 "Tracking issue for const_default_impls") · #### fn default() -> &mut [T]
Notable traits for &[[u8](primitive.u8)]
```
impl Read for &[u8]
impl Write for &mut [u8]
```
Creates a mutable empty slice.
[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](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/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`](borrow/enum.cow#variant.Borrowed) variant of [`Cow`](borrow/enum.cow "Cow") from a slice.
This conversion does not allocate or clone the data.
[source](https://doc.rust-lang.org/src/std/io/readbuf.rs.html#69-74)### impl<'data> From<&'data mut [MaybeUninit<u8>]> for BorrowedBuf<'data>
Create a new `BorrowedBuf` from an uninitialized buffer.
Use `set_init` if part of the buffer is known to be already initialized.
[source](https://doc.rust-lang.org/src/std/io/readbuf.rs.html#71-73)#### fn from(buf: &'data mut [MaybeUninit<u8>]) -> BorrowedBuf<'data>
Converts to this type from the input type.
[source](https://doc.rust-lang.org/src/std/io/readbuf.rs.html#52-64)### impl<'data> From<&'data mut [u8]> for BorrowedBuf<'data>
Create a new `BorrowedBuf` from a fully initialized slice.
[source](https://doc.rust-lang.org/src/std/io/readbuf.rs.html#54-63)#### fn from(slice: &'data mut [u8]) -> BorrowedBuf<'data>
Converts to this type from the input type.
[source](https://doc.rust-lang.org/src/alloc/sync.rs.html#2484)1.21.0 · ### impl<T> From<&[T]> for Arc<[T]>where T: [Clone](clone/trait.clone "trait std::clone::Clone"),
[source](https://doc.rust-lang.org/src/alloc/sync.rs.html#2496)#### fn from(v: &[T]) -> Arc<[T]>
Allocate a reference-counted slice and fill it by cloning `v`’s items.
##### Example
```
let original: &[i32] = &[1, 2, 3];
let shared: Arc<[i32]> = Arc::from(original);
assert_eq!(&[1, 2, 3], &shared[..]);
```
[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](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 `&[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/rc.rs.html#1880)1.21.0 · ### impl<T> From<&[T]> for Rc<[T]>where T: [Clone](clone/trait.clone "trait std::clone::Clone"),
[source](https://doc.rust-lang.org/src/alloc/rc.rs.html#1892)#### fn from(v: &[T]) -> Rc<[T]>
Allocate a reference-counted slice and fill it by cloning `v`’s items.
##### Example
```
let original: &[i32] = &[1, 2, 3];
let shared: Rc<[i32]> = Rc::from(original);
assert_eq!(&[1, 2, 3], &shared[..]);
```
[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](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](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/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](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 `[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/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](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 `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/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/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/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](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 value from an iterator. [Read more](iter/trait.fromiterator#tymethod.from_iter)
[source](https://doc.rust-lang.org/src/core/hash/mod.rs.html#935)### impl<T> Hash for [T]where T: [Hash](hash/trait.hash "trait std::hash::Hash"),
[source](https://doc.rust-lang.org/src/core/hash/mod.rs.html#937)#### 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/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
The returned type after indexing.
[source](https://doc.rust-lang.org/src/core/slice/index.rs.html#17)const: unstable · #### fn index(&self, index: I) -> &<I as SliceIndex<[T]>>::Output
Performs the indexing (`container[index]`) operation. [Read more](ops/trait.index#tymethod.index)
[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/core/slice/index.rs.html#29)const: unstable · #### fn index\_mut(&mut self, index: I) -> &mut <I as SliceIndex<[T]>>::Output
Performs the mutable indexing (`container[index]`) operation. [Read more](ops/trait.indexmut#tymethod.index_mut)
[source](https://doc.rust-lang.org/src/core/slice/iter.rs.html#19)### impl<'a, T> IntoIterator for &'a [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/slice/iter.rs.html#23)#### 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/core/slice/iter.rs.html#29)### impl<'a, T> IntoIterator for &'a mut [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/slice/iter.rs.html#33)#### 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/slice.rs.html#742)### impl<T, V> Join<&[T]> for [V]where T: [Clone](clone/trait.clone "trait std::clone::Clone"), V: [Borrow](borrow/trait.borrow "trait std::borrow::Borrow")<[[T]](primitive.slice)>,
#### type Output = Vec<T, Global>
🔬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/alloc/slice.rs.html#745)#### fn join(slice: &[V], sep: &[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>
```
🔬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#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/alloc/slice.rs.html#719)### impl<T, V> Join<&T> for [V]where T: [Clone](clone/trait.clone "trait std::clone::Clone"), V: [Borrow](borrow/trait.borrow "trait std::borrow::Borrow")<[[T]](primitive.slice)>,
#### type Output = Vec<T, Global>
🔬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/alloc/slice.rs.html#722)#### fn join(slice: &[V], sep: &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>
```
🔬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/alloc/str.rs.html#71)### impl<S> Join<&str> for [S]where S: [Borrow](borrow/trait.borrow "trait std::borrow::Borrow")<[str](primitive.str)>,
#### type Output = String
🔬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/alloc/str.rs.html#74)#### fn join(slice: &[S], sep: &str) -> String
🔬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/core/slice/cmp.rs.html#39)### impl<T> Ord for [T]where T: [Ord](cmp/trait.ord "trait std::cmp::Ord"),
Implements comparison of vectors [lexicographically](cmp/trait.ord#lexicographical-comparison).
[source](https://doc.rust-lang.org/src/core/slice/cmp.rs.html#40)#### fn cmp(&self, other: &[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/array/equality.rs.html#67)### impl<A, B, const N: usize> PartialEq<&[B]> for [A; N]where A: [PartialEq](cmp/trait.partialeq "trait std::cmp::PartialEq")<B>,
[source](https://doc.rust-lang.org/src/core/array/equality.rs.html#72)#### fn eq(&self, other: &&[B]) -> 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/array/equality.rs.html#76)#### fn ne(&self, other: &&[B]) -> 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#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/collections/vec_deque/mod.rs.html#2892)1.17.0 · ### impl<T, U, A> PartialEq<&[U]> 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#2892)#### 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/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/array/equality.rs.html#97)### impl<A, B, const N: usize> PartialEq<&mut [B]> for [A; N]where A: [PartialEq](cmp/trait.partialeq "trait std::cmp::PartialEq")<B>,
[source](https://doc.rust-lang.org/src/core/array/equality.rs.html#102)#### fn eq(&self, other: &&mut [B]) -> 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/array/equality.rs.html#106)#### fn ne(&self, other: &&mut [B]) -> 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/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/collections/vec_deque/mod.rs.html#2893)1.17.0 · ### impl<T, U, A> PartialEq<&mut [U]> 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#2893)#### 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/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/array/equality.rs.html#82)### impl<A, B, const N: usize> PartialEq<[A; N]> for &[B]where B: [PartialEq](cmp/trait.partialeq "trait std::cmp::PartialEq")<A>,
[source](https://doc.rust-lang.org/src/core/array/equality.rs.html#87)#### fn eq(&self, other: &[A; 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/core/array/equality.rs.html#91)#### fn ne(&self, other: &[A; 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/core/array/equality.rs.html#112)### impl<A, B, const N: usize> PartialEq<[A; N]> for &mut [B]where B: [PartialEq](cmp/trait.partialeq "trait std::cmp::PartialEq")<A>,
[source](https://doc.rust-lang.org/src/core/array/equality.rs.html#117)#### fn eq(&self, other: &[A; 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/core/array/equality.rs.html#121)#### fn ne(&self, other: &[A; 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/core/array/equality.rs.html#44)### impl<A, B, const N: usize> PartialEq<[A; N]> for [B]where B: [PartialEq](cmp/trait.partialeq "trait std::cmp::PartialEq")<A>,
[source](https://doc.rust-lang.org/src/core/array/equality.rs.html#49)#### fn eq(&self, other: &[A; 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/core/array/equality.rs.html#57)#### fn ne(&self, other: &[A; 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/core/array/equality.rs.html#21)### impl<A, B, const N: usize> PartialEq<[B]> for [A; N]where A: [PartialEq](cmp/trait.partialeq "trait std::cmp::PartialEq")<B>,
[source](https://doc.rust-lang.org/src/core/array/equality.rs.html#26)#### fn eq(&self, other: &[B]) -> 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/array/equality.rs.html#34)#### fn ne(&self, other: &[B]) -> 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/slice/cmp.rs.html#21)### impl<A, B> PartialEq<[B]> for [A]where A: [PartialEq](cmp/trait.partialeq "trait std::cmp::PartialEq")<B>,
[source](https://doc.rust-lang.org/src/core/slice/cmp.rs.html#25)#### fn eq(&self, other: &[B]) -> 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/slice/cmp.rs.html#29)#### fn ne(&self, other: &[B]) -> 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/core/slice/cmp.rs.html#47)### impl<T> PartialOrd<[T]> for [T]where T: [PartialOrd](cmp/trait.partialord "trait std::cmp::PartialOrd")<T>,
Implements comparison of vectors [lexicographically](cmp/trait.ord#lexicographical-comparison).
[source](https://doc.rust-lang.org/src/core/slice/cmp.rs.html#48)#### fn partial\_cmp(&self, other: &[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/str/pattern.rs.html#856)### impl<'a, 'b> Pattern<'a> for &'b [char]
Searches for chars that are equal to any of the [`char`](primitive.char "char")s in the slice.
#### Examples
```
assert_eq!("Hello world".find(&['l', 'l'] as &[_]), Some(2));
assert_eq!("Hello world".find(&['l', 'l'][..]), Some(2));
```
#### type Searcher = CharSliceSearcher<'a, 'b>
🔬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#857)#### fn into\_searcher(self, haystack: &'a str) -> CharSliceSearcher<'a, 'b>
🔬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#857)#### 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#857)#### 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#857)#### 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#857)#### fn is\_suffix\_of(self, haystack: &'a str) -> boolwhere [CharSliceSearcher](str/pattern/struct.charslicesearcher "struct std::str::pattern::CharSliceSearcher")<'a, 'b>: [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#857)#### fn strip\_suffix\_of(self, haystack: &'a str) -> Option<&'a str>where [CharSliceSearcher](str/pattern/struct.charslicesearcher "struct std::str::pattern::CharSliceSearcher")<'a, 'b>: [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/std/io/impls.rs.html#232-310)### impl Read for &[u8]
Read is implemented for `&[u8]` by copying from the slice.
Note that reading updates the slice to point to the yet unread part. The slice will be empty when EOF is reached.
[source](https://doc.rust-lang.org/src/std/io/impls.rs.html#234-249)#### 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#252-260)#### 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#263-273)#### 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#276-278)#### 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#281-301)#### 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/impls.rs.html#304-309)#### 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)#### 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#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/core/slice/index.rs.html#708)1.53.0 · ### impl<T> SliceIndex<[T]> for (Bound<usize>, Bound<usize>)
#### type Output = [T]
The output type returned by methods.
[source](https://doc.rust-lang.org/src/core/slice/index.rs.html#712)#### fn get( self, slice: &[T]) -> Option<&<(Bound<usize>, Bound<usize>) as SliceIndex<[T]>>::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/slice/index.rs.html#717)#### fn get\_mut( self, slice: &mut [T]) -> Option<&mut <(Bound<usize>, Bound<usize>) as SliceIndex<[T]>>::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/slice/index.rs.html#722)#### unsafe fn get\_unchecked( self, slice: \*const [T]) -> \*const <(Bound<usize>, Bound<usize>) as SliceIndex<[T]>>::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/slice/index.rs.html#728)#### unsafe fn get\_unchecked\_mut( self, slice: \*mut [T]) -> \*mut <(Bound<usize>, Bound<usize>) as SliceIndex<[T]>>::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/slice/index.rs.html#734)#### fn index( self, slice: &[T]) -> &<(Bound<usize>, Bound<usize>) as SliceIndex<[T]>>::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/slice/index.rs.html#739)#### fn index\_mut( self, slice: &mut [T]) -> &mut <(Bound<usize>, Bound<usize>) as SliceIndex<[T]>>::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/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/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/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/slice/index.rs.html#456)1.26.0 (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/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/slice/index.rs.html#500)1.26.0 (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/slice/index.rs.html#209)1.15.0 (const: unstable) · ### impl<T> SliceIndex<[T]> for usize
#### type Output = T
The output type returned by methods.
[source](https://doc.rust-lang.org/src/core/slice/index.rs.html#213)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#219)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#225)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#238)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#248)const: unstable · #### fn index(self, slice: &[T]) -> &T
🔬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#254)const: unstable · #### fn index\_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, panicking if out of bounds. [Read more](slice/trait.sliceindex#tymethod.index_mut)
[source](https://doc.rust-lang.org/src/core/slice/mod.rs.html#4240)1.51.0 · ### impl<T> SlicePattern for [T]
#### type Item = T
🔬This is a nightly-only experimental API. (`slice_pattern` [#56345](https://github.com/rust-lang/rust/issues/56345))
The element type of the slice being matched on.
[source](https://doc.rust-lang.org/src/core/slice/mod.rs.html#4244)#### fn as\_slice(&self) -> &[<[T] as SlicePattern>::Item]
🔬This is a nightly-only experimental API. (`slice_pattern` [#56345](https://github.com/rust-lang/rust/issues/56345))
Currently, the consumers of `SlicePattern` need a slice.
[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>
The resulting type after obtaining ownership.
[source](https://doc.rust-lang.org/src/alloc/slice.rs.html#787)#### fn to\_owned(&self) -> 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>
```
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/slice.rs.html#796)#### fn clone\_into(&self, target: &mut Vec<T, Global>)
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/net/socket_addr.rs.html#952-958)1.8.0 · ### impl<'a> ToSocketAddrs for &'a [SocketAddr]
#### type Iter = Cloned<Iter<'a, SocketAddr>>
Returned iterator over socket addresses which this type may correspond to. [Read more](net/trait.tosocketaddrs#associatedtype.Iter)
[source](https://doc.rust-lang.org/src/std/net/socket_addr.rs.html#955-957)#### fn to\_socket\_addrs(&self) -> Result<Self::Iter>
Converts this object to an iterator of resolved [`SocketAddr`](net/enum.socketaddr "SocketAddr")s. [Read more](net/trait.tosocketaddrs#tymethod.to_socket_addrs)
[source](https://doc.rust-lang.org/src/core/array/mod.rs.html#212)1.34.0 · ### impl<'a, T, const N: usize> TryFrom<&'a [T]> for &'a [T; N]
#### type Error = TryFromSliceError
The type returned in the event of a conversion error.
[source](https://doc.rust-lang.org/src/core/array/mod.rs.html#215)#### fn try\_from(slice: &[T]) -> Result<&[T; N], TryFromSliceError>
Performs the conversion.
[source](https://doc.rust-lang.org/src/core/array/mod.rs.html#227)1.34.0 · ### impl<'a, T, const N: usize> TryFrom<&'a mut [T]> for &'a mut [T; N]
#### type Error = TryFromSliceError
The type returned in the event of a conversion error.
[source](https://doc.rust-lang.org/src/core/array/mod.rs.html#230)#### fn try\_from(slice: &mut [T]) -> Result<&mut [T; N], TryFromSliceError>
Performs the conversion.
[source](https://doc.rust-lang.org/src/core/array/mod.rs.html#188)1.34.0 · ### impl<T, const N: usize> TryFrom<&[T]> for [T; N]where T: [Copy](marker/trait.copy "trait std::marker::Copy"),
#### type Error = TryFromSliceError
The type returned in the event of a conversion error.
[source](https://doc.rust-lang.org/src/core/array/mod.rs.html#194)#### fn try\_from(slice: &[T]) -> Result<[T; N], TryFromSliceError>
Performs the conversion.
[source](https://doc.rust-lang.org/src/core/array/mod.rs.html#200)1.59.0 · ### impl<T, const N: usize> TryFrom<&mut [T]> for [T; N]where T: [Copy](marker/trait.copy "trait std::marker::Copy"),
#### type Error = TryFromSliceError
The type returned in the event of a conversion error.
[source](https://doc.rust-lang.org/src/core/array/mod.rs.html#206)#### fn try\_from(slice: &mut [T]) -> Result<[T; N], TryFromSliceError>
Performs the conversion.
[source](https://doc.rust-lang.org/src/std/io/impls.rs.html#335-376)### impl Write for &mut [u8]
Write is implemented for `&mut [u8]` by copying into the slice, overwriting its data.
Note that writing updates the slice to point to the yet unwritten part. The slice will be empty when it has been completely overwritten.
If the number of bytes to be written exceeds the size of the slice, write operations will return short writes: ultimately, `Ok(0)`; in this situation, `write_all` returns an error of kind `ErrorKind::WriteZero`.
[source](https://doc.rust-lang.org/src/std/io/impls.rs.html#337-343)#### fn write(&mut self, data: &[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#346-356)#### 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#359-361)#### 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#364-370)#### fn write\_all(&mut self, data: &[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#373-375)#### 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/core/slice/cmp.rs.html#35)### impl<T> Eq for [T]where T: [Eq](cmp/trait.eq "trait std::cmp::Eq"),
Auto Trait Implementations
--------------------------
### impl<T> RefUnwindSafe for [T]where T: [RefUnwindSafe](panic/trait.refunwindsafe "trait std::panic::RefUnwindSafe"),
### impl<T> Send for [T]where T: [Send](marker/trait.send "trait std::marker::Send"),
### impl<T> !Sized for [T]
### impl<T> Sync for [T]where T: [Sync](marker/trait.sync "trait std::marker::Sync"),
### impl<T> Unpin for [T]where T: [Unpin](marker/trait.unpin "trait std::marker::Unpin"),
### impl<T> UnwindSafe for [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)
| programming_docs |
rust Primitive Type f32 Primitive Type f32
==================
A 32-bit floating point type (specifically, the “binary32” type defined in IEEE 754-2008).
This type can represent a wide range of decimal numbers, like `3.5`, `27`, `-113.75`, `0.0078125`, `34359738368`, `0`, `-1`. So unlike integer types (such as `i32`), floating point types can represent non-integer numbers, too.
However, being able to represent this wide range of numbers comes at the cost of precision: floats can only represent some of the real numbers and calculation with floats round to a nearby representable number. For example, `5.0` and `1.0` can be exactly represented as `f32`, but `1.0 / 5.0` results in `0.20000000298023223876953125` since `0.2` cannot be exactly represented as `f32`. Note, however, that printing floats with `println` and friends will often discard insignificant digits: `println!("{}", 1.0f32 / 5.0f32)` will print `0.2`.
Additionally, `f32` can represent some special values:
* −0.0: IEEE 754 floating point numbers have a bit that indicates their sign, so −0.0 is a possible value. For comparison −0.0 = +0.0, but floating point operations can carry the sign bit through arithmetic operations. This means −0.0 × +0.0 produces −0.0 and a negative number rounded to a value smaller than a float can represent also produces −0.0.
* [∞](#associatedconstant.INFINITY) and [−∞](#associatedconstant.NEG_INFINITY): these result from calculations like `1.0 / 0.0`.
* [NaN (not a number)](#associatedconstant.NAN): this value results from calculations like `(-1.0).sqrt()`. NaN has some potentially unexpected behavior:
+ It is unequal to any float, including itself! This is the reason `f32` doesn’t implement the `Eq` trait.
+ It is also neither smaller nor greater than any float, making it impossible to sort by the default comparison operation, which is the reason `f32` doesn’t implement the `Ord` trait.
+ It is also considered *infectious* as almost all calculations where one of the operands is NaN will also result in NaN. The explanations on this page only explicitly document behavior on NaN operands if this default is deviated from.
+ Lastly, there are multiple bit patterns that are considered NaN. Rust does not currently guarantee that the bit patterns of NaN are preserved over arithmetic operations, and they are not guaranteed to be portable or even fully deterministic! This means that there may be some surprising results upon inspecting the bit patterns, as the same calculations might produce NaNs with different bit patterns.
When the number resulting from a primitive operation (addition, subtraction, multiplication, or division) on this type is not exactly representable as `f32`, it is rounded according to the roundTiesToEven direction defined in IEEE 754-2008. That means:
* The result is the representable value closest to the true value, if there is a unique closest representable value.
* If the true value is exactly half-way between two representable values, the result is the one with an even least-significant binary digit.
* If the true value’s magnitude is ≥ `f32::MAX` + 2(`f32::MAX_EXP` − `f32::MANTISSA_DIGITS` − 1), the result is ∞ or −∞ (preserving the true value’s sign).
For more information on floating point numbers, see [Wikipedia](https://en.wikipedia.org/wiki/Single-precision_floating-point_format).
*[See also the `std::f32::consts` module](f32/consts/index).*
Implementations
---------------
[source](https://doc.rust-lang.org/src/std/f32.rs.html#31-923)### impl f32
[source](https://doc.rust-lang.org/src/std/f32.rs.html#49-51)#### pub fn floor(self) -> f32
Returns the largest integer less than or equal to `self`.
##### Examples
```
let f = 3.7_f32;
let g = 3.0_f32;
let h = -3.7_f32;
assert_eq!(f.floor(), 3.0);
assert_eq!(g.floor(), 3.0);
assert_eq!(h.floor(), -4.0);
```
[source](https://doc.rust-lang.org/src/std/f32.rs.html#68-70)#### pub fn ceil(self) -> f32
Returns the smallest integer greater than or equal to `self`.
##### Examples
```
let f = 3.01_f32;
let g = 4.0_f32;
assert_eq!(f.ceil(), 4.0);
assert_eq!(g.ceil(), 4.0);
```
[source](https://doc.rust-lang.org/src/std/f32.rs.html#88-90)#### pub fn round(self) -> f32
Returns the nearest integer to `self`. Round half-way cases away from `0.0`.
##### Examples
```
let f = 3.3_f32;
let g = -3.3_f32;
assert_eq!(f.round(), 3.0);
assert_eq!(g.round(), -3.0);
```
[source](https://doc.rust-lang.org/src/std/f32.rs.html#110-112)#### pub fn trunc(self) -> f32
Returns the integer part of `self`. This means that non-integer numbers are always truncated towards zero.
##### Examples
```
let f = 3.7_f32;
let g = 3.0_f32;
let h = -3.7_f32;
assert_eq!(f.trunc(), 3.0);
assert_eq!(g.trunc(), 3.0);
assert_eq!(h.trunc(), -3.0);
```
[source](https://doc.rust-lang.org/src/std/f32.rs.html#131-133)#### pub fn fract(self) -> f32
Returns the fractional part of `self`.
##### Examples
```
let x = 3.6_f32;
let y = -3.6_f32;
let abs_difference_x = (x.fract() - 0.6).abs();
let abs_difference_y = (y.fract() - (-0.6)).abs();
assert!(abs_difference_x <= f32::EPSILON);
assert!(abs_difference_y <= f32::EPSILON);
```
[source](https://doc.rust-lang.org/src/std/f32.rs.html#155-157)#### pub fn abs(self) -> f32
Computes the absolute value of `self`.
##### Examples
```
let x = 3.5_f32;
let y = -3.5_f32;
let abs_difference_x = (x.abs() - x).abs();
let abs_difference_y = (y.abs() - (-y)).abs();
assert!(abs_difference_x <= f32::EPSILON);
assert!(abs_difference_y <= f32::EPSILON);
assert!(f32::NAN.abs().is_nan());
```
[source](https://doc.rust-lang.org/src/std/f32.rs.html#179-181)#### pub fn signum(self) -> f32
Returns a number that represents the sign of `self`.
* `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
##### Examples
```
let f = 3.5_f32;
assert_eq!(f.signum(), 1.0);
assert_eq!(f32::NEG_INFINITY.signum(), -1.0);
assert!(f32::NAN.signum().is_nan());
```
[source](https://doc.rust-lang.org/src/std/f32.rs.html#208-210)1.35.0 · #### pub fn copysign(self, sign: f32) -> f32
Returns a number composed of the magnitude of `self` and the sign of `sign`.
Equal to `self` if the sign of `self` and `sign` are the same, otherwise equal to `-self`. If `self` is a NaN, then a NaN with the sign bit of `sign` is returned. Note, however, that conserving the sign bit on NaN across arithmetical operations is not generally guaranteed. See [explanation of NaN as a special value](primitive.f32) for more info.
##### Examples
```
let f = 3.5_f32;
assert_eq!(f.copysign(0.42), 3.5_f32);
assert_eq!(f.copysign(-0.42), -3.5_f32);
assert_eq!((-f).copysign(0.42), 3.5_f32);
assert_eq!((-f).copysign(-0.42), -3.5_f32);
assert!(f32::NAN.copysign(1.0).is_nan());
```
[source](https://doc.rust-lang.org/src/std/f32.rs.html#236-238)#### pub fn mul\_add(self, a: f32, b: f32) -> f32
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 dependant on designing algorithms with specific target hardware in mind.
##### Examples
```
let m = 10.0_f32;
let x = 4.0_f32;
let b = 60.0_f32;
// 100.0
let abs_difference = (m.mul_add(x, b) - ((m * x) + b)).abs();
assert!(abs_difference <= f32::EPSILON);
```
[source](https://doc.rust-lang.org/src/std/f32.rs.html#261-267)1.38.0 · #### pub fn div\_euclid(self, rhs: f32) -> f32
Calculates Euclidean division, the matching method for `rem_euclid`.
This computes the integer `n` such that `self = n * rhs + self.rem_euclid(rhs)`. In other words, the result is `self / rhs` rounded to the integer `n` such that `self >= n * rhs`.
##### Examples
```
let a: f32 = 7.0;
let b = 4.0;
assert_eq!(a.div_euclid(b), 1.0); // 7.0 > 4.0 * 1.0
assert_eq!((-a).div_euclid(b), -2.0); // -7.0 >= 4.0 * -2.0
assert_eq!(a.div_euclid(-b), -1.0); // 7.0 >= -4.0 * -1.0
assert_eq!((-a).div_euclid(-b), 2.0); // -7.0 >= -4.0 * 2.0
```
[source](https://doc.rust-lang.org/src/std/f32.rs.html#296-299)1.38.0 · #### pub fn rem\_euclid(self, rhs: f32) -> f32
Calculates the least nonnegative remainder of `self (mod rhs)`.
In particular, the return value `r` satisfies `0.0 <= r < rhs.abs()` in most cases. However, due to a floating point round-off error it can result in `r == rhs.abs()`, violating the mathematical definition, if `self` is much smaller than `rhs.abs()` in magnitude and `self < 0.0`. This result is not an element of the function’s codomain, but it is the closest floating point number in the real numbers and thus fulfills the property `self == self.div_euclid(rhs) * rhs + self.rem_euclid(rhs)` approximatively.
##### Examples
```
let a: f32 = 7.0;
let b = 4.0;
assert_eq!(a.rem_euclid(b), 3.0);
assert_eq!((-a).rem_euclid(b), 1.0);
assert_eq!(a.rem_euclid(-b), 3.0);
assert_eq!((-a).rem_euclid(-b), 1.0);
// limitation due to round-off error
assert!((-f32::EPSILON).rem_euclid(3.0) != 0.0);
```
[source](https://doc.rust-lang.org/src/std/f32.rs.html#319-321)#### pub fn powi(self, n: i32) -> f32
Raises a number to an integer power.
Using this function is generally faster than using `powf`. It might have a different sequence of rounding operations than `powf`, so the results are not guaranteed to agree.
##### Examples
```
let x = 2.0_f32;
let abs_difference = (x.powi(2) - (x * x)).abs();
assert!(abs_difference <= f32::EPSILON);
```
[source](https://doc.rust-lang.org/src/std/f32.rs.html#337-339)#### pub fn powf(self, n: f32) -> f32
Raises a number to a floating point power.
##### Examples
```
let x = 2.0_f32;
let abs_difference = (x.powf(2.0) - (x * x)).abs();
assert!(abs_difference <= f32::EPSILON);
```
[source](https://doc.rust-lang.org/src/std/f32.rs.html#362-364)#### pub fn sqrt(self) -> f32
Returns the square root of a number.
Returns NaN if `self` is a negative number other than `-0.0`.
##### Examples
```
let positive = 4.0_f32;
let negative = -4.0_f32;
let negative_zero = -0.0_f32;
let abs_difference = (positive.sqrt() - 2.0).abs();
assert!(abs_difference <= f32::EPSILON);
assert!(negative.sqrt().is_nan());
assert!(negative_zero.sqrt() == negative_zero);
```
[source](https://doc.rust-lang.org/src/std/f32.rs.html#384-386)#### pub fn exp(self) -> f32
Returns `e^(self)`, (the exponential function).
##### Examples
```
let one = 1.0f32;
// e^1
let e = one.exp();
// ln(e) - 1 == 0
let abs_difference = (e.ln() - 1.0).abs();
assert!(abs_difference <= f32::EPSILON);
```
[source](https://doc.rust-lang.org/src/std/f32.rs.html#404-406)#### pub fn exp2(self) -> f32
Returns `2^(self)`.
##### Examples
```
let f = 2.0f32;
// 2^2 - 4 == 0
let abs_difference = (f.exp2() - 4.0).abs();
assert!(abs_difference <= f32::EPSILON);
```
[source](https://doc.rust-lang.org/src/std/f32.rs.html#426-428)#### pub fn ln(self) -> f32
Returns the natural logarithm of the number.
##### Examples
```
let one = 1.0f32;
// e^1
let e = one.exp();
// ln(e) - 1 == 0
let abs_difference = (e.ln() - 1.0).abs();
assert!(abs_difference <= f32::EPSILON);
```
[source](https://doc.rust-lang.org/src/std/f32.rs.html#450-452)#### pub fn log(self, base: f32) -> f32
Returns the logarithm of the number with respect to an arbitrary base.
The result might not be correctly rounded owing to implementation details; `self.log2()` can produce more accurate results for base 2, and `self.log10()` can produce more accurate results for base 10.
##### Examples
```
let five = 5.0f32;
// log5(5) - 1 == 0
let abs_difference = (five.log(5.0) - 1.0).abs();
assert!(abs_difference <= f32::EPSILON);
```
[source](https://doc.rust-lang.org/src/std/f32.rs.html#470-475)#### pub fn log2(self) -> f32
Returns the base 2 logarithm of the number.
##### Examples
```
let two = 2.0f32;
// log2(2) - 1 == 0
let abs_difference = (two.log2() - 1.0).abs();
assert!(abs_difference <= f32::EPSILON);
```
[source](https://doc.rust-lang.org/src/std/f32.rs.html#493-495)#### pub fn log10(self) -> f32
Returns the base 10 logarithm of the number.
##### Examples
```
let ten = 10.0f32;
// log10(10) - 1 == 0
let abs_difference = (ten.log10() - 1.0).abs();
assert!(abs_difference <= f32::EPSILON);
```
[source](https://doc.rust-lang.org/src/std/f32.rs.html#528-530)#### pub fn abs\_sub(self, other: f32) -> f32
👎Deprecated since 1.10.0: you probably meant `(self - other).abs()`: this operation is `(self - other).max(0.0)` except that `abs_sub` also propagates NaNs (also known as `fdimf` in C). If you truly need the positive difference, consider using that expression or the C function `fdimf`, depending on how you wish to handle NaN (please consider filing an issue describing your use-case too).
The positive difference of two numbers.
* If `self <= other`: `0:0`
* Else: `self - other`
##### Examples
```
let x = 3.0f32;
let y = -3.0f32;
let abs_difference_x = (x.abs_sub(1.0) - 2.0).abs();
let abs_difference_y = (y.abs_sub(1.0) - 0.0).abs();
assert!(abs_difference_x <= f32::EPSILON);
assert!(abs_difference_y <= f32::EPSILON);
```
[source](https://doc.rust-lang.org/src/std/f32.rs.html#548-550)#### pub fn cbrt(self) -> f32
Returns the cube root of a number.
##### Examples
```
let x = 8.0f32;
// x^(1/3) - 2 == 0
let abs_difference = (x.cbrt() - 2.0).abs();
assert!(abs_difference <= f32::EPSILON);
```
[source](https://doc.rust-lang.org/src/std/f32.rs.html#570-572)#### pub fn hypot(self, other: f32) -> f32
Calculates the length of the hypotenuse of a right-angle triangle given legs of length `x` and `y`.
##### Examples
```
let x = 2.0f32;
let y = 3.0f32;
// sqrt(x^2 + y^2)
let abs_difference = (x.hypot(y) - (x.powi(2) + y.powi(2)).sqrt()).abs();
assert!(abs_difference <= f32::EPSILON);
```
[source](https://doc.rust-lang.org/src/std/f32.rs.html#589-591)#### pub fn sin(self) -> f32
Computes the sine of a number (in radians).
##### Examples
```
let x = std::f32::consts::FRAC_PI_2;
let abs_difference = (x.sin() - 1.0).abs();
assert!(abs_difference <= f32::EPSILON);
```
[source](https://doc.rust-lang.org/src/std/f32.rs.html#608-610)#### pub fn cos(self) -> f32
Computes the cosine of a number (in radians).
##### Examples
```
let x = 2.0 * std::f32::consts::PI;
let abs_difference = (x.cos() - 1.0).abs();
assert!(abs_difference <= f32::EPSILON);
```
[source](https://doc.rust-lang.org/src/std/f32.rs.html#626-628)#### pub fn tan(self) -> f32
Computes the tangent of a number (in radians).
##### Examples
```
let x = std::f32::consts::FRAC_PI_4;
let abs_difference = (x.tan() - 1.0).abs();
assert!(abs_difference <= f32::EPSILON);
```
[source](https://doc.rust-lang.org/src/std/f32.rs.html#648-650)#### pub fn asin(self) -> f32
Computes the arcsine of a number. Return value is in radians in the range [-pi/2, pi/2] or NaN if the number is outside the range [-1, 1].
##### Examples
```
let f = std::f32::consts::FRAC_PI_2;
// asin(sin(pi/2))
let abs_difference = (f.sin().asin() - std::f32::consts::FRAC_PI_2).abs();
assert!(abs_difference <= f32::EPSILON);
```
[source](https://doc.rust-lang.org/src/std/f32.rs.html#670-672)#### pub fn acos(self) -> f32
Computes the arccosine of a number. Return value is in radians in the range [0, pi] or NaN if the number is outside the range [-1, 1].
##### Examples
```
let f = std::f32::consts::FRAC_PI_4;
// acos(cos(pi/4))
let abs_difference = (f.cos().acos() - std::f32::consts::FRAC_PI_4).abs();
assert!(abs_difference <= f32::EPSILON);
```
[source](https://doc.rust-lang.org/src/std/f32.rs.html#691-693)#### pub fn atan(self) -> f32
Computes the arctangent of a number. Return value is in radians in the range [-pi/2, pi/2];
##### Examples
```
let f = 1.0f32;
// atan(tan(1))
let abs_difference = (f.tan().atan() - 1.0).abs();
assert!(abs_difference <= f32::EPSILON);
```
[source](https://doc.rust-lang.org/src/std/f32.rs.html#725-727)#### pub fn atan2(self, other: f32) -> f32
Computes the four quadrant arctangent of `self` (`y`) and `other` (`x`) in radians.
* `x = 0`, `y = 0`: `0`
* `x >= 0`: `arctan(y/x)` -> `[-pi/2, pi/2]`
* `y >= 0`: `arctan(y/x) + pi` -> `(pi/2, pi]`
* `y < 0`: `arctan(y/x) - pi` -> `(-pi, -pi/2)`
##### Examples
```
// Positive angles measured counter-clockwise
// from positive x axis
// -pi/4 radians (45 deg clockwise)
let x1 = 3.0f32;
let y1 = -3.0f32;
// 3pi/4 radians (135 deg counter-clockwise)
let x2 = -3.0f32;
let y2 = 3.0f32;
let abs_difference_1 = (y1.atan2(x1) - (-std::f32::consts::FRAC_PI_4)).abs();
let abs_difference_2 = (y2.atan2(x2) - (3.0 * std::f32::consts::FRAC_PI_4)).abs();
assert!(abs_difference_1 <= f32::EPSILON);
assert!(abs_difference_2 <= f32::EPSILON);
```
[source](https://doc.rust-lang.org/src/std/f32.rs.html#747-749)#### pub fn sin\_cos(self) -> (f32, f32)
Simultaneously computes the sine and cosine of the number, `x`. Returns `(sin(x), cos(x))`.
##### Examples
```
let x = std::f32::consts::FRAC_PI_4;
let f = x.sin_cos();
let abs_difference_0 = (f.0 - x.sin()).abs();
let abs_difference_1 = (f.1 - x.cos()).abs();
assert!(abs_difference_0 <= f32::EPSILON);
assert!(abs_difference_1 <= f32::EPSILON);
```
[source](https://doc.rust-lang.org/src/std/f32.rs.html#769-771)#### pub fn exp\_m1(self) -> f32
Returns `e^(self) - 1` in a way that is accurate even if the number is close to zero.
##### Examples
```
let x = 1e-8_f32;
// for very small x, e^x is approximately 1 + x + x^2 / 2
let approx = x + x * x / 2.0;
let abs_difference = (x.exp_m1() - approx).abs();
assert!(abs_difference < 1e-10);
```
[source](https://doc.rust-lang.org/src/std/f32.rs.html#791-793)#### pub fn ln\_1p(self) -> f32
Returns `ln(1+n)` (natural logarithm) more accurately than if the operations were performed separately.
##### Examples
```
let x = 1e-8_f32;
// for very small x, ln(1 + x) is approximately x - x^2 / 2
let approx = x - x * x / 2.0;
let abs_difference = (x.ln_1p() - approx).abs();
assert!(abs_difference < 1e-10);
```
[source](https://doc.rust-lang.org/src/std/f32.rs.html#814-816)#### pub fn sinh(self) -> f32
Hyperbolic sine function.
##### Examples
```
let e = std::f32::consts::E;
let x = 1.0f32;
let f = x.sinh();
// Solving sinh() at 1 gives `(e^2-1)/(2e)`
let g = ((e * e) - 1.0) / (2.0 * e);
let abs_difference = (f - g).abs();
assert!(abs_difference <= f32::EPSILON);
```
[source](https://doc.rust-lang.org/src/std/f32.rs.html#837-839)#### pub fn cosh(self) -> f32
Hyperbolic cosine function.
##### Examples
```
let e = std::f32::consts::E;
let x = 1.0f32;
let f = x.cosh();
// Solving cosh() at 1 gives this result
let g = ((e * e) + 1.0) / (2.0 * e);
let abs_difference = (f - g).abs();
// Same result
assert!(abs_difference <= f32::EPSILON);
```
[source](https://doc.rust-lang.org/src/std/f32.rs.html#860-862)#### pub fn tanh(self) -> f32
Hyperbolic tangent function.
##### Examples
```
let e = std::f32::consts::E;
let x = 1.0f32;
let f = x.tanh();
// Solving tanh() at 1 gives `(1 - e^(-2))/(1 + e^(-2))`
let g = (1.0 - e.powi(-2)) / (1.0 + e.powi(-2));
let abs_difference = (f - g).abs();
assert!(abs_difference <= f32::EPSILON);
```
[source](https://doc.rust-lang.org/src/std/f32.rs.html#880-882)#### pub fn asinh(self) -> f32
Inverse hyperbolic sine function.
##### Examples
```
let x = 1.0f32;
let f = x.sinh().asinh();
let abs_difference = (f - x).abs();
assert!(abs_difference <= f32::EPSILON);
```
[source](https://doc.rust-lang.org/src/std/f32.rs.html#900-902)#### pub fn acosh(self) -> f32
Inverse hyperbolic cosine function.
##### Examples
```
let x = 1.0f32;
let f = x.cosh().acosh();
let abs_difference = (f - x).abs();
assert!(abs_difference <= f32::EPSILON);
```
[source](https://doc.rust-lang.org/src/std/f32.rs.html#920-922)#### pub fn atanh(self) -> f32
Inverse hyperbolic tangent function.
##### Examples
```
let e = std::f32::consts::E;
let f = e.tanh().atanh();
let abs_difference = (f - e).abs();
assert!(abs_difference <= 1e-5);
```
[source](https://doc.rust-lang.org/src/core/num/f32.rs.html#350)### impl f32
[source](https://doc.rust-lang.org/src/core/num/f32.rs.html#353)1.43.0 · #### pub const RADIX: u32 = 2u32
The radix or base of the internal representation of `f32`.
[source](https://doc.rust-lang.org/src/core/num/f32.rs.html#357)1.43.0 · #### pub const MANTISSA\_DIGITS: u32 = 24u32
Number of significant digits in base 2.
[source](https://doc.rust-lang.org/src/core/num/f32.rs.html#361)1.43.0 · #### pub const DIGITS: u32 = 6u32
Approximate number of significant digits in base 10.
[source](https://doc.rust-lang.org/src/core/num/f32.rs.html#369)1.43.0 · #### pub const EPSILON: f32 = 1.1920929E-7f32
[Machine epsilon](https://en.wikipedia.org/wiki/Machine_epsilon) value for `f32`.
This is the difference between `1.0` and the next larger representable number.
[source](https://doc.rust-lang.org/src/core/num/f32.rs.html#373)1.43.0 · #### pub const MIN: f32 = -3.40282347E+38f32
Smallest finite `f32` value.
[source](https://doc.rust-lang.org/src/core/num/f32.rs.html#376)1.43.0 · #### pub const MIN\_POSITIVE: f32 = 1.17549435E-38f32
Smallest positive normal `f32` value.
[source](https://doc.rust-lang.org/src/core/num/f32.rs.html#379)1.43.0 · #### pub const MAX: f32 = 3.40282347E+38f32
Largest finite `f32` value.
[source](https://doc.rust-lang.org/src/core/num/f32.rs.html#383)1.43.0 · #### pub const MIN\_EXP: i32 = -125i32
One greater than the minimum possible normal power of 2 exponent.
[source](https://doc.rust-lang.org/src/core/num/f32.rs.html#386)1.43.0 · #### pub const MAX\_EXP: i32 = 128i32
Maximum possible power of 2 exponent.
[source](https://doc.rust-lang.org/src/core/num/f32.rs.html#390)1.43.0 · #### pub const MIN\_10\_EXP: i32 = -37i32
Minimum possible normal power of 10 exponent.
[source](https://doc.rust-lang.org/src/core/num/f32.rs.html#393)1.43.0 · #### pub const MAX\_10\_EXP: i32 = 38i32
Maximum possible power of 10 exponent.
[source](https://doc.rust-lang.org/src/core/num/f32.rs.html#406)1.43.0 · #### pub const NAN: f32 = NaNf32
Not a Number (NaN).
Note that IEEE 754 doesn’t define just a single NaN value; a plethora of bit patterns are considered to be NaN. Furthermore, the standard makes a difference between a “signaling” and a “quiet” NaN, and allows inspecting its “payload” (the unspecified bits in the bit pattern). This constant isn’t guaranteed to equal to any specific NaN bitpattern, and the stability of its representation over Rust versions and target platforms isn’t guaranteed.
[source](https://doc.rust-lang.org/src/core/num/f32.rs.html#409)1.43.0 · #### pub const INFINITY: f32 = +Inff32
Infinity (∞).
[source](https://doc.rust-lang.org/src/core/num/f32.rs.html#412)1.43.0 · #### pub const NEG\_INFINITY: f32 = -Inff32
Negative infinity (−∞).
[source](https://doc.rust-lang.org/src/core/num/f32.rs.html#427)const: [unstable](https://github.com/rust-lang/rust/issues/72505 "Tracking issue for const_float_classify") · #### pub fn is\_nan(self) -> bool
Returns `true` if this value is NaN.
```
let nan = f32::NAN;
let f = 7.0_f32;
assert!(nan.is_nan());
assert!(!f.is_nan());
```
[source](https://doc.rust-lang.org/src/core/num/f32.rs.html#460)const: [unstable](https://github.com/rust-lang/rust/issues/72505 "Tracking issue for const_float_classify") · #### pub fn is\_infinite(self) -> bool
Returns `true` if this value is positive infinity or negative infinity, and `false` otherwise.
```
let f = 7.0f32;
let inf = f32::INFINITY;
let neg_inf = f32::NEG_INFINITY;
let nan = f32::NAN;
assert!(!f.is_infinite());
assert!(!nan.is_infinite());
assert!(inf.is_infinite());
assert!(neg_inf.is_infinite());
```
[source](https://doc.rust-lang.org/src/core/num/f32.rs.html#485)const: [unstable](https://github.com/rust-lang/rust/issues/72505 "Tracking issue for const_float_classify") · #### pub fn is\_finite(self) -> bool
Returns `true` if this number is neither infinite nor NaN.
```
let f = 7.0f32;
let inf = f32::INFINITY;
let neg_inf = f32::NEG_INFINITY;
let nan = f32::NAN;
assert!(f.is_finite());
assert!(!nan.is_finite());
assert!(!inf.is_finite());
assert!(!neg_inf.is_finite());
```
[source](https://doc.rust-lang.org/src/core/num/f32.rs.html#513)1.53.0 (const: [unstable](https://github.com/rust-lang/rust/issues/72505 "Tracking issue for const_float_classify")) · #### pub fn is\_subnormal(self) -> bool
Returns `true` if the number is [subnormal](https://en.wikipedia.org/wiki/Denormal_number).
```
let min = f32::MIN_POSITIVE; // 1.17549435e-38f32
let max = f32::MAX;
let lower_than_min = 1.0e-40_f32;
let zero = 0.0_f32;
assert!(!min.is_subnormal());
assert!(!max.is_subnormal());
assert!(!zero.is_subnormal());
assert!(!f32::NAN.is_subnormal());
assert!(!f32::INFINITY.is_subnormal());
// Values between `0` and `min` are Subnormal.
assert!(lower_than_min.is_subnormal());
```
[source](https://doc.rust-lang.org/src/core/num/f32.rs.html#540)const: [unstable](https://github.com/rust-lang/rust/issues/72505 "Tracking issue for const_float_classify") · #### pub fn is\_normal(self) -> bool
Returns `true` if the number is neither zero, infinite, [subnormal](https://en.wikipedia.org/wiki/Denormal_number), or NaN.
```
let min = f32::MIN_POSITIVE; // 1.17549435e-38f32
let max = f32::MAX;
let lower_than_min = 1.0e-40_f32;
let zero = 0.0_f32;
assert!(min.is_normal());
assert!(max.is_normal());
assert!(!zero.is_normal());
assert!(!f32::NAN.is_normal());
assert!(!f32::INFINITY.is_normal());
// Values between `0` and `min` are Subnormal.
assert!(!lower_than_min.is_normal());
```
[source](https://doc.rust-lang.org/src/core/num/f32.rs.html#559)const: [unstable](https://github.com/rust-lang/rust/issues/72505 "Tracking issue for const_float_classify") · #### pub fn classify(self) -> FpCategory
Returns the floating point category of the number. If only one property is going to be tested, it is generally faster to use the specific predicate instead.
```
use std::num::FpCategory;
let num = 12.4_f32;
let inf = f32::INFINITY;
assert_eq!(num.classify(), FpCategory::Normal);
assert_eq!(inf.classify(), FpCategory::Infinite);
```
[source](https://doc.rust-lang.org/src/core/num/f32.rs.html#652)const: [unstable](https://github.com/rust-lang/rust/issues/72505 "Tracking issue for const_float_classify") · #### pub fn is\_sign\_positive(self) -> bool
Returns `true` if `self` has a positive sign, including `+0.0`, NaNs with positive sign bit and positive infinity. Note that IEEE 754 doesn’t assign any meaning to the sign bit in case of a NaN, and as Rust doesn’t guarantee that the bit pattern of NaNs are conserved over arithmetic operations, the result of `is_sign_positive` on a NaN might produce an unexpected result in some cases. See [explanation of NaN as a special value](primitive.f32) for more info.
```
let f = 7.0_f32;
let g = -7.0_f32;
assert!(f.is_sign_positive());
assert!(!g.is_sign_positive());
```
[source](https://doc.rust-lang.org/src/core/num/f32.rs.html#674)const: [unstable](https://github.com/rust-lang/rust/issues/72505 "Tracking issue for const_float_classify") · #### pub fn is\_sign\_negative(self) -> bool
Returns `true` if `self` has a negative sign, including `-0.0`, NaNs with negative sign bit and negative infinity. Note that IEEE 754 doesn’t assign any meaning to the sign bit in case of a NaN, and as Rust doesn’t guarantee that the bit pattern of NaNs are conserved over arithmetic operations, the result of `is_sign_negative` on a NaN might produce an unexpected result in some cases. See [explanation of NaN as a special value](primitive.f32) for more info.
```
let f = 7.0f32;
let g = -7.0f32;
assert!(!f.is_sign_negative());
assert!(g.is_sign_negative());
```
[source](https://doc.rust-lang.org/src/core/num/f32.rs.html#709)const: [unstable](https://github.com/rust-lang/rust/issues/91399 "Tracking issue for float_next_up_down") · #### pub fn next\_up(self) -> f32
🔬This is a nightly-only experimental API. (`float_next_up_down` [#91399](https://github.com/rust-lang/rust/issues/91399))
Returns the least number greater than `self`.
Let `TINY` be the smallest representable positive `f32`. Then,
* if `self.is_nan()`, this returns `self`;
* if `self` is [`NEG_INFINITY`](primitive.f32#associatedconstant.NEG_INFINITY), this returns [`MIN`](primitive.f32#associatedconstant.MIN);
* if `self` is `-TINY`, this returns -0.0;
* if `self` is -0.0 or +0.0, this returns `TINY`;
* if `self` is [`MAX`](primitive.f32#associatedconstant.MAX) or [`INFINITY`](primitive.f32#associatedconstant.INFINITY), this returns [`INFINITY`](primitive.f32#associatedconstant.INFINITY);
* otherwise the unique least value greater than `self` is returned.
The identity `x.next_up() == -(-x).next_down()` holds for all non-NaN `x`. When `x` is finite `x == x.next_up().next_down()` also holds.
```
#![feature(float_next_up_down)]
// f32::EPSILON is the difference between 1.0 and the next number up.
assert_eq!(1.0f32.next_up(), 1.0 + f32::EPSILON);
// But not for most numbers.
assert!(0.1f32.next_up() < 0.1 + f32::EPSILON);
assert_eq!(16777216f32.next_up(), 16777218.0);
```
[source](https://doc.rust-lang.org/src/core/num/f32.rs.html#759)const: [unstable](https://github.com/rust-lang/rust/issues/91399 "Tracking issue for float_next_up_down") · #### pub fn next\_down(self) -> f32
🔬This is a nightly-only experimental API. (`float_next_up_down` [#91399](https://github.com/rust-lang/rust/issues/91399))
Returns the greatest number less than `self`.
Let `TINY` be the smallest representable positive `f32`. Then,
* if `self.is_nan()`, this returns `self`;
* if `self` is [`INFINITY`](primitive.f32#associatedconstant.INFINITY), this returns [`MAX`](primitive.f32#associatedconstant.MAX);
* if `self` is `TINY`, this returns 0.0;
* if `self` is -0.0 or +0.0, this returns `-TINY`;
* if `self` is [`MIN`](primitive.f32#associatedconstant.MIN) or [`NEG_INFINITY`](primitive.f32#associatedconstant.NEG_INFINITY), this returns [`NEG_INFINITY`](primitive.f32#associatedconstant.NEG_INFINITY);
* otherwise the unique greatest value less than `self` is returned.
The identity `x.next_down() == -(-x).next_up()` holds for all non-NaN `x`. When `x` is finite `x == x.next_down().next_up()` also holds.
```
#![feature(float_next_up_down)]
let x = 1.0f32;
// Clamp value into range [0, 1).
let clamped = x.clamp(0.0, 1.0f32.next_down());
assert!(clamped < 1.0);
assert_eq!(clamped.next_up(), 1.0);
```
[source](https://doc.rust-lang.org/src/core/num/f32.rs.html#792)#### pub fn recip(self) -> f32
Takes the reciprocal (inverse) of a number, `1/x`.
```
let x = 2.0_f32;
let abs_difference = (x.recip() - (1.0 / x)).abs();
assert!(abs_difference <= f32::EPSILON);
```
[source](https://doc.rust-lang.org/src/core/num/f32.rs.html#809)1.7.0 · #### pub fn to\_degrees(self) -> f32
Converts radians to degrees.
```
let angle = std::f32::consts::PI;
let abs_difference = (angle.to_degrees() - 180.0).abs();
assert!(abs_difference <= f32::EPSILON);
```
[source](https://doc.rust-lang.org/src/core/num/f32.rs.html#828)1.7.0 · #### pub fn to\_radians(self) -> f32
Converts degrees to radians.
```
let angle = 180.0f32;
let abs_difference = (angle.to_radians() - std::f32::consts::PI).abs();
assert!(abs_difference <= f32::EPSILON);
```
[source](https://doc.rust-lang.org/src/core/num/f32.rs.html#849)#### pub fn max(self, other: f32) -> f32
Returns the maximum of the two numbers, ignoring NaN.
If one of the arguments is NaN, then the other argument is returned. This follows the IEEE 754-2008 semantics for maxNum, except for handling of signaling NaNs; this function handles all NaNs the same way and avoids maxNum’s problems with associativity. This also matches the behavior of libm’s fmax.
```
let x = 1.0f32;
let y = 2.0f32;
assert_eq!(x.max(y), y);
```
[source](https://doc.rust-lang.org/src/core/num/f32.rs.html#869)#### pub fn min(self, other: f32) -> f32
Returns the minimum of the two numbers, ignoring NaN.
If one of the arguments is NaN, then the other argument is returned. This follows the IEEE 754-2008 semantics for minNum, except for handling of signaling NaNs; this function handles all NaNs the same way and avoids minNum’s problems with associativity. This also matches the behavior of libm’s fmin.
```
let x = 1.0f32;
let y = 2.0f32;
assert_eq!(x.min(y), x);
```
[source](https://doc.rust-lang.org/src/core/num/f32.rs.html#896)#### pub fn maximum(self, other: f32) -> f32
🔬This is a nightly-only experimental API. (`float_minimum_maximum` [#91079](https://github.com/rust-lang/rust/issues/91079))
Returns the maximum of the two numbers, propagating NaN.
This returns NaN when *either* argument is NaN, as opposed to [`f32::max`](primitive.f32#method.max "f32::max") which only returns NaN when *both* arguments are NaN.
```
#![feature(float_minimum_maximum)]
let x = 1.0f32;
let y = 2.0f32;
assert_eq!(x.maximum(y), y);
assert!(x.maximum(f32::NAN).is_nan());
```
If one of the arguments is NaN, then NaN is returned. Otherwise this returns the greater of the two numbers. For this operation, -0.0 is considered to be less than +0.0. Note that this follows the semantics specified in IEEE 754-2019.
Also note that “propagation” of NaNs here doesn’t necessarily mean that the bitpattern of a NaN operand is conserved; see [explanation of NaN as a special value](primitive.f32) for more info.
[source](https://doc.rust-lang.org/src/core/num/f32.rs.html#931)#### pub fn minimum(self, other: f32) -> f32
🔬This is a nightly-only experimental API. (`float_minimum_maximum` [#91079](https://github.com/rust-lang/rust/issues/91079))
Returns the minimum of the two numbers, propagating NaN.
This returns NaN when *either* argument is NaN, as opposed to [`f32::min`](primitive.f32#method.min "f32::min") which only returns NaN when *both* arguments are NaN.
```
#![feature(float_minimum_maximum)]
let x = 1.0f32;
let y = 2.0f32;
assert_eq!(x.minimum(y), x);
assert!(x.minimum(f32::NAN).is_nan());
```
If one of the arguments is NaN, then NaN is returned. Otherwise this returns the lesser of the two numbers. For this operation, -0.0 is considered to be less than +0.0. Note that this follows the semantics specified in IEEE 754-2019.
Also note that “propagation” of NaNs here doesn’t necessarily mean that the bitpattern of a NaN operand is conserved; see [explanation of NaN as a special value](primitive.f32) for more info.
[source](https://doc.rust-lang.org/src/core/num/f32.rs.html#967-969)1.44.0 · #### pub unsafe fn to\_int\_unchecked<Int>(self) -> Intwhere [f32](primitive.f32): [FloatToInt](convert/trait.floattoint "trait std::convert::FloatToInt")<Int>,
Rounds toward zero and converts to any primitive integer type, assuming that the value is finite and fits in that type.
```
let value = 4.6_f32;
let rounded = unsafe { value.to_int_unchecked::<u16>() };
assert_eq!(rounded, 4);
let value = -128.9_f32;
let rounded = unsafe { value.to_int_unchecked::<i8>() };
assert_eq!(rounded, i8::MIN);
```
##### Safety
The value must:
* Not be `NaN`
* Not be infinite
* Be representable in the return type `Int`, after truncating off its fractional part
[source](https://doc.rust-lang.org/src/core/num/f32.rs.html#998)1.20.0 (const: [unstable](https://github.com/rust-lang/rust/issues/72447 "Tracking issue for const_float_bits_conv")) · #### pub fn to\_bits(self) -> u32
Raw transmutation to `u32`.
This is currently identical to `transmute::<f32, u32>(self)` on all platforms.
See [`from_bits`](primitive.f32#method.from_bits) for some discussion of the portability of this operation (there are almost no issues).
Note that this function is distinct from `as` casting, which attempts to preserve the *numeric* value, and not the bitwise value.
##### Examples
```
assert_ne!((1f32).to_bits(), 1f32 as u32); // to_bits() is not casting!
assert_eq!((12.5f32).to_bits(), 0x41480000);
```
[source](https://doc.rust-lang.org/src/core/num/f32.rs.html#1088)1.20.0 (const: [unstable](https://github.com/rust-lang/rust/issues/72447 "Tracking issue for const_float_bits_conv")) · #### pub fn from\_bits(v: u32) -> f32
Raw transmutation from `u32`.
This is currently identical to `transmute::<u32, f32>(v)` on all platforms. It turns out this is incredibly portable, for two reasons:
* Floats and Ints have the same endianness on all supported platforms.
* IEEE 754 very precisely specifies the bit layout of floats.
However there is one caveat: prior to the 2008 version of IEEE 754, how to interpret the NaN signaling bit wasn’t actually specified. Most platforms (notably x86 and ARM) picked the interpretation that was ultimately standardized in 2008, but some didn’t (notably MIPS). As a result, all signaling NaNs on MIPS are quiet NaNs on x86, and vice-versa.
Rather than trying to preserve signaling-ness cross-platform, this implementation favors preserving the exact bits. This means that any payloads encoded in NaNs will be preserved even if the result of this method is sent over the network from an x86 machine to a MIPS one.
If the results of this method are only manipulated by the same architecture that produced them, then there is no portability concern.
If the input isn’t NaN, then there is no portability concern.
If you don’t care about signalingness (very likely), then there is no portability concern.
Note that this function is distinct from `as` casting, which attempts to preserve the *numeric* value, and not the bitwise value.
##### Examples
```
let v = f32::from_bits(0x41480000);
assert_eq!(v, 12.5);
```
[source](https://doc.rust-lang.org/src/core/num/f32.rs.html#1157)1.40.0 (const: [unstable](https://github.com/rust-lang/rust/issues/72447 "Tracking issue for const_float_bits_conv")) · #### pub fn to\_be\_bytes(self) -> [u8; 4]
Return the memory representation of this floating point number as a byte array in big-endian (network) byte order.
See [`from_bits`](primitive.f32#method.from_bits) for some discussion of the portability of this operation (there are almost no issues).
##### Examples
```
let bytes = 12.5f32.to_be_bytes();
assert_eq!(bytes, [0x41, 0x48, 0x00, 0x00]);
```
[source](https://doc.rust-lang.org/src/core/num/f32.rs.html#1178)1.40.0 (const: [unstable](https://github.com/rust-lang/rust/issues/72447 "Tracking issue for const_float_bits_conv")) · #### pub fn to\_le\_bytes(self) -> [u8; 4]
Return the memory representation of this floating point number as a byte array in little-endian byte order.
See [`from_bits`](primitive.f32#method.from_bits) for some discussion of the portability of this operation (there are almost no issues).
##### Examples
```
let bytes = 12.5f32.to_le_bytes();
assert_eq!(bytes, [0x00, 0x00, 0x48, 0x41]);
```
[source](https://doc.rust-lang.org/src/core/num/f32.rs.html#1212)1.40.0 (const: [unstable](https://github.com/rust-lang/rust/issues/72447 "Tracking issue for const_float_bits_conv")) · #### pub fn to\_ne\_bytes(self) -> [u8; 4]
Return the memory representation of this floating point number as a byte array in native byte order.
As the target platform’s native endianness is used, portable code should use [`to_be_bytes`](primitive.f32#method.to_be_bytes) or [`to_le_bytes`](primitive.f32#method.to_le_bytes), as appropriate, instead.
See [`from_bits`](primitive.f32#method.from_bits) for some discussion of the portability of this operation (there are almost no issues).
##### Examples
```
let bytes = 12.5f32.to_ne_bytes();
assert_eq!(
bytes,
if cfg!(target_endian = "big") {
[0x41, 0x48, 0x00, 0x00]
} else {
[0x00, 0x00, 0x48, 0x41]
}
);
```
[source](https://doc.rust-lang.org/src/core/num/f32.rs.html#1231)1.40.0 (const: [unstable](https://github.com/rust-lang/rust/issues/72447 "Tracking issue for const_float_bits_conv")) · #### pub fn from\_be\_bytes(bytes: [u8; 4]) -> f32
Create a floating point value from its representation as a byte array in big endian.
See [`from_bits`](primitive.f32#method.from_bits) for some discussion of the portability of this operation (there are almost no issues).
##### Examples
```
let value = f32::from_be_bytes([0x41, 0x48, 0x00, 0x00]);
assert_eq!(value, 12.5);
```
[source](https://doc.rust-lang.org/src/core/num/f32.rs.html#1250)1.40.0 (const: [unstable](https://github.com/rust-lang/rust/issues/72447 "Tracking issue for const_float_bits_conv")) · #### pub fn from\_le\_bytes(bytes: [u8; 4]) -> f32
Create a floating point value from its representation as a byte array in little endian.
See [`from_bits`](primitive.f32#method.from_bits) for some discussion of the portability of this operation (there are almost no issues).
##### Examples
```
let value = f32::from_le_bytes([0x00, 0x00, 0x48, 0x41]);
assert_eq!(value, 12.5);
```
[source](https://doc.rust-lang.org/src/core/num/f32.rs.html#1280)1.40.0 (const: [unstable](https://github.com/rust-lang/rust/issues/72447 "Tracking issue for const_float_bits_conv")) · #### pub fn from\_ne\_bytes(bytes: [u8; 4]) -> f32
Create a floating point value from its representation as a byte array in native endian.
As the target platform’s native endianness is used, portable code likely wants to use [`from_be_bytes`](primitive.f32#method.from_be_bytes) or [`from_le_bytes`](primitive.f32#method.from_le_bytes), as appropriate instead.
See [`from_bits`](primitive.f32#method.from_bits) for some discussion of the portability of this operation (there are almost no issues).
##### Examples
```
let value = f32::from_ne_bytes(if cfg!(target_endian = "big") {
[0x41, 0x48, 0x00, 0x00]
} else {
[0x00, 0x00, 0x48, 0x41]
});
assert_eq!(value, 12.5);
```
[source](https://doc.rust-lang.org/src/core/num/f32.rs.html#1338)1.62.0 · #### pub fn total\_cmp(&self, other: &f32) -> Ordering
Return the ordering between `self` and `other`.
Unlike the standard partial comparison between floating point numbers, this comparison always produces an ordering in accordance to the `totalOrder` predicate as defined in the IEEE 754 (2008 revision) floating point standard. The values are ordered in the following sequence:
* negative quiet NaN
* negative signaling NaN
* negative infinity
* negative numbers
* negative subnormal numbers
* negative zero
* positive zero
* positive subnormal numbers
* positive numbers
* positive infinity
* positive signaling NaN
* positive quiet NaN.
The ordering established by this function does not always agree with the [`PartialOrd`](cmp/trait.partialord "PartialOrd") and [`PartialEq`](cmp/trait.partialeq "PartialEq") implementations of `f32`. For example, they consider negative and positive zero equal, while `total_cmp` doesn’t.
The interpretation of the signaling NaN bit follows the definition in the IEEE 754 standard, which may not match the interpretation by some of the older, non-conformant (e.g. MIPS) hardware implementations.
##### Example
```
struct GoodBoy {
name: String,
weight: f32,
}
let mut bois = vec![
GoodBoy { name: "Pucci".to_owned(), weight: 0.1 },
GoodBoy { name: "Woofer".to_owned(), weight: 99.0 },
GoodBoy { name: "Yapper".to_owned(), weight: 10.0 },
GoodBoy { name: "Chonk".to_owned(), weight: f32::INFINITY },
GoodBoy { name: "Abs. Unit".to_owned(), weight: f32::NAN },
GoodBoy { name: "Floaty".to_owned(), weight: -5.0 },
];
bois.sort_by(|a, b| a.weight.total_cmp(&b.weight));
```
[source](https://doc.rust-lang.org/src/core/num/f32.rs.html#1393)1.50.0 · #### pub fn clamp(self, min: f32, max: f32) -> f32
Restrict a value to a certain interval unless it is NaN.
Returns `max` if `self` is greater than `max`, and `min` if `self` is less than `min`. Otherwise this returns `self`.
Note that this function returns NaN if the initial value was NaN as well.
##### Panics
Panics if `min > max`, `min` is NaN, or `max` is NaN.
##### Examples
```
assert!((-3.0f32).clamp(-2.0, 1.0) == -2.0);
assert!((0.0f32).clamp(-2.0, 1.0) == 0.0);
assert!((2.0f32).clamp(-2.0, 1.0) == 1.0);
assert!((f32::NAN).clamp(-2.0, 1.0).is_nan());
```
Trait Implementations
---------------------
[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
The resulting type after applying the `+` operator.
[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") · #### fn add(self, other: &f32) -> <f32 as Add<f32>>::Output
Performs the `+` operation. [Read more](ops/trait.add#tymethod.add)
[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
The resulting type after applying the `+` operator.
[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") · #### fn add(self, other: &f32) -> <f32 as Add<f32>>::Output
Performs the `+` operation. [Read more](ops/trait.add#tymethod.add)
[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
The resulting type after applying the `+` operator.
[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") · #### fn add(self, other: f32) -> <f32 as Add<f32>>::Output
Performs the `+` operation. [Read more](ops/trait.add#tymethod.add)
[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
The resulting type after applying the `+` operator.
[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") · #### fn add(self, other: f32) -> f32
Performs the `+` operation. [Read more](ops/trait.add#tymethod.add)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn add\_assign(&mut self, other: &f32)
Performs the `+=` operation. [Read more](ops/trait.addassign#tymethod.add_assign)
[source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#786)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn add\_assign(&mut self, other: f32)
Performs the `+=` operation. [Read more](ops/trait.addassign#tymethod.add_assign)
[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") · #### fn clone(&self) -> f32
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/float.rs.html#225)### impl Debug for f32
[source](https://doc.rust-lang.org/src/core/fmt/float.rs.html#225)#### 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/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#221)const: [unstable](https://github.com/rust-lang/rust/issues/87864 "Tracking issue for const_default_impls") · #### fn default() -> f32
Returns the default value of `0.0`
[source](https://doc.rust-lang.org/src/core/fmt/float.rs.html#225)### impl Display for f32
[source](https://doc.rust-lang.org/src/core/fmt/float.rs.html#225)#### 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/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
The resulting type after applying the `/` operator.
[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") · #### fn div(self, other: &f32) -> <f32 as Div<f32>>::Output
Performs the `/` operation. [Read more](ops/trait.div#tymethod.div)
[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
The resulting type after applying the `/` operator.
[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") · #### fn div(self, other: &f32) -> <f32 as Div<f32>>::Output
Performs the `/` operation. [Read more](ops/trait.div#tymethod.div)
[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
The resulting type after applying the `/` operator.
[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") · #### fn div(self, other: f32) -> <f32 as Div<f32>>::Output
Performs the `/` operation. [Read more](ops/trait.div#tymethod.div)
[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
The resulting type after applying the `/` operator.
[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") · #### fn div(self, other: f32) -> f32
Performs the `/` operation. [Read more](ops/trait.div#tymethod.div)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn div\_assign(&mut self, other: &f32)
Performs the `/=` operation. [Read more](ops/trait.divassign#tymethod.div_assign)
[source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#968)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn div\_assign(&mut self, other: f32)
Performs the `/=` operation. [Read more](ops/trait.divassign#tymethod.div_assign)
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#169)1.6.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<f32> for f64
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#169)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: f32) -> f64
Converts `f32` to `f64` losslessly.
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#157)1.6.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<i16> for f32
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#157)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: i16) -> f32
Converts `i16` to `f32` losslessly.
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#155)1.6.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<i8> for f32
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#155)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: i8) -> f32
Converts `i8` to `f32` losslessly.
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#164)1.6.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<u16> for f32
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#164)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: u16) -> f32
Converts `u16` to `f32` losslessly.
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#162)1.6.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<u8> for f32
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#162)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: u8) -> f32
Converts `u8` to `f32` losslessly.
[source](https://doc.rust-lang.org/src/core/num/dec2flt/mod.rs.html#156)### impl FromStr for f32
[source](https://doc.rust-lang.org/src/core/num/dec2flt/mod.rs.html#156)#### fn from\_str(src: &str) -> Result<f32, ParseFloatError>
Converts a string in base 10 to a float. Accepts an optional decimal exponent.
This function accepts strings such as
* ‘3.14’
* ‘-3.14’
* ‘2.5E10’, or equivalently, ‘2.5e10’
* ‘2.5E-10’
* ‘5.’
* ‘.5’, or, equivalently, ‘0.5’
* ‘inf’, ‘-inf’, ‘+infinity’, ‘NaN’
Note that alphabetical characters are not case-sensitive.
Leading and trailing whitespace represent an error.
##### Grammar
All strings that adhere to the following [EBNF](https://www.w3.org/TR/REC-xml/#sec-notation) grammar when lowercased will result in an [`Ok`](result/enum.result#variant.Ok "Ok") being returned:
```
Float ::= Sign? ( 'inf' | 'infinity' | 'nan' | Number )
Number ::= ( Digit+ |
Digit+ '.' Digit* |
Digit* '.' Digit+ ) Exp?
Exp ::= 'e' Sign? Digit+
Sign ::= [+-]
Digit ::= [0-9]
```
##### Arguments
* src - A string
##### Return value
`Err(ParseFloatError)` if the string did not represent a valid number. Otherwise, `Ok(n)` where `n` is the closest representable floating-point number to the number represented by `src` (following the same rules for rounding as for the results of primitive operations).
#### type Err = ParseFloatError
The associated error which can be returned from parsing.
[source](https://doc.rust-lang.org/src/core/fmt/float.rs.html#225)### impl LowerExp for f32
[source](https://doc.rust-lang.org/src/core/fmt/float.rs.html#225)#### fn fmt(&self, fmt: &mut Formatter<'\_>) -> Result<(), Error>
Formats the value using the given formatter.
[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
The resulting type after applying the `*` operator.
[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") · #### fn mul(self, other: &f32) -> <f32 as Mul<f32>>::Output
Performs the `*` operation. [Read more](ops/trait.mul#tymethod.mul)
[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
The resulting type after applying the `*` operator.
[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") · #### fn mul(self, other: &f32) -> <f32 as Mul<f32>>::Output
Performs the `*` operation. [Read more](ops/trait.mul#tymethod.mul)
[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
The resulting type after applying the `*` operator.
[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") · #### fn mul(self, other: f32) -> <f32 as Mul<f32>>::Output
Performs the `*` operation. [Read more](ops/trait.mul#tymethod.mul)
[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
The resulting type after applying the `*` operator.
[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") · #### fn mul(self, other: f32) -> f32
Performs the `*` operation. [Read more](ops/trait.mul#tymethod.mul)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn mul\_assign(&mut self, other: &f32)
Performs the `*=` operation. [Read more](ops/trait.mulassign#tymethod.mul_assign)
[source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#911)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn mul\_assign(&mut self, other: f32)
Performs the `*=` operation. [Read more](ops/trait.mulassign#tymethod.mul_assign)
[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
The resulting type after applying the `-` operator.
[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") · #### fn neg(self) -> <f32 as Neg>::Output
Performs the unary `-` operation. [Read more](ops/trait.neg#tymethod.neg)
[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
The resulting type after applying the `-` operator.
[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") · #### fn neg(self) -> f32
Performs the unary `-` operation. [Read more](ops/trait.neg#tymethod.neg)
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1366-1368)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · ### impl PartialEq<f32> for f32
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1366-1368)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · #### fn eq(&self, other: &f32) -> 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#1366-1368)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · #### fn ne(&self, other: &f32) -> 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/cmp.rs.html#1423)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · ### impl PartialOrd<f32> for f32
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1423)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · #### fn partial\_cmp(&self, other: &f32) -> 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#1423)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · #### fn lt(&self, other: &f32) -> 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#1423)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · #### fn le(&self, other: &f32) -> 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#1423)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · #### fn ge(&self, other: &f32) -> 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/cmp.rs.html#1423)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · #### fn gt(&self, other: &f32) -> 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/iter/traits/accum.rs.html#142)1.12.0 · ### impl<'a> Product<&'a f32> for f32
[source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#142)#### fn product<I>(iter: I) -> f32where I: [Iterator](iter/trait.iterator "trait std::iter::Iterator")<Item = &'a [f32](primitive.f32)>,
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#142)1.12.0 · ### impl Product<f32> for f32
[source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#142)#### fn product<I>(iter: I) -> f32where I: [Iterator](iter/trait.iterator "trait std::iter::Iterator")<Item = [f32](primitive.f32)>,
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/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
The resulting type after applying the `%` operator.
[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") · #### fn rem(self, other: &f32) -> <f32 as Rem<f32>>::Output
Performs the `%` operation. [Read more](ops/trait.rem#tymethod.rem)
[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
The resulting type after applying the `%` operator.
[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") · #### fn rem(self, other: &f32) -> <f32 as Rem<f32>>::Output
Performs the `%` operation. [Read more](ops/trait.rem#tymethod.rem)
[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
The resulting type after applying the `%` operator.
[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") · #### fn rem(self, other: f32) -> <f32 as Rem<f32>>::Output
Performs the `%` operation. [Read more](ops/trait.rem#tymethod.rem)
[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
The resulting type after applying the `%` operator.
[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") · #### fn rem(self, other: f32) -> f32
Performs the `%` operation. [Read more](ops/trait.rem#tymethod.rem)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn rem\_assign(&mut self, other: &f32)
Performs the `%=` operation. [Read more](ops/trait.remassign#tymethod.rem_assign)
[source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#1029)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn rem\_assign(&mut self, other: f32)
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/vector.rs.html#733)### impl SimdElement for f32
#### type Mask = i32
🔬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.
[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
The resulting type after applying the `-` operator.
[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") · #### fn sub(self, other: &f32) -> <f32 as Sub<f32>>::Output
Performs the `-` operation. [Read more](ops/trait.sub#tymethod.sub)
[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
The resulting type after applying the `-` operator.
[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") · #### fn sub(self, other: &f32) -> <f32 as Sub<f32>>::Output
Performs the `-` operation. [Read more](ops/trait.sub#tymethod.sub)
[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
The resulting type after applying the `-` operator.
[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") · #### fn sub(self, other: f32) -> <f32 as Sub<f32>>::Output
Performs the `-` operation. [Read more](ops/trait.sub#tymethod.sub)
[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
The resulting type after applying the `-` operator.
[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") · #### fn sub(self, other: f32) -> f32
Performs the `-` operation. [Read more](ops/trait.sub#tymethod.sub)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn sub\_assign(&mut self, other: &f32)
Performs the `-=` operation. [Read more](ops/trait.subassign#tymethod.sub_assign)
[source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#853)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn sub\_assign(&mut self, other: f32)
Performs the `-=` operation. [Read more](ops/trait.subassign#tymethod.sub_assign)
[source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#142)1.12.0 · ### impl<'a> Sum<&'a f32> for f32
[source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#142)#### fn sum<I>(iter: I) -> f32where I: [Iterator](iter/trait.iterator "trait std::iter::Iterator")<Item = &'a [f32](primitive.f32)>,
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#142)1.12.0 · ### impl Sum<f32> for f32
[source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#142)#### fn sum<I>(iter: I) -> f32where I: [Iterator](iter/trait.iterator "trait std::iter::Iterator")<Item = [f32](primitive.f32)>,
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/fmt/float.rs.html#225)### impl UpperExp for f32
[source](https://doc.rust-lang.org/src/core/fmt/float.rs.html#225)#### fn fmt(&self, fmt: &mut Formatter<'\_>) -> Result<(), Error>
Formats the value using the given formatter.
[source](https://doc.rust-lang.org/src/core/marker.rs.html#830-835)### impl Copy for f32
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#38)### impl FloatToInt<i128> for f32
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#38)### impl FloatToInt<i16> for f32
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#38)### impl FloatToInt<i32> for f32
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#38)### impl FloatToInt<i64> for f32
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#38)### impl FloatToInt<i8> for f32
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#38)### impl FloatToInt<isize> for f32
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#38)### impl FloatToInt<u128> for f32
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#38)### impl FloatToInt<u16> for f32
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#38)### impl FloatToInt<u32> for f32
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#38)### impl FloatToInt<u64> for f32
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#38)### impl FloatToInt<u8> for f32
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#38)### impl FloatToInt<usize> for f32
Auto Trait Implementations
--------------------------
### impl RefUnwindSafe for f32
### impl Send for f32
### impl Sync for f32
### impl Unpin for f32
### impl UnwindSafe for f32
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 Keyword crate Keyword crate
=============
A Rust binary or library.
The primary use of the `crate` keyword is as a part of `extern crate` declarations, which are used to specify a dependency on a crate external to the one it’s declared in. Crates are the fundamental compilation unit of Rust code, and can be seen as libraries or projects. More can be read about crates in the [Reference](../reference/items/extern-crates).
ⓘ
```
extern crate rand;
extern crate my_crate as thing;
extern crate std; // implicitly added to the root of every Rust project
```
The `as` keyword can be used to change what the crate is referred to as in your project. If a crate name includes a dash, it is implicitly imported with the dashes replaced by underscores.
`crate` can also be used as in conjunction with `pub` to signify that the item it’s attached to is public only to other members of the same crate it’s in.
```
pub(crate) use std::io::Error as IoError;
pub(crate) enum CoolMarkerType { }
pub struct PublicThing {
pub(crate) semi_secret_thing: bool,
}
```
`crate` is also used to represent the absolute path of a module, where `crate` refers to the root of the current crate. For instance, `crate::foo::bar` refers to the name `bar` inside the module `foo`, from anywhere else in the same crate.
rust Macro std::concat_idents Macro std::concat\_idents
=========================
```
macro_rules! concat_idents {
($($e:ident),+ $(,)?) => { ... };
}
```
🔬This is a nightly-only experimental API. (`concat_idents` [#29599](https://github.com/rust-lang/rust/issues/29599))
Concatenates identifiers into one identifier.
This macro takes any number of comma-separated identifiers, and concatenates them all into one, yielding an expression which is a new identifier. Note that hygiene makes it such that this macro cannot capture local variables. Also, as a general rule, macros are only allowed in item, statement or expression position. That means while you may use this macro for referring to existing variables, functions or modules etc, you cannot define a new one with it.
Examples
--------
```
#![feature(concat_idents)]
fn foobar() -> u32 { 23 }
let f = concat_idents!(foo, bar);
println!("{}", f());
// fn concat_idents!(new, fun, name) { } // not usable in this way!
```
rust Primitive Type str Primitive Type str
==================
String slices.
*[See also the `std::str` module](str/index).*
The `str` type, also called a ‘string slice’, is the most primitive string type. It is usually seen in its borrowed form, `&str`. It is also the type of string literals, `&'static str`.
String slices are always valid UTF-8.
Basic Usage
-----------
String literals are string slices:
```
let hello_world = "Hello, World!";
```
Here we have declared a string slice initialized with a string literal. String literals have a static lifetime, which means the string `hello_world` is guaranteed to be valid for the duration of the entire program. We can explicitly specify `hello_world`’s lifetime as well:
```
let hello_world: &'static str = "Hello, world!";
```
Representation
--------------
A `&str` is made up of two components: a pointer to some bytes, and a length. You can look at these with the [`as_ptr`](primitive.str#method.as_ptr) and [`len`](primitive.str#method.len) methods:
```
use std::slice;
use std::str;
let story = "Once upon a time...";
let ptr = story.as_ptr();
let len = story.len();
// story has nineteen bytes
assert_eq!(19, len);
// We can re-build a str out of ptr and len. This is all unsafe because
// we are responsible for making sure the two components are valid:
let s = unsafe {
// First, we build a &[u8]...
let slice = slice::from_raw_parts(ptr, len);
// ... and then convert that slice into a string slice
str::from_utf8(slice)
};
assert_eq!(s, Ok(story));
```
Note: This example shows the internals of `&str`. `unsafe` should not be used to get a string slice under normal circumstances. Use `as_str` instead.
Implementations
---------------
[source](https://doc.rust-lang.org/src/core/str/mod.rs.html#136)### impl str
[source](https://doc.rust-lang.org/src/core/str/mod.rs.html#159)const: 1.39.0 · #### pub const fn len(&self) -> usize
Returns the length of `self`.
This length is in bytes, not [`char`](primitive.char)s or graphemes. In other words, it might not be what a human considers the length of the string.
##### Examples
Basic usage:
```
let len = "foo".len();
assert_eq!(3, len);
assert_eq!("ƒoo".len(), 4); // fancy f!
assert_eq!("ƒoo".chars().count(), 3);
```
[source](https://doc.rust-lang.org/src/core/str/mod.rs.html#180)const: 1.39.0 · #### pub const fn is\_empty(&self) -> bool
Returns `true` if `self` has a length of zero bytes.
##### Examples
Basic usage:
```
let s = "";
assert!(s.is_empty());
let s = "not empty";
assert!(!s.is_empty());
```
[source](https://doc.rust-lang.org/src/core/str/mod.rs.html#211)1.9.0 (const: unstable) · #### pub fn is\_char\_boundary(&self, index: usize) -> bool
Checks that `index`-th byte is the first byte in a UTF-8 code point sequence or the end of the string.
The start and end of the string (when `index == self.len()`) are considered to be boundaries.
Returns `false` if `index` is greater than `self.len()`.
##### Examples
```
let s = "Löwe 老虎 Léopard";
assert!(s.is_char_boundary(0));
// start of `老`
assert!(s.is_char_boundary(6));
assert!(s.is_char_boundary(s.len()));
// second byte of `ö`
assert!(!s.is_char_boundary(2));
// third byte of `老`
assert!(!s.is_char_boundary(8));
```
[source](https://doc.rust-lang.org/src/core/str/mod.rs.html#258)#### pub fn floor\_char\_boundary(&self, index: usize) -> usize
🔬This is a nightly-only experimental API. (`round_char_boundary` [#93743](https://github.com/rust-lang/rust/issues/93743))
Finds the closest `x` not exceeding `index` where `is_char_boundary(x)` is `true`.
This method can help you truncate a string so that it’s still valid UTF-8, but doesn’t exceed a given number of bytes. Note that this is done purely at the character level and can still visually split graphemes, even though the underlying characters aren’t split. For example, the emoji 🧑🔬 (scientist) could be split so that the string only includes 🧑 (person) instead.
##### Examples
```
#![feature(round_char_boundary)]
let s = "❤️🧡💛💚💙💜";
assert_eq!(s.len(), 26);
assert!(!s.is_char_boundary(13));
let closest = s.floor_char_boundary(13);
assert_eq!(closest, 10);
assert_eq!(&s[..closest], "❤️🧡");
```
[source](https://doc.rust-lang.org/src/core/str/mod.rs.html#297)#### pub fn ceil\_char\_boundary(&self, index: usize) -> usize
🔬This is a nightly-only experimental API. (`round_char_boundary` [#93743](https://github.com/rust-lang/rust/issues/93743))
Finds the closest `x` not below `index` where `is_char_boundary(x)` is `true`.
This method is the natural complement to [`floor_char_boundary`](primitive.str#method.floor_char_boundary). See that method for more details.
##### Panics
Panics if `index > self.len()`.
##### Examples
```
#![feature(round_char_boundary)]
let s = "❤️🧡💛💚💙💜";
assert_eq!(s.len(), 26);
assert!(!s.is_char_boundary(13));
let closest = s.ceil_char_boundary(13);
assert_eq!(closest, 14);
assert_eq!(&s[..closest], "❤️🧡💛");
```
[source](https://doc.rust-lang.org/src/core/str/mod.rs.html#325)const: 1.39.0 · #### pub const fn as\_bytes(&self) -> &[u8]
Notable traits for &[[u8](primitive.u8)]
```
impl Read for &[u8]
impl Write for &mut [u8]
```
Converts a string slice to a byte slice. To convert the byte slice back into a string slice, use the [`from_utf8`](str/fn.from_utf8 "from_utf8") function.
##### Examples
Basic usage:
```
let bytes = "bors".as_bytes();
assert_eq!(b"bors", bytes);
```
[source](https://doc.rust-lang.org/src/core/str/mod.rs.html#369)1.20.0 · #### pub unsafe fn as\_bytes\_mut(&mut self) -> &mut [u8]
Notable traits for &[[u8](primitive.u8)]
```
impl Read for &[u8]
impl Write for &mut [u8]
```
Converts a mutable string slice to a mutable byte slice.
##### Safety
The caller must ensure that the content of the slice is valid UTF-8 before the borrow ends and the underlying `str` is used.
Use of a `str` whose contents are not valid UTF-8 is undefined behavior.
##### Examples
Basic usage:
```
let mut s = String::from("Hello");
let bytes = unsafe { s.as_bytes_mut() };
assert_eq!(b"Hello", bytes);
```
Mutability:
```
let mut s = String::from("🗻∈🌏");
unsafe {
let bytes = s.as_bytes_mut();
bytes[0] = 0xF0;
bytes[1] = 0x9F;
bytes[2] = 0x8D;
bytes[3] = 0x94;
}
assert_eq!("🍔∈🌏", s);
```
[source](https://doc.rust-lang.org/src/core/str/mod.rs.html#400)const: 1.32.0 · #### pub const fn as\_ptr(&self) -> \*const u8
Converts a string slice to a raw pointer.
As string slices are a slice of bytes, the raw pointer points to a [`u8`](primitive.u8 "u8"). This pointer will be pointing to the first byte of the string slice.
The caller must ensure that the returned pointer is never written to. If you need to mutate the contents of the string slice, use [`as_mut_ptr`](primitive.str#method.as_mut_ptr).
##### Examples
Basic usage:
```
let s = "Hello";
let ptr = s.as_ptr();
```
[source](https://doc.rust-lang.org/src/core/str/mod.rs.html#415)1.36.0 · #### pub fn as\_mut\_ptr(&mut self) -> \*mut u8
Converts a mutable string slice to a raw pointer.
As string slices are a slice of bytes, the raw pointer points to a [`u8`](primitive.u8 "u8"). This pointer will be pointing to the first byte of the string slice.
It is your responsibility to make sure that the string slice only gets modified in a way that it remains valid UTF-8.
[source](https://doc.rust-lang.org/src/core/str/mod.rs.html#441)1.20.0 (const: unstable) · #### pub fn get<I>(&self, i: I) -> Option<&<I as SliceIndex<str>>::Output>where I: [SliceIndex](slice/trait.sliceindex "trait std::slice::SliceIndex")<[str](primitive.str)>,
Returns a subslice of `str`.
This is the non-panicking alternative to indexing the `str`. Returns [`None`](option/enum.option#variant.None "None") whenever equivalent indexing operation would panic.
##### Examples
```
let v = String::from("🗻∈🌏");
assert_eq!(Some("🗻"), v.get(0..4));
// indices not on UTF-8 sequence boundaries
assert!(v.get(1..).is_none());
assert!(v.get(..8).is_none());
// out of bounds
assert!(v.get(..42).is_none());
```
[source](https://doc.rust-lang.org/src/core/str/mod.rs.html#474)1.20.0 (const: unstable) · #### pub fn get\_mut<I>(&mut self, i: I) -> Option<&mut <I as SliceIndex<str>>::Output>where I: [SliceIndex](slice/trait.sliceindex "trait std::slice::SliceIndex")<[str](primitive.str)>,
Returns a mutable subslice of `str`.
This is the non-panicking alternative to indexing the `str`. Returns [`None`](option/enum.option#variant.None "None") whenever equivalent indexing operation would panic.
##### Examples
```
let mut v = String::from("hello");
// correct length
assert!(v.get_mut(0..5).is_some());
// out of bounds
assert!(v.get_mut(..42).is_none());
assert_eq!(Some("he"), v.get_mut(0..2).map(|v| &*v));
assert_eq!("hello", v);
{
let s = v.get_mut(0..2);
let s = s.map(|s| {
s.make_ascii_uppercase();
&*s
});
assert_eq!(Some("HE"), s);
}
assert_eq!("HEllo", v);
```
[source](https://doc.rust-lang.org/src/core/str/mod.rs.html#507)1.20.0 (const: unstable) · #### pub unsafe fn get\_unchecked<I>(&self, i: I) -> &<I as SliceIndex<str>>::Outputwhere I: [SliceIndex](slice/trait.sliceindex "trait std::slice::SliceIndex")<[str](primitive.str)>,
Returns an unchecked subslice of `str`.
This is the unchecked alternative to indexing the `str`.
##### Safety
Callers of this function are responsible that these preconditions are satisfied:
* The starting index must not exceed the ending index;
* Indexes must be within bounds of the original slice;
* Indexes must lie on UTF-8 sequence boundaries.
Failing that, the returned string slice may reference invalid memory or violate the invariants communicated by the `str` type.
##### Examples
```
let v = "🗻∈🌏";
unsafe {
assert_eq!("🗻", v.get_unchecked(0..4));
assert_eq!("∈", v.get_unchecked(4..7));
assert_eq!("🌏", v.get_unchecked(7..11));
}
```
[source](https://doc.rust-lang.org/src/core/str/mod.rs.html#543-546)1.20.0 (const: unstable) · #### pub unsafe fn get\_unchecked\_mut<I>( &mut self, i: I) -> &mut <I as SliceIndex<str>>::Outputwhere I: [SliceIndex](slice/trait.sliceindex "trait std::slice::SliceIndex")<[str](primitive.str)>,
Returns a mutable, unchecked subslice of `str`.
This is the unchecked alternative to indexing the `str`.
##### Safety
Callers of this function are responsible that these preconditions are satisfied:
* The starting index must not exceed the ending index;
* Indexes must be within bounds of the original slice;
* Indexes must lie on UTF-8 sequence boundaries.
Failing that, the returned string slice may reference invalid memory or violate the invariants communicated by the `str` type.
##### Examples
```
let mut v = String::from("🗻∈🌏");
unsafe {
assert_eq!("🗻", v.get_unchecked_mut(0..4));
assert_eq!("∈", v.get_unchecked_mut(4..7));
assert_eq!("🌏", v.get_unchecked_mut(7..11));
}
```
[source](https://doc.rust-lang.org/src/core/str/mod.rs.html#599)#### pub unsafe fn slice\_unchecked(&self, begin: usize, end: usize) -> &str
👎Deprecated since 1.29.0: use `get_unchecked(begin..end)` instead
Creates a string slice from another string slice, bypassing safety checks.
This is generally not recommended, use with caution! For a safe alternative see [`str`](primitive.str "str") and [`Index`](ops/trait.index).
This new slice goes from `begin` to `end`, including `begin` but excluding `end`.
To get a mutable string slice instead, see the [`slice_mut_unchecked`](primitive.str#method.slice_mut_unchecked) method.
##### Safety
Callers of this function are responsible that three preconditions are satisfied:
* `begin` must not exceed `end`.
* `begin` and `end` must be byte positions within the string slice.
* `begin` and `end` must lie on UTF-8 sequence boundaries.
##### Examples
Basic usage:
```
let s = "Löwe 老虎 Léopard";
unsafe {
assert_eq!("Löwe 老虎 Léopard", s.slice_unchecked(0, 21));
}
let s = "Hello, world!";
unsafe {
assert_eq!("world", s.slice_unchecked(7, 12));
}
```
[source](https://doc.rust-lang.org/src/core/str/mod.rs.html#632)1.5.0 · #### pub unsafe fn slice\_mut\_unchecked(&mut self, begin: usize, end: usize) -> &mut str
👎Deprecated since 1.29.0: use `get_unchecked_mut(begin..end)` instead
Creates a string slice from another string slice, bypassing safety checks. This is generally not recommended, use with caution! For a safe alternative see [`str`](primitive.str "str") and [`IndexMut`](ops/trait.indexmut).
This new slice goes from `begin` to `end`, including `begin` but excluding `end`.
To get an immutable string slice instead, see the [`slice_unchecked`](primitive.str#method.slice_unchecked) method.
##### Safety
Callers of this function are responsible that three preconditions are satisfied:
* `begin` must not exceed `end`.
* `begin` and `end` must be byte positions within the string slice.
* `begin` and `end` must lie on UTF-8 sequence boundaries.
[source](https://doc.rust-lang.org/src/core/str/mod.rs.html#672)1.4.0 · #### pub fn split\_at(&self, mid: usize) -> (&str, &str)
Divide one string slice into two at an index.
The argument, `mid`, should be a byte offset from the start of the string. It must also be on the boundary of a UTF-8 code point.
The two slices returned go from the start of the string slice to `mid`, and from `mid` to the end of the string slice.
To get mutable string slices instead, see the [`split_at_mut`](primitive.str#method.split_at_mut) method.
##### Panics
Panics if `mid` is not on a UTF-8 code point boundary, or if it is past the end of the last code point of the string slice.
##### Examples
Basic usage:
```
let s = "Per Martin-Löf";
let (first, last) = s.split_at(3);
assert_eq!("Per", first);
assert_eq!(" Martin-Löf", last);
```
[source](https://doc.rust-lang.org/src/core/str/mod.rs.html#716)1.4.0 · #### pub fn split\_at\_mut(&mut self, mid: usize) -> (&mut str, &mut str)
Divide one mutable string slice into two at an index.
The argument, `mid`, should be a byte offset from the start of the string. It must also be on the boundary of a UTF-8 code point.
The two slices returned go from the start of the string slice to `mid`, and from `mid` to the end of the string slice.
To get immutable string slices instead, see the [`split_at`](primitive.str#method.split_at) method.
##### Panics
Panics if `mid` is not on a UTF-8 code point boundary, or if it is past the end of the last code point of the string slice.
##### Examples
Basic usage:
```
let mut s = "Per Martin-Löf".to_string();
{
let (first, last) = s.split_at_mut(3);
first.make_ascii_uppercase();
assert_eq!("PER", first);
assert_eq!(" Martin-Löf", last);
}
assert_eq!("PER Martin-Löf", s);
```
[source](https://doc.rust-lang.org/src/core/str/mod.rs.html#782)#### pub fn chars(&self) -> Chars<'\_>
Notable traits for [Chars](str/struct.chars "struct std::str::Chars")<'a>
```
impl<'a> Iterator for Chars<'a>
type Item = char;
```
Returns an iterator over the [`char`](primitive.char)s of a string slice.
As a string slice consists of valid UTF-8, we can iterate through a string slice by [`char`](primitive.char). This method returns such an iterator.
It’s important to remember that [`char`](primitive.char) represents a Unicode Scalar Value, and might not match your idea of what a ‘character’ is. Iteration over grapheme clusters may be what you actually want. This functionality is not provided by Rust’s standard library, check crates.io instead.
##### Examples
Basic usage:
```
let word = "goodbye";
let count = word.chars().count();
assert_eq!(7, count);
let mut chars = word.chars();
assert_eq!(Some('g'), chars.next());
assert_eq!(Some('o'), chars.next());
assert_eq!(Some('o'), chars.next());
assert_eq!(Some('d'), chars.next());
assert_eq!(Some('b'), chars.next());
assert_eq!(Some('y'), chars.next());
assert_eq!(Some('e'), chars.next());
assert_eq!(None, chars.next());
```
Remember, [`char`](primitive.char)s might not match your intuition about characters:
```
let y = "y̆";
let mut chars = y.chars();
assert_eq!(Some('y'), chars.next()); // not 'y̆'
assert_eq!(Some('\u{0306}'), chars.next());
assert_eq!(None, chars.next());
```
[source](https://doc.rust-lang.org/src/core/str/mod.rs.html#839)#### pub fn char\_indices(&self) -> CharIndices<'\_>
Notable traits for [CharIndices](str/struct.charindices "struct std::str::CharIndices")<'a>
```
impl<'a> Iterator for CharIndices<'a>
type Item = (usize, char);
```
Returns an iterator over the [`char`](primitive.char)s of a string slice, and their positions.
As a string slice consists of valid UTF-8, we can iterate through a string slice by [`char`](primitive.char). This method returns an iterator of both these [`char`](primitive.char)s, as well as their byte positions.
The iterator yields tuples. The position is first, the [`char`](primitive.char) is second.
##### Examples
Basic usage:
```
let word = "goodbye";
let count = word.char_indices().count();
assert_eq!(7, count);
let mut char_indices = word.char_indices();
assert_eq!(Some((0, 'g')), char_indices.next());
assert_eq!(Some((1, 'o')), char_indices.next());
assert_eq!(Some((2, 'o')), char_indices.next());
assert_eq!(Some((3, 'd')), char_indices.next());
assert_eq!(Some((4, 'b')), char_indices.next());
assert_eq!(Some((5, 'y')), char_indices.next());
assert_eq!(Some((6, 'e')), char_indices.next());
assert_eq!(None, char_indices.next());
```
Remember, [`char`](primitive.char)s might not match your intuition about characters:
```
let yes = "y̆es";
let mut char_indices = yes.char_indices();
assert_eq!(Some((0, 'y')), char_indices.next()); // not (0, 'y̆')
assert_eq!(Some((1, '\u{0306}')), char_indices.next());
// note the 3 here - the last character took up two bytes
assert_eq!(Some((3, 'e')), char_indices.next());
assert_eq!(Some((4, 's')), char_indices.next());
assert_eq!(None, char_indices.next());
```
[source](https://doc.rust-lang.org/src/core/str/mod.rs.html#864)#### pub fn bytes(&self) -> Bytes<'\_>
Notable traits for [Bytes](str/struct.bytes "struct std::str::Bytes")<'\_>
```
impl Iterator for Bytes<'_>
type Item = u8;
```
An iterator over the bytes of a string slice.
As a string slice consists of a sequence of bytes, we can iterate through a string slice by byte. This method returns such an iterator.
##### Examples
Basic usage:
```
let mut bytes = "bors".bytes();
assert_eq!(Some(b'b'), bytes.next());
assert_eq!(Some(b'o'), bytes.next());
assert_eq!(Some(b'r'), bytes.next());
assert_eq!(Some(b's'), bytes.next());
assert_eq!(None, bytes.next());
```
[source](https://doc.rust-lang.org/src/core/str/mod.rs.html#910)1.1.0 · #### pub fn split\_whitespace(&self) -> SplitWhitespace<'\_>
Notable traits for [SplitWhitespace](str/struct.splitwhitespace "struct std::str::SplitWhitespace")<'a>
```
impl<'a> Iterator for SplitWhitespace<'a>
type Item = &'a str;
```
Splits a string slice by whitespace.
The iterator returned will return string slices that are sub-slices of the original string slice, separated by any amount of whitespace.
‘Whitespace’ is defined according to the terms of the Unicode Derived Core Property `White_Space`. If you only want to split on ASCII whitespace instead, use [`split_ascii_whitespace`](primitive.str#method.split_ascii_whitespace).
##### Examples
Basic usage:
```
let mut iter = "A few words".split_whitespace();
assert_eq!(Some("A"), iter.next());
assert_eq!(Some("few"), iter.next());
assert_eq!(Some("words"), iter.next());
assert_eq!(None, iter.next());
```
All kinds of whitespace are considered:
```
let mut iter = " Mary had\ta\u{2009}little \n\t lamb".split_whitespace();
assert_eq!(Some("Mary"), iter.next());
assert_eq!(Some("had"), iter.next());
assert_eq!(Some("a"), iter.next());
assert_eq!(Some("little"), iter.next());
assert_eq!(Some("lamb"), iter.next());
assert_eq!(None, iter.next());
```
[source](https://doc.rust-lang.org/src/core/str/mod.rs.html#953)1.34.0 · #### pub fn split\_ascii\_whitespace(&self) -> SplitAsciiWhitespace<'\_>
Notable traits for [SplitAsciiWhitespace](str/struct.splitasciiwhitespace "struct std::str::SplitAsciiWhitespace")<'a>
```
impl<'a> Iterator for SplitAsciiWhitespace<'a>
type Item = &'a str;
```
Splits a string slice by ASCII whitespace.
The iterator returned will return string slices that are sub-slices of the original string slice, separated by any amount of ASCII whitespace.
To split by Unicode `Whitespace` instead, use [`split_whitespace`](primitive.str#method.split_whitespace).
##### Examples
Basic usage:
```
let mut iter = "A few words".split_ascii_whitespace();
assert_eq!(Some("A"), iter.next());
assert_eq!(Some("few"), iter.next());
assert_eq!(Some("words"), iter.next());
assert_eq!(None, iter.next());
```
All kinds of ASCII whitespace are considered:
```
let mut iter = " Mary had\ta little \n\t lamb".split_ascii_whitespace();
assert_eq!(Some("Mary"), iter.next());
assert_eq!(Some("had"), iter.next());
assert_eq!(Some("a"), iter.next());
assert_eq!(Some("little"), iter.next());
assert_eq!(Some("lamb"), iter.next());
assert_eq!(None, iter.next());
```
[source](https://doc.rust-lang.org/src/core/str/mod.rs.html#999)#### pub fn lines(&self) -> Lines<'\_>
Notable traits for [Lines](str/struct.lines "struct std::str::Lines")<'a>
```
impl<'a> Iterator for Lines<'a>
type Item = &'a str;
```
An iterator over the lines of a string, as string slices.
Lines are ended with either a newline (`\n`) or a carriage return with a line feed (`\r\n`).
The final line ending is optional. A string that ends with a final line ending will return the same lines as an otherwise identical string without a final line ending.
##### Examples
Basic usage:
```
let text = "foo\r\nbar\n\nbaz\n";
let mut lines = text.lines();
assert_eq!(Some("foo"), lines.next());
assert_eq!(Some("bar"), lines.next());
assert_eq!(Some(""), lines.next());
assert_eq!(Some("baz"), lines.next());
assert_eq!(None, lines.next());
```
The final line ending isn’t required:
```
let text = "foo\nbar\n\r\nbaz";
let mut lines = text.lines();
assert_eq!(Some("foo"), lines.next());
assert_eq!(Some("bar"), lines.next());
assert_eq!(Some(""), lines.next());
assert_eq!(Some("baz"), lines.next());
assert_eq!(None, lines.next());
```
[source](https://doc.rust-lang.org/src/core/str/mod.rs.html#1008)#### pub fn lines\_any(&self) -> LinesAny<'\_>
Notable traits for [LinesAny](str/struct.linesany "struct std::str::LinesAny")<'a>
```
impl<'a> Iterator for LinesAny<'a>
type Item = &'a str;
```
👎Deprecated since 1.4.0: use lines() instead now
An iterator over the lines of a string.
[source](https://doc.rust-lang.org/src/core/str/mod.rs.html#1029)1.8.0 · #### pub fn encode\_utf16(&self) -> EncodeUtf16<'\_>
Notable traits for [EncodeUtf16](str/struct.encodeutf16 "struct std::str::EncodeUtf16")<'a>
```
impl<'a> Iterator for EncodeUtf16<'a>
type Item = u16;
```
Returns an iterator of `u16` over the string encoded as UTF-16.
##### Examples
Basic usage:
```
let text = "Zażółć gęślą jaźń";
let utf8_len = text.len();
let utf16_len = text.encode_utf16().count();
assert!(utf16_len <= utf8_len);
```
[source](https://doc.rust-lang.org/src/core/str/mod.rs.html#1056)#### pub fn contains<'a, P>(&'a self, pat: P) -> boolwhere P: [Pattern](str/pattern/trait.pattern "trait std::str::pattern::Pattern")<'a>,
Returns `true` if the given pattern matches a sub-slice of this string slice.
Returns `false` if it does not.
The [pattern](str/pattern/index) can be a `&str`, [`char`](primitive.char), a slice of [`char`](primitive.char)s, or a function or closure that determines if a character matches.
##### Examples
Basic usage:
```
let bananas = "bananas";
assert!(bananas.contains("nana"));
assert!(!bananas.contains("apples"));
```
[source](https://doc.rust-lang.org/src/core/str/mod.rs.html#1082)#### pub fn starts\_with<'a, P>(&'a self, pat: P) -> boolwhere P: [Pattern](str/pattern/trait.pattern "trait std::str::pattern::Pattern")<'a>,
Returns `true` if the given pattern matches a prefix of this string slice.
Returns `false` if it does not.
The [pattern](str/pattern/index) can be a `&str`, [`char`](primitive.char), a slice of [`char`](primitive.char)s, or a function or closure that determines if a character matches.
##### Examples
Basic usage:
```
let bananas = "bananas";
assert!(bananas.starts_with("bana"));
assert!(!bananas.starts_with("nana"));
```
[source](https://doc.rust-lang.org/src/core/str/mod.rs.html#1108-1110)#### pub fn ends\_with<'a, P>(&'a self, pat: P) -> boolwhere 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"): [ReverseSearcher](str/pattern/trait.reversesearcher "trait std::str::pattern::ReverseSearcher")<'a>,
Returns `true` if the given pattern matches a suffix of this string slice.
Returns `false` if it does not.
The [pattern](str/pattern/index) can be a `&str`, [`char`](primitive.char), a slice of [`char`](primitive.char)s, or a function or closure that determines if a character matches.
##### Examples
Basic usage:
```
let bananas = "bananas";
assert!(bananas.ends_with("anas"));
assert!(!bananas.ends_with("nana"));
```
[source](https://doc.rust-lang.org/src/core/str/mod.rs.html#1159)#### pub fn find<'a, P>(&'a self, pat: P) -> Option<usize>where P: [Pattern](str/pattern/trait.pattern "trait std::str::pattern::Pattern")<'a>,
Returns the byte index of the first character of this string slice that matches the pattern.
Returns [`None`](option/enum.option#variant.None "None") if the pattern doesn’t match.
The [pattern](str/pattern/index) can be a `&str`, [`char`](primitive.char), a slice of [`char`](primitive.char)s, or a function or closure that determines if a character matches.
##### Examples
Simple patterns:
```
let s = "Löwe 老虎 Léopard Gepardi";
assert_eq!(s.find('L'), Some(0));
assert_eq!(s.find('é'), Some(14));
assert_eq!(s.find("pard"), Some(17));
```
More complex patterns using point-free style and closures:
```
let s = "Löwe 老虎 Léopard";
assert_eq!(s.find(char::is_whitespace), Some(5));
assert_eq!(s.find(char::is_lowercase), Some(1));
assert_eq!(s.find(|c: char| c.is_whitespace() || c.is_lowercase()), Some(1));
assert_eq!(s.find(|c: char| (c < 'o') && (c > 'a')), Some(4));
```
Not finding the pattern:
```
let s = "Löwe 老虎 Léopard";
let x: &[_] = &['1', '2'];
assert_eq!(s.find(x), None);
```
[source](https://doc.rust-lang.org/src/core/str/mod.rs.html#1205-1207)#### pub fn rfind<'a, P>(&'a self, pat: P) -> Option<usize>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"): [ReverseSearcher](str/pattern/trait.reversesearcher "trait std::str::pattern::ReverseSearcher")<'a>,
Returns the byte index for the first character of the last match of the pattern in this string slice.
Returns [`None`](option/enum.option#variant.None "None") if the pattern doesn’t match.
The [pattern](str/pattern/index) can be a `&str`, [`char`](primitive.char), a slice of [`char`](primitive.char)s, or a function or closure that determines if a character matches.
##### Examples
Simple patterns:
```
let s = "Löwe 老虎 Léopard Gepardi";
assert_eq!(s.rfind('L'), Some(13));
assert_eq!(s.rfind('é'), Some(14));
assert_eq!(s.rfind("pard"), Some(24));
```
More complex patterns with closures:
```
let s = "Löwe 老虎 Léopard";
assert_eq!(s.rfind(char::is_whitespace), Some(12));
assert_eq!(s.rfind(char::is_lowercase), Some(20));
```
Not finding the pattern:
```
let s = "Löwe 老虎 Léopard";
let x: &[_] = &['1', '2'];
assert_eq!(s.rfind(x), None);
```
[source](https://doc.rust-lang.org/src/core/str/mod.rs.html#1327)#### pub fn split<'a, P>(&'a self, pat: P) -> Split<'a, P>where P: [Pattern](str/pattern/trait.pattern "trait std::str::pattern::Pattern")<'a>,
Notable traits for [Split](str/struct.split "struct std::str::Split")<'a, P>
```
impl<'a, P> Iterator for Split<'a, P>where
P: Pattern<'a>,
type Item = &'a str;
```
An iterator over substrings of this string slice, separated by characters matched by a pattern.
The [pattern](str/pattern/index) can be a `&str`, [`char`](primitive.char), a slice of [`char`](primitive.char)s, or a function or closure that determines if a character matches.
##### Iterator behavior
The returned iterator will be a [`DoubleEndedIterator`](iter/trait.doubleendediterator "DoubleEndedIterator") if the pattern allows a reverse search and forward/reverse search yields the same elements. This is true for, e.g., [`char`](primitive.char), but not for `&str`.
If the pattern allows a reverse search but its results might differ from a forward search, the [`rsplit`](primitive.str#method.rsplit) method can be used.
##### Examples
Simple patterns:
```
let v: Vec<&str> = "Mary had a little lamb".split(' ').collect();
assert_eq!(v, ["Mary", "had", "a", "little", "lamb"]);
let v: Vec<&str> = "".split('X').collect();
assert_eq!(v, [""]);
let v: Vec<&str> = "lionXXtigerXleopard".split('X').collect();
assert_eq!(v, ["lion", "", "tiger", "leopard"]);
let v: Vec<&str> = "lion::tiger::leopard".split("::").collect();
assert_eq!(v, ["lion", "tiger", "leopard"]);
let v: Vec<&str> = "abc1def2ghi".split(char::is_numeric).collect();
assert_eq!(v, ["abc", "def", "ghi"]);
let v: Vec<&str> = "lionXtigerXleopard".split(char::is_uppercase).collect();
assert_eq!(v, ["lion", "tiger", "leopard"]);
```
If the pattern is a slice of chars, split on each occurrence of any of the characters:
```
let v: Vec<&str> = "2020-11-03 23:59".split(&['-', ' ', ':', '@'][..]).collect();
assert_eq!(v, ["2020", "11", "03", "23", "59"]);
```
A more complex pattern, using a closure:
```
let v: Vec<&str> = "abc1defXghi".split(|c| c == '1' || c == 'X').collect();
assert_eq!(v, ["abc", "def", "ghi"]);
```
If a string contains multiple contiguous separators, you will end up with empty strings in the output:
```
let x = "||||a||b|c".to_string();
let d: Vec<_> = x.split('|').collect();
assert_eq!(d, &["", "", "", "", "a", "", "b", "c"]);
```
Contiguous separators are separated by the empty string.
```
let x = "(///)".to_string();
let d: Vec<_> = x.split('/').collect();
assert_eq!(d, &["(", "", "", ")"]);
```
Separators at the start or end of a string are neighbored by empty strings.
```
let d: Vec<_> = "010".split("0").collect();
assert_eq!(d, &["", "1", ""]);
```
When the empty string is used as a separator, it separates every character in the string, along with the beginning and end of the string.
```
let f: Vec<_> = "rust".split("").collect();
assert_eq!(f, &["", "r", "u", "s", "t", ""]);
```
Contiguous separators can lead to possibly surprising behavior when whitespace is used as the separator. This code is correct:
```
let x = " a b c".to_string();
let d: Vec<_> = x.split(' ').collect();
assert_eq!(d, &["", "", "", "", "a", "", "b", "c"]);
```
It does *not* give you:
ⓘ
```
assert_eq!(d, &["a", "b", "c"]);
```
Use [`split_whitespace`](primitive.str#method.split_whitespace) for this behavior.
[source](https://doc.rust-lang.org/src/core/str/mod.rs.html#1367)1.51.0 · #### pub fn split\_inclusive<'a, P>(&'a self, pat: P) -> SplitInclusive<'a, P>where P: [Pattern](str/pattern/trait.pattern "trait std::str::pattern::Pattern")<'a>,
Notable traits for [SplitInclusive](str/struct.splitinclusive "struct std::str::SplitInclusive")<'a, P>
```
impl<'a, P> Iterator for SplitInclusive<'a, P>where
P: Pattern<'a>,
type Item = &'a str;
```
An iterator over substrings of this string slice, separated by characters matched by a pattern. Differs from the iterator produced by `split` in that `split_inclusive` leaves the matched part as the terminator of the substring.
The [pattern](str/pattern/index) can be a `&str`, [`char`](primitive.char), a slice of [`char`](primitive.char)s, or a function or closure that determines if a character matches.
##### Examples
```
let v: Vec<&str> = "Mary had a little lamb\nlittle lamb\nlittle lamb."
.split_inclusive('\n').collect();
assert_eq!(v, ["Mary had a little lamb\n", "little lamb\n", "little lamb."]);
```
If the last element of the string is matched, that element will be considered the terminator of the preceding substring. That substring will be the last item returned by the iterator.
```
let v: Vec<&str> = "Mary had a little lamb\nlittle lamb\nlittle lamb.\n"
.split_inclusive('\n').collect();
assert_eq!(v, ["Mary had a little lamb\n", "little lamb\n", "little lamb.\n"]);
```
[source](https://doc.rust-lang.org/src/core/str/mod.rs.html#1422-1424)#### pub fn rsplit<'a, P>(&'a self, pat: P) -> 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"): [ReverseSearcher](str/pattern/trait.reversesearcher "trait std::str::pattern::ReverseSearcher")<'a>,
Notable traits for [RSplit](str/struct.rsplit "struct std::str::RSplit")<'a, P>
```
impl<'a, P> Iterator for RSplit<'a, P>where
P: Pattern<'a>,
<P as Pattern<'a>>::Searcher: ReverseSearcher<'a>,
type Item = &'a str;
```
An iterator over substrings of the given string slice, separated by characters matched by a pattern and yielded in reverse order.
The [pattern](str/pattern/index) can be a `&str`, [`char`](primitive.char), a slice of [`char`](primitive.char)s, or a function or closure that determines if a character matches.
##### Iterator behavior
The returned iterator requires that the pattern supports a reverse search, and it will be a [`DoubleEndedIterator`](iter/trait.doubleendediterator "DoubleEndedIterator") if a forward/reverse search yields the same elements.
For iterating from the front, the [`split`](primitive.str#method.split) method can be used.
##### Examples
Simple patterns:
```
let v: Vec<&str> = "Mary had a little lamb".rsplit(' ').collect();
assert_eq!(v, ["lamb", "little", "a", "had", "Mary"]);
let v: Vec<&str> = "".rsplit('X').collect();
assert_eq!(v, [""]);
let v: Vec<&str> = "lionXXtigerXleopard".rsplit('X').collect();
assert_eq!(v, ["leopard", "tiger", "", "lion"]);
let v: Vec<&str> = "lion::tiger::leopard".rsplit("::").collect();
assert_eq!(v, ["leopard", "tiger", "lion"]);
```
A more complex pattern, using a closure:
```
let v: Vec<&str> = "abc1defXghi".rsplit(|c| c == '1' || c == 'X').collect();
assert_eq!(v, ["ghi", "def", "abc"]);
```
[source](https://doc.rust-lang.org/src/core/str/mod.rs.html#1473)#### pub fn split\_terminator<'a, P>(&'a self, pat: P) -> SplitTerminator<'a, P>where P: [Pattern](str/pattern/trait.pattern "trait std::str::pattern::Pattern")<'a>,
Notable traits for [SplitTerminator](str/struct.splitterminator "struct std::str::SplitTerminator")<'a, P>
```
impl<'a, P> Iterator for SplitTerminator<'a, P>where
P: Pattern<'a>,
type Item = &'a str;
```
An iterator over substrings of the given string slice, separated by characters matched by a pattern.
The [pattern](str/pattern/index) can be a `&str`, [`char`](primitive.char), a slice of [`char`](primitive.char)s, or a function or closure that determines if a character matches.
Equivalent to [`split`](primitive.str#method.split), except that the trailing substring is skipped if empty.
This method can be used for string data that is *terminated*, rather than *separated* by a pattern.
##### Iterator behavior
The returned iterator will be a [`DoubleEndedIterator`](iter/trait.doubleendediterator "DoubleEndedIterator") if the pattern allows a reverse search and forward/reverse search yields the same elements. This is true for, e.g., [`char`](primitive.char), but not for `&str`.
If the pattern allows a reverse search but its results might differ from a forward search, the [`rsplit_terminator`](primitive.str#method.rsplit_terminator) method can be used.
##### Examples
Basic usage:
```
let v: Vec<&str> = "A.B.".split_terminator('.').collect();
assert_eq!(v, ["A", "B"]);
let v: Vec<&str> = "A..B..".split_terminator(".").collect();
assert_eq!(v, ["A", "", "B", ""]);
let v: Vec<&str> = "A.B:C.D".split_terminator(&['.', ':'][..]).collect();
assert_eq!(v, ["A", "B", "C", "D"]);
```
[source](https://doc.rust-lang.org/src/core/str/mod.rs.html#1519-1521)#### pub fn rsplit\_terminator<'a, P>(&'a self, pat: P) -> 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"): [ReverseSearcher](str/pattern/trait.reversesearcher "trait std::str::pattern::ReverseSearcher")<'a>,
Notable traits for [RSplitTerminator](str/struct.rsplitterminator "struct std::str::RSplitTerminator")<'a, P>
```
impl<'a, P> Iterator for RSplitTerminator<'a, P>where
P: Pattern<'a>,
<P as Pattern<'a>>::Searcher: ReverseSearcher<'a>,
type Item = &'a str;
```
An iterator over substrings of `self`, separated by characters matched by a pattern and yielded in reverse order.
The [pattern](str/pattern/index) can be a `&str`, [`char`](primitive.char), a slice of [`char`](primitive.char)s, or a function or closure that determines if a character matches.
Equivalent to [`split`](primitive.str#method.split), except that the trailing substring is skipped if empty.
This method can be used for string data that is *terminated*, rather than *separated* by a pattern.
##### Iterator behavior
The returned iterator requires that the pattern supports a reverse search, and it will be double ended if a forward/reverse search yields the same elements.
For iterating from the front, the [`split_terminator`](primitive.str#method.split_terminator) method can be used.
##### Examples
```
let v: Vec<&str> = "A.B.".rsplit_terminator('.').collect();
assert_eq!(v, ["B", "A"]);
let v: Vec<&str> = "A..B..".rsplit_terminator(".").collect();
assert_eq!(v, ["", "B", "", "A"]);
let v: Vec<&str> = "A.B:C.D".rsplit_terminator(&['.', ':'][..]).collect();
assert_eq!(v, ["D", "C", "B", "A"]);
```
[source](https://doc.rust-lang.org/src/core/str/mod.rs.html#1574)#### pub fn splitn<'a, P>(&'a self, n: usize, pat: P) -> SplitN<'a, P>where P: [Pattern](str/pattern/trait.pattern "trait std::str::pattern::Pattern")<'a>,
Notable traits for [SplitN](str/struct.splitn "struct std::str::SplitN")<'a, P>
```
impl<'a, P> Iterator for SplitN<'a, P>where
P: Pattern<'a>,
type Item = &'a str;
```
An iterator over substrings of the given string slice, separated by a pattern, restricted to returning at most `n` items.
If `n` substrings are returned, the last substring (the `n`th substring) will contain the remainder of the string.
The [pattern](str/pattern/index) can be a `&str`, [`char`](primitive.char), a slice of [`char`](primitive.char)s, or a function or closure that determines if a character matches.
##### Iterator behavior
The returned iterator will not be double ended, because it is not efficient to support.
If the pattern allows a reverse search, the [`rsplitn`](primitive.str#method.rsplitn) method can be used.
##### Examples
Simple patterns:
```
let v: Vec<&str> = "Mary had a little lambda".splitn(3, ' ').collect();
assert_eq!(v, ["Mary", "had", "a little lambda"]);
let v: Vec<&str> = "lionXXtigerXleopard".splitn(3, "X").collect();
assert_eq!(v, ["lion", "", "tigerXleopard"]);
let v: Vec<&str> = "abcXdef".splitn(1, 'X').collect();
assert_eq!(v, ["abcXdef"]);
let v: Vec<&str> = "".splitn(1, 'X').collect();
assert_eq!(v, [""]);
```
A more complex pattern, using a closure:
```
let v: Vec<&str> = "abc1defXghi".splitn(2, |c| c == '1' || c == 'X').collect();
assert_eq!(v, ["abc", "defXghi"]);
```
[source](https://doc.rust-lang.org/src/core/str/mod.rs.html#1623-1625)#### pub fn rsplitn<'a, P>(&'a self, n: usize, pat: P) -> 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"): [ReverseSearcher](str/pattern/trait.reversesearcher "trait std::str::pattern::ReverseSearcher")<'a>,
Notable traits for [RSplitN](str/struct.rsplitn "struct std::str::RSplitN")<'a, P>
```
impl<'a, P> Iterator for RSplitN<'a, P>where
P: Pattern<'a>,
<P as Pattern<'a>>::Searcher: ReverseSearcher<'a>,
type Item = &'a str;
```
An iterator over substrings of this string slice, separated by a pattern, starting from the end of the string, restricted to returning at most `n` items.
If `n` substrings are returned, the last substring (the `n`th substring) will contain the remainder of the string.
The [pattern](str/pattern/index) can be a `&str`, [`char`](primitive.char), a slice of [`char`](primitive.char)s, or a function or closure that determines if a character matches.
##### Iterator behavior
The returned iterator will not be double ended, because it is not efficient to support.
For splitting from the front, the [`splitn`](primitive.str#method.splitn) method can be used.
##### Examples
Simple patterns:
```
let v: Vec<&str> = "Mary had a little lamb".rsplitn(3, ' ').collect();
assert_eq!(v, ["lamb", "little", "Mary had a"]);
let v: Vec<&str> = "lionXXtigerXleopard".rsplitn(3, 'X').collect();
assert_eq!(v, ["leopard", "tiger", "lionX"]);
let v: Vec<&str> = "lion::tiger::leopard".rsplitn(2, "::").collect();
assert_eq!(v, ["leopard", "lion::tiger"]);
```
A more complex pattern, using a closure:
```
let v: Vec<&str> = "abc1defXghi".rsplitn(2, |c| c == '1' || c == 'X').collect();
assert_eq!(v, ["ghi", "abc1def"]);
```
[source](https://doc.rust-lang.org/src/core/str/mod.rs.html#1643)1.52.0 · #### pub fn split\_once<'a, P>(&'a self, delimiter: P) -> Option<(&'a str, &'a str)>where P: [Pattern](str/pattern/trait.pattern "trait std::str::pattern::Pattern")<'a>,
Splits the string on the first occurrence of the specified delimiter and returns prefix before delimiter and suffix after delimiter.
##### Examples
```
assert_eq!("cfg".split_once('='), None);
assert_eq!("cfg=".split_once('='), Some(("cfg", "")));
assert_eq!("cfg=foo".split_once('='), Some(("cfg", "foo")));
assert_eq!("cfg=foo=bar".split_once('='), Some(("cfg", "foo=bar")));
```
[source](https://doc.rust-lang.org/src/core/str/mod.rs.html#1661-1663)1.52.0 · #### pub fn rsplit\_once<'a, P>(&'a self, delimiter: P) -> Option<(&'a str, &'a str)>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"): [ReverseSearcher](str/pattern/trait.reversesearcher "trait std::str::pattern::ReverseSearcher")<'a>,
Splits the string on the last occurrence of the specified delimiter and returns prefix before delimiter and suffix after delimiter.
##### Examples
```
assert_eq!("cfg".rsplit_once('='), None);
assert_eq!("cfg=foo".rsplit_once('='), Some(("cfg", "foo")));
assert_eq!("cfg=foo=bar".rsplit_once('='), Some(("cfg=foo", "bar")));
```
[source](https://doc.rust-lang.org/src/core/str/mod.rs.html#1703)1.2.0 · #### pub fn matches<'a, P>(&'a self, pat: P) -> Matches<'a, P>where P: [Pattern](str/pattern/trait.pattern "trait std::str::pattern::Pattern")<'a>,
Notable traits for [Matches](str/struct.matches "struct std::str::Matches")<'a, P>
```
impl<'a, P> Iterator for Matches<'a, P>where
P: Pattern<'a>,
type Item = &'a str;
```
An iterator over the disjoint matches of a pattern within the given string slice.
The [pattern](str/pattern/index) can be a `&str`, [`char`](primitive.char), a slice of [`char`](primitive.char)s, or a function or closure that determines if a character matches.
##### Iterator behavior
The returned iterator will be a [`DoubleEndedIterator`](iter/trait.doubleendediterator "DoubleEndedIterator") if the pattern allows a reverse search and forward/reverse search yields the same elements. This is true for, e.g., [`char`](primitive.char), but not for `&str`.
If the pattern allows a reverse search but its results might differ from a forward search, the [`rmatches`](primitive.str#method.matches) method can be used.
##### Examples
Basic usage:
```
let v: Vec<&str> = "abcXXXabcYYYabc".matches("abc").collect();
assert_eq!(v, ["abc", "abc", "abc"]);
let v: Vec<&str> = "1abc2abc3".matches(char::is_numeric).collect();
assert_eq!(v, ["1", "2", "3"]);
```
[source](https://doc.rust-lang.org/src/core/str/mod.rs.html#1739-1741)1.2.0 · #### pub fn rmatches<'a, P>(&'a self, pat: P) -> 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"): [ReverseSearcher](str/pattern/trait.reversesearcher "trait std::str::pattern::ReverseSearcher")<'a>,
Notable traits for [RMatches](str/struct.rmatches "struct std::str::RMatches")<'a, P>
```
impl<'a, P> Iterator for RMatches<'a, P>where
P: Pattern<'a>,
<P as Pattern<'a>>::Searcher: ReverseSearcher<'a>,
type Item = &'a str;
```
An iterator over the disjoint matches of a pattern within this string slice, yielded in reverse order.
The [pattern](str/pattern/index) can be a `&str`, [`char`](primitive.char), a slice of [`char`](primitive.char)s, or a function or closure that determines if a character matches.
##### Iterator behavior
The returned iterator requires that the pattern supports a reverse search, and it will be a [`DoubleEndedIterator`](iter/trait.doubleendediterator "DoubleEndedIterator") if a forward/reverse search yields the same elements.
For iterating from the front, the [`matches`](primitive.str#method.matches) method can be used.
##### Examples
Basic usage:
```
let v: Vec<&str> = "abcXXXabcYYYabc".rmatches("abc").collect();
assert_eq!(v, ["abc", "abc", "abc"]);
let v: Vec<&str> = "1abc2abc3".rmatches(char::is_numeric).collect();
assert_eq!(v, ["3", "2", "1"]);
```
[source](https://doc.rust-lang.org/src/core/str/mod.rs.html#1785)1.5.0 · #### pub fn match\_indices<'a, P>(&'a self, pat: P) -> MatchIndices<'a, P>where P: [Pattern](str/pattern/trait.pattern "trait std::str::pattern::Pattern")<'a>,
Notable traits for [MatchIndices](str/struct.matchindices "struct std::str::MatchIndices")<'a, P>
```
impl<'a, P> Iterator for MatchIndices<'a, P>where
P: Pattern<'a>,
type Item = (usize, &'a str);
```
An iterator over the disjoint matches of a pattern within this string slice as well as the index that the match starts at.
For matches of `pat` within `self` that overlap, only the indices corresponding to the first match are returned.
The [pattern](str/pattern/index) can be a `&str`, [`char`](primitive.char), a slice of [`char`](primitive.char)s, or a function or closure that determines if a character matches.
##### Iterator behavior
The returned iterator will be a [`DoubleEndedIterator`](iter/trait.doubleendediterator "DoubleEndedIterator") if the pattern allows a reverse search and forward/reverse search yields the same elements. This is true for, e.g., [`char`](primitive.char), but not for `&str`.
If the pattern allows a reverse search but its results might differ from a forward search, the [`rmatch_indices`](primitive.str#method.rmatch_indices) method can be used.
##### Examples
Basic usage:
```
let v: Vec<_> = "abcXXXabcYYYabc".match_indices("abc").collect();
assert_eq!(v, [(0, "abc"), (6, "abc"), (12, "abc")]);
let v: Vec<_> = "1abcabc2".match_indices("abc").collect();
assert_eq!(v, [(1, "abc"), (4, "abc")]);
let v: Vec<_> = "ababa".match_indices("aba").collect();
assert_eq!(v, [(0, "aba")]); // only the first `aba`
```
[source](https://doc.rust-lang.org/src/core/str/mod.rs.html#1827-1829)1.5.0 · #### pub fn rmatch\_indices<'a, P>(&'a self, pat: P) -> 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"): [ReverseSearcher](str/pattern/trait.reversesearcher "trait std::str::pattern::ReverseSearcher")<'a>,
Notable traits for [RMatchIndices](str/struct.rmatchindices "struct std::str::RMatchIndices")<'a, P>
```
impl<'a, P> Iterator for RMatchIndices<'a, P>where
P: Pattern<'a>,
<P as Pattern<'a>>::Searcher: ReverseSearcher<'a>,
type Item = (usize, &'a str);
```
An iterator over the disjoint matches of a pattern within `self`, yielded in reverse order along with the index of the match.
For matches of `pat` within `self` that overlap, only the indices corresponding to the last match are returned.
The [pattern](str/pattern/index) can be a `&str`, [`char`](primitive.char), a slice of [`char`](primitive.char)s, or a function or closure that determines if a character matches.
##### Iterator behavior
The returned iterator requires that the pattern supports a reverse search, and it will be a [`DoubleEndedIterator`](iter/trait.doubleendediterator "DoubleEndedIterator") if a forward/reverse search yields the same elements.
For iterating from the front, the [`match_indices`](primitive.str#method.match_indices) method can be used.
##### Examples
Basic usage:
```
let v: Vec<_> = "abcXXXabcYYYabc".rmatch_indices("abc").collect();
assert_eq!(v, [(12, "abc"), (6, "abc"), (0, "abc")]);
let v: Vec<_> = "1abcabc2".rmatch_indices("abc").collect();
assert_eq!(v, [(4, "abc"), (1, "abc")]);
let v: Vec<_> = "ababa".rmatch_indices("aba").collect();
assert_eq!(v, [(2, "aba")]); // only the last `aba`
```
[source](https://doc.rust-lang.org/src/core/str/mod.rs.html#1853)#### pub fn trim(&self) -> &str
Returns a string slice with leading and trailing whitespace removed.
‘Whitespace’ is defined according to the terms of the Unicode Derived Core Property `White_Space`, which includes newlines.
##### Examples
Basic usage:
```
let s = "\n Hello\tworld\t\n";
assert_eq!("Hello\tworld", s.trim());
```
[source](https://doc.rust-lang.org/src/core/str/mod.rs.html#1892)1.30.0 · #### pub fn trim\_start(&self) -> &str
Returns a string slice with leading whitespace removed.
‘Whitespace’ is defined according to the terms of the Unicode Derived Core Property `White_Space`, which includes newlines.
##### Text directionality
A string is a sequence of bytes. `start` in this context means the first position of that byte string; for a left-to-right language like English or Russian, this will be left side, and for right-to-left languages like Arabic or Hebrew, this will be the right side.
##### Examples
Basic usage:
```
let s = "\n Hello\tworld\t\n";
assert_eq!("Hello\tworld\t\n", s.trim_start());
```
Directionality:
```
let s = " English ";
assert!(Some('E') == s.trim_start().chars().next());
let s = " עברית ";
assert!(Some('ע') == s.trim_start().chars().next());
```
[source](https://doc.rust-lang.org/src/core/str/mod.rs.html#1931)1.30.0 · #### pub fn trim\_end(&self) -> &str
Returns a string slice with trailing whitespace removed.
‘Whitespace’ is defined according to the terms of the Unicode Derived Core Property `White_Space`, which includes newlines.
##### Text directionality
A string is a sequence of bytes. `end` in this context means the last position of that byte string; for a left-to-right language like English or Russian, this will be right side, and for right-to-left languages like Arabic or Hebrew, this will be the left side.
##### Examples
Basic usage:
```
let s = "\n Hello\tworld\t\n";
assert_eq!("\n Hello\tworld", s.trim_end());
```
Directionality:
```
let s = " English ";
assert!(Some('h') == s.trim_end().chars().rev().next());
let s = " עברית ";
assert!(Some('ת') == s.trim_end().chars().rev().next());
```
[source](https://doc.rust-lang.org/src/core/str/mod.rs.html#1971)#### pub fn trim\_left(&self) -> &str
👎Deprecated since 1.33.0: superseded by `trim_start`
Returns a string slice with leading whitespace removed.
‘Whitespace’ is defined according to the terms of the Unicode Derived Core Property `White_Space`.
##### Text directionality
A string is a sequence of bytes. ‘Left’ in this context means the first position of that byte string; for a language like Arabic or Hebrew which are ‘right to left’ rather than ‘left to right’, this will be the *right* side, not the left.
##### Examples
Basic usage:
```
let s = " Hello\tworld\t";
assert_eq!("Hello\tworld\t", s.trim_left());
```
Directionality:
```
let s = " English";
assert!(Some('E') == s.trim_left().chars().next());
let s = " עברית";
assert!(Some('ע') == s.trim_left().chars().next());
```
[source](https://doc.rust-lang.org/src/core/str/mod.rs.html#2011)#### pub fn trim\_right(&self) -> &str
👎Deprecated since 1.33.0: superseded by `trim_end`
Returns a string slice with trailing whitespace removed.
‘Whitespace’ is defined according to the terms of the Unicode Derived Core Property `White_Space`.
##### Text directionality
A string is a sequence of bytes. ‘Right’ in this context means the last position of that byte string; for a language like Arabic or Hebrew which are ‘right to left’ rather than ‘left to right’, this will be the *left* side, not the right.
##### Examples
Basic usage:
```
let s = " Hello\tworld\t";
assert_eq!(" Hello\tworld", s.trim_right());
```
Directionality:
```
let s = "English ";
assert!(Some('h') == s.trim_right().chars().rev().next());
let s = "עברית ";
assert!(Some('ת') == s.trim_right().chars().rev().next());
```
[source](https://doc.rust-lang.org/src/core/str/mod.rs.html#2044-2046)#### pub fn trim\_matches<'a, P>(&'a self, pat: P) -> &'a strwhere 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"): [DoubleEndedSearcher](str/pattern/trait.doubleendedsearcher "trait std::str::pattern::DoubleEndedSearcher")<'a>,
Returns a string slice with all prefixes and suffixes that match a pattern repeatedly removed.
The [pattern](str/pattern/index) can be a [`char`](primitive.char), a slice of [`char`](primitive.char)s, or a function or closure that determines if a character matches.
##### Examples
Simple patterns:
```
assert_eq!("11foo1bar11".trim_matches('1'), "foo1bar");
assert_eq!("123foo1bar123".trim_matches(char::is_numeric), "foo1bar");
let x: &[_] = &['1', '2'];
assert_eq!("12foo1bar12".trim_matches(x), "foo1bar");
```
A more complex pattern, using a closure:
```
assert_eq!("1foo1barXX".trim_matches(|c| c == '1' || c == 'X'), "foo1bar");
```
[source](https://doc.rust-lang.org/src/core/str/mod.rs.html#2093)1.30.0 · #### pub fn trim\_start\_matches<'a, P>(&'a self, pat: P) -> &'a strwhere P: [Pattern](str/pattern/trait.pattern "trait std::str::pattern::Pattern")<'a>,
Returns a string slice with all prefixes that match a pattern repeatedly removed.
The [pattern](str/pattern/index) can be a `&str`, [`char`](primitive.char), a slice of [`char`](primitive.char)s, or a function or closure that determines if a character matches.
##### Text directionality
A string is a sequence of bytes. `start` in this context means the first position of that byte string; for a left-to-right language like English or Russian, this will be left side, and for right-to-left languages like Arabic or Hebrew, this will be the right side.
##### Examples
Basic usage:
```
assert_eq!("11foo1bar11".trim_start_matches('1'), "foo1bar11");
assert_eq!("123foo1bar123".trim_start_matches(char::is_numeric), "foo1bar123");
let x: &[_] = &['1', '2'];
assert_eq!("12foo1bar12".trim_start_matches(x), "foo1bar12");
```
[source](https://doc.rust-lang.org/src/core/str/mod.rs.html#2126)1.45.0 · #### pub fn strip\_prefix<'a, P>(&'a self, prefix: P) -> Option<&'a str>where P: [Pattern](str/pattern/trait.pattern "trait std::str::pattern::Pattern")<'a>,
Returns a string slice with the prefix removed.
If the string starts with the pattern `prefix`, returns substring after the prefix, wrapped in `Some`. Unlike `trim_start_matches`, this method removes the prefix exactly once.
If the string does not start with `prefix`, returns `None`.
The [pattern](str/pattern/index) can be a `&str`, [`char`](primitive.char), a slice of [`char`](primitive.char)s, or a function or closure that determines if a character matches.
##### Examples
```
assert_eq!("foo:bar".strip_prefix("foo:"), Some("bar"));
assert_eq!("foo:bar".strip_prefix("bar"), None);
assert_eq!("foofoo".strip_prefix("foo"), Some("foo"));
```
[source](https://doc.rust-lang.org/src/core/str/mod.rs.html#2153-2156)1.45.0 · #### pub fn strip\_suffix<'a, P>(&'a self, suffix: P) -> Option<&'a str>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"): [ReverseSearcher](str/pattern/trait.reversesearcher "trait std::str::pattern::ReverseSearcher")<'a>,
Returns a string slice with the suffix removed.
If the string ends with the pattern `suffix`, returns the substring before the suffix, wrapped in `Some`. Unlike `trim_end_matches`, this method removes the suffix exactly once.
If the string does not end with `suffix`, returns `None`.
The [pattern](str/pattern/index) can be a `&str`, [`char`](primitive.char), a slice of [`char`](primitive.char)s, or a function or closure that determines if a character matches.
##### Examples
```
assert_eq!("bar:foo".strip_suffix(":foo"), Some("bar"));
assert_eq!("bar:foo".strip_suffix("bar"), None);
assert_eq!("foofoo".strip_suffix("foo"), Some("foo"));
```
[source](https://doc.rust-lang.org/src/core/str/mod.rs.html#2197-2199)1.30.0 · #### pub fn trim\_end\_matches<'a, P>(&'a self, pat: P) -> &'a strwhere 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"): [ReverseSearcher](str/pattern/trait.reversesearcher "trait std::str::pattern::ReverseSearcher")<'a>,
Returns a string slice with all suffixes that match a pattern repeatedly removed.
The [pattern](str/pattern/index) can be a `&str`, [`char`](primitive.char), a slice of [`char`](primitive.char)s, or a function or closure that determines if a character matches.
##### Text directionality
A string is a sequence of bytes. `end` in this context means the last position of that byte string; for a left-to-right language like English or Russian, this will be right side, and for right-to-left languages like Arabic or Hebrew, this will be the left side.
##### Examples
Simple patterns:
```
assert_eq!("11foo1bar11".trim_end_matches('1'), "11foo1bar");
assert_eq!("123foo1bar123".trim_end_matches(char::is_numeric), "123foo1bar");
let x: &[_] = &['1', '2'];
assert_eq!("12foo1bar12".trim_end_matches(x), "12foo1bar");
```
A more complex pattern, using a closure:
```
assert_eq!("1fooX".trim_end_matches(|c| c == '1' || c == 'X'), "1foo");
```
[source](https://doc.rust-lang.org/src/core/str/mod.rs.html#2243)#### pub fn trim\_left\_matches<'a, P>(&'a self, pat: P) -> &'a strwhere P: [Pattern](str/pattern/trait.pattern "trait std::str::pattern::Pattern")<'a>,
👎Deprecated since 1.33.0: superseded by `trim_start_matches`
Returns a string slice with all prefixes that match a pattern repeatedly removed.
The [pattern](str/pattern/index) can be a `&str`, [`char`](primitive.char), a slice of [`char`](primitive.char)s, or a function or closure that determines if a character matches.
##### Text directionality
A string is a sequence of bytes. ‘Left’ in this context means the first position of that byte string; for a language like Arabic or Hebrew which are ‘right to left’ rather than ‘left to right’, this will be the *right* side, not the left.
##### Examples
Basic usage:
```
assert_eq!("11foo1bar11".trim_left_matches('1'), "foo1bar11");
assert_eq!("123foo1bar123".trim_left_matches(char::is_numeric), "foo1bar123");
let x: &[_] = &['1', '2'];
assert_eq!("12foo1bar12".trim_left_matches(x), "foo1bar12");
```
[source](https://doc.rust-lang.org/src/core/str/mod.rs.html#2286-2288)#### pub fn trim\_right\_matches<'a, P>(&'a self, pat: P) -> &'a strwhere 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"): [ReverseSearcher](str/pattern/trait.reversesearcher "trait std::str::pattern::ReverseSearcher")<'a>,
👎Deprecated since 1.33.0: superseded by `trim_end_matches`
Returns a string slice with all suffixes that match a pattern repeatedly removed.
The [pattern](str/pattern/index) can be a `&str`, [`char`](primitive.char), a slice of [`char`](primitive.char)s, or a function or closure that determines if a character matches.
##### Text directionality
A string is a sequence of bytes. ‘Right’ in this context means the last position of that byte string; for a language like Arabic or Hebrew which are ‘right to left’ rather than ‘left to right’, this will be the *left* side, not the right.
##### Examples
Simple patterns:
```
assert_eq!("11foo1bar11".trim_right_matches('1'), "11foo1bar");
assert_eq!("123foo1bar123".trim_right_matches(char::is_numeric), "123foo1bar");
let x: &[_] = &['1', '2'];
assert_eq!("12foo1bar12".trim_right_matches(x), "12foo1bar");
```
A more complex pattern, using a closure:
```
assert_eq!("1fooX".trim_right_matches(|c| c == '1' || c == 'X'), "1foo");
```
[source](https://doc.rust-lang.org/src/core/str/mod.rs.html#2338)#### pub fn parse<F>(&self) -> Result<F, <F as FromStr>::Err>where F: [FromStr](str/trait.fromstr "trait std::str::FromStr"),
Parses this string slice into another type.
Because `parse` is so general, it can cause problems with type inference. As such, `parse` is one of the few times you’ll see the syntax affectionately known as the ‘turbofish’: `::<>`. This helps the inference algorithm understand specifically which type you’re trying to parse into.
`parse` can parse into any type that implements the [`FromStr`](str/trait.fromstr "FromStr") trait.
##### Errors
Will return [`Err`](str/trait.fromstr#associatedtype.Err) if it’s not possible to parse this string slice into the desired type.
##### Examples
Basic usage
```
let four: u32 = "4".parse().unwrap();
assert_eq!(4, four);
```
Using the ‘turbofish’ instead of annotating `four`:
```
let four = "4".parse::<u32>();
assert_eq!(Ok(4), four);
```
Failing to parse:
```
let nope = "j".parse::<u32>();
assert!(nope.is_err());
```
[source](https://doc.rust-lang.org/src/core/str/mod.rs.html#2356)1.23.0 · #### pub fn is\_ascii(&self) -> bool
Checks if all characters in this string are within the ASCII range.
##### Examples
```
let ascii = "hello!\n";
let non_ascii = "Grüße, Jürgen ❤";
assert!(ascii.is_ascii());
assert!(!non_ascii.is_ascii());
```
[source](https://doc.rust-lang.org/src/core/str/mod.rs.html#2378)1.23.0 · #### pub fn eq\_ignore\_ascii\_case(&self, other: &str) -> 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
```
assert!("Ferris".eq_ignore_ascii_case("FERRIS"));
assert!("Ferrös".eq_ignore_ascii_case("FERRöS"));
assert!(!"Ferrös".eq_ignore_ascii_case("FERRÖS"));
```
[source](https://doc.rust-lang.org/src/core/str/mod.rs.html#2403)1.23.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 [`to_ascii_uppercase()`](#method.to_ascii_uppercase).
##### Examples
```
let mut s = String::from("Grüße, Jürgen ❤");
s.make_ascii_uppercase();
assert_eq!("GRüßE, JüRGEN ❤", s);
```
[source](https://doc.rust-lang.org/src/core/str/mod.rs.html#2430)1.23.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 [`to_ascii_lowercase()`](#method.to_ascii_lowercase).
##### Examples
```
let mut s = String::from("GRÜßE, JÜRGEN ❤");
s.make_ascii_lowercase();
assert_eq!("grÜße, jÜrgen ❤", s);
```
[source](https://doc.rust-lang.org/src/core/str/mod.rs.html#2473)1.34.0 · #### pub fn escape\_debug(&self) -> EscapeDebug<'\_>
Notable traits for [EscapeDebug](str/struct.escapedebug "struct std::str::EscapeDebug")<'a>
```
impl<'a> Iterator for EscapeDebug<'a>
type Item = char;
```
Return an iterator that escapes each char in `self` with [`char::escape_debug`](primitive.char#method.escape_debug "char::escape_debug").
Note: only extended grapheme codepoints that begin the string will be escaped.
##### Examples
As an iterator:
```
for c in "❤\n!".escape_debug() {
print!("{c}");
}
println!();
```
Using `println!` directly:
```
println!("{}", "❤\n!".escape_debug());
```
Both are equivalent to:
```
println!("❤\\n!");
```
Using `to_string`:
```
assert_eq!("❤\n!".escape_debug().to_string(), "❤\\n!");
```
[source](https://doc.rust-lang.org/src/core/str/mod.rs.html#2519)1.34.0 · #### pub fn escape\_default(&self) -> EscapeDefault<'\_>
Notable traits for [EscapeDefault](str/struct.escapedefault "struct std::str::EscapeDefault")<'a>
```
impl<'a> Iterator for EscapeDefault<'a>
type Item = char;
```
Return an iterator that escapes each char in `self` with [`char::escape_default`](primitive.char#method.escape_default "char::escape_default").
##### Examples
As an iterator:
```
for c in "❤\n!".escape_default() {
print!("{c}");
}
println!();
```
Using `println!` directly:
```
println!("{}", "❤\n!".escape_default());
```
Both are equivalent to:
```
println!("\\u{{2764}}\\n!");
```
Using `to_string`:
```
assert_eq!("❤\n!".escape_default().to_string(), "\\u{2764}\\n!");
```
[source](https://doc.rust-lang.org/src/core/str/mod.rs.html#2557)1.34.0 · #### pub fn escape\_unicode(&self) -> EscapeUnicode<'\_>
Notable traits for [EscapeUnicode](str/struct.escapeunicode "struct std::str::EscapeUnicode")<'a>
```
impl<'a> Iterator for EscapeUnicode<'a>
type Item = char;
```
Return an iterator that escapes each char in `self` with [`char::escape_unicode`](primitive.char#method.escape_unicode "char::escape_unicode").
##### Examples
As an iterator:
```
for c in "❤\n!".escape_unicode() {
print!("{c}");
}
println!();
```
Using `println!` directly:
```
println!("{}", "❤\n!".escape_unicode());
```
Both are equivalent to:
```
println!("\\u{{2764}}\\u{{a}}\\u{{21}}");
```
Using `to_string`:
```
assert_eq!("❤\n!".escape_unicode().to_string(), "\\u{2764}\\u{a}\\u{21}");
```
[source](https://doc.rust-lang.org/src/alloc/str.rs.html#221)### impl str
Methods for string slices.
[source](https://doc.rust-lang.org/src/alloc/str.rs.html#238)1.20.0 · #### pub fn into\_boxed\_bytes(self: Box<str, Global>) -> Box<[u8], 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 `Box<str>` into a `Box<[u8]>` without copying or allocating.
##### Examples
Basic usage:
```
let s = "this is a string";
let boxed_str = s.to_owned().into_boxed_str();
let boxed_bytes = boxed_str.into_boxed_bytes();
assert_eq!(*boxed_bytes, *s.as_bytes());
```
[source](https://doc.rust-lang.org/src/alloc/str.rs.html#271)#### pub fn replace<'a, P>(&'a self, from: P, to: &str) -> Stringwhere P: [Pattern](str/pattern/trait.pattern "trait std::str::pattern::Pattern")<'a>,
Replaces all matches of a pattern with another string.
`replace` creates a new [`String`](string/struct.string "String"), and copies the data from this string slice into it. While doing so, it attempts to find matches of a pattern. If it finds any, it replaces them with the replacement string slice.
##### Examples
Basic usage:
```
let s = "this is old";
assert_eq!("this is new", s.replace("old", "new"));
assert_eq!("than an old", s.replace("is", "an"));
```
When the pattern doesn’t match:
```
let s = "this is old";
assert_eq!(s, s.replace("cookie monster", "little lamb"));
```
[source](https://doc.rust-lang.org/src/alloc/str.rs.html#311)1.16.0 · #### pub fn replacen<'a, P>(&'a self, pat: P, to: &str, count: usize) -> Stringwhere P: [Pattern](str/pattern/trait.pattern "trait std::str::pattern::Pattern")<'a>,
Replaces first N matches of a pattern with another string.
`replacen` creates a new [`String`](string/struct.string "String"), and copies the data from this string slice into it. While doing so, it attempts to find matches of a pattern. If it finds any, it replaces them with the replacement string slice at most `count` times.
##### Examples
Basic usage:
```
let s = "foo foo 123 foo";
assert_eq!("new new 123 foo", s.replacen("foo", "new", 2));
assert_eq!("faa fao 123 foo", s.replacen('o', "a", 3));
assert_eq!("foo foo new23 foo", s.replacen(char::is_numeric, "new", 1));
```
When the pattern doesn’t match:
```
let s = "this is old";
assert_eq!(s, s.replacen("cookie monster", "little lamb", 10));
```
[source](https://doc.rust-lang.org/src/alloc/str.rs.html#368)1.2.0 · #### pub fn to\_lowercase(&self) -> String
Returns the lowercase equivalent of this string slice, as a new [`String`](string/struct.string "String").
‘Lowercase’ is defined according to the terms of the Unicode Derived Core Property `Lowercase`.
Since some characters can expand into multiple characters when changing the case, this function returns a [`String`](string/struct.string "String") instead of modifying the parameter in-place.
##### Examples
Basic usage:
```
let s = "HELLO";
assert_eq!("hello", s.to_lowercase());
```
A tricky example, with sigma:
```
let sigma = "Σ";
assert_eq!("σ", sigma.to_lowercase());
// but at the end of a word, it's ς, not σ:
let odysseus = "ὈΔΥΣΣΕΎΣ";
assert_eq!("ὀδυσσεύς", odysseus.to_lowercase());
```
Languages without case are not changed:
```
let new_year = "农历新年";
assert_eq!(new_year, new_year.to_lowercase());
```
[source](https://doc.rust-lang.org/src/alloc/str.rs.html#459)1.2.0 · #### pub fn to\_uppercase(&self) -> String
Returns the uppercase equivalent of this string slice, as a new [`String`](string/struct.string "String").
‘Uppercase’ is defined according to the terms of the Unicode Derived Core Property `Uppercase`.
Since some characters can expand into multiple characters when changing the case, this function returns a [`String`](string/struct.string "String") instead of modifying the parameter in-place.
##### Examples
Basic usage:
```
let s = "hello";
assert_eq!("HELLO", s.to_uppercase());
```
Scripts without case are not changed:
```
let new_year = "农历新年";
assert_eq!(new_year, new_year.to_uppercase());
```
One character can become multiple:
```
let s = "tschüß";
assert_eq!("TSCHÜSS", s.to_uppercase());
```
[source](https://doc.rust-lang.org/src/alloc/str.rs.html#502)1.4.0 · #### pub fn into\_string(self: Box<str, Global>) -> String
Converts a [`Box<str>`](boxed/struct.box "Box<str>") into a [`String`](string/struct.string "String") without copying or allocating.
##### Examples
Basic usage:
```
let string = String::from("birthday gift");
let boxed_str = string.clone().into_boxed_str();
assert_eq!(boxed_str.into_string(), string);
```
[source](https://doc.rust-lang.org/src/alloc/str.rs.html#531)1.16.0 · #### pub fn repeat(&self, n: usize) -> String
Creates a new [`String`](string/struct.string "String") by repeating a string `n` times.
##### Panics
This function will panic if the capacity would overflow.
##### Examples
Basic usage:
```
assert_eq!("abc".repeat(4), String::from("abcabcabcabc"));
```
A panic upon overflow:
ⓘ
```
// this will panic at runtime
let huge = "0123456789abcdef".repeat(usize::MAX);
```
[source](https://doc.rust-lang.org/src/alloc/str.rs.html#561)1.23.0 · #### pub fn to\_ascii\_uppercase(&self) -> String
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 [`make_ascii_uppercase`](primitive.str#method.make_ascii_uppercase).
To uppercase ASCII characters in addition to non-ASCII characters, use [`to_uppercase`](#method.to_uppercase).
##### Examples
```
let s = "Grüße, Jürgen ❤";
assert_eq!("GRüßE, JüRGEN ❤", s.to_ascii_uppercase());
```
[source](https://doc.rust-lang.org/src/alloc/str.rs.html#594)1.23.0 · #### pub fn to\_ascii\_lowercase(&self) -> String
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 [`make_ascii_lowercase`](primitive.str#method.make_ascii_lowercase).
To lowercase ASCII characters in addition to non-ASCII characters, use [`to_lowercase`](#method.to_lowercase).
##### Examples
```
let s = "Grüße, Jürgen ❤";
assert_eq!("grüße, jürgen ❤", s.to_ascii_lowercase());
```
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/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
The resulting type after applying the `+` operator.
[source](https://doc.rust-lang.org/src/alloc/string.rs.html#2312)#### fn add(self, other: &str) -> String
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/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/alloc/string.rs.html#2325)#### fn add\_assign(&mut self, other: &str)
Performs the `+=` operation. [Read more](ops/trait.addassign#tymethod.add_assign)
[source](https://doc.rust-lang.org/src/alloc/string.rs.html#2604)1.43.0 · ### impl AsMut<str> for String
[source](https://doc.rust-lang.org/src/alloc/string.rs.html#2606)#### fn as\_mut(&mut self) -> &mut str
Converts this type into a mutable reference of the (usually inferred) input type.
[source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#639)1.51.0 · ### impl AsMut<str> for str
[source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#641)#### fn as\_mut(&mut self) -> &mut str
Converts this type into a mutable reference of the (usually inferred) input type.
[source](https://doc.rust-lang.org/src/core/str/mod.rs.html#2563)### impl AsRef<[u8]> for str
[source](https://doc.rust-lang.org/src/core/str/mod.rs.html#2565)#### fn as\_ref(&self) -> &[u8]
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/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#3033-3038)### impl AsRef<Path> for str
[source](https://doc.rust-lang.org/src/std/path.rs.html#3035-3037)#### 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/string.rs.html#2914)1.55.0 · ### impl<'a> AsRef<str> for Drain<'a>
[source](https://doc.rust-lang.org/src/alloc/string.rs.html#2915)#### fn as\_ref(&self) -> &str
Converts this type into a shared reference of the (usually inferred) input type.
[source](https://doc.rust-lang.org/src/alloc/string.rs.html#2596)### impl AsRef<str> for String
[source](https://doc.rust-lang.org/src/alloc/string.rs.html#2598)#### fn as\_ref(&self) -> &str
Converts this type into a shared reference of the (usually inferred) input type.
[source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#631)### impl AsRef<str> for str
[source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#633)#### fn as\_ref(&self) -> &str
Converts this type into a shared reference of the (usually inferred) input type.
[source](https://doc.rust-lang.org/src/std/ascii.rs.html#204-208)### impl AsciiExt for str
#### type Owned = String
👎Deprecated since 1.26.0: use inherent methods instead
Container type for copied ASCII characters.
[source](https://doc.rust-lang.org/src/std/ascii.rs.html#207)#### fn is\_ascii(&self) -> bool
👎Deprecated since 1.26.0: use inherent methods instead
Checks if the value is within the ASCII range. [Read more](ascii/trait.asciiext#tymethod.is_ascii)
[source](https://doc.rust-lang.org/src/std/ascii.rs.html#207)#### fn to\_ascii\_uppercase(&self) -> Self::Owned
👎Deprecated since 1.26.0: use inherent methods instead
Makes a copy of the value in its ASCII upper case equivalent. [Read more](ascii/trait.asciiext#tymethod.to_ascii_uppercase)
[source](https://doc.rust-lang.org/src/std/ascii.rs.html#207)#### fn to\_ascii\_lowercase(&self) -> Self::Owned
👎Deprecated since 1.26.0: use inherent methods instead
Makes a copy of the value in its ASCII lower case equivalent. [Read more](ascii/trait.asciiext#tymethod.to_ascii_lowercase)
[source](https://doc.rust-lang.org/src/std/ascii.rs.html#207)#### fn eq\_ignore\_ascii\_case(&self, o: &Self) -> bool
👎Deprecated since 1.26.0: use inherent methods instead
Checks that two values are an ASCII case-insensitive match. [Read more](ascii/trait.asciiext#tymethod.eq_ignore_ascii_case)
[source](https://doc.rust-lang.org/src/std/ascii.rs.html#207)#### fn make\_ascii\_uppercase(&mut self)
👎Deprecated since 1.26.0: use inherent methods instead
Converts this type to its ASCII upper case equivalent in-place. [Read more](ascii/trait.asciiext#tymethod.make_ascii_uppercase)
[source](https://doc.rust-lang.org/src/std/ascii.rs.html#207)#### fn make\_ascii\_lowercase(&mut self)
👎Deprecated since 1.26.0: use inherent methods instead
Converts this type to its ASCII lower case equivalent in-place. [Read more](ascii/trait.asciiext#tymethod.make_ascii_lowercase)
[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/str.rs.html#190)#### fn borrow(&self) -> &str
Immutably borrows from an owned value. [Read more](borrow/trait.borrow#tymethod.borrow)
[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/alloc/str.rs.html#198)#### fn borrow\_mut(&mut self) -> &mut str
Mutably borrows from an owned value. [Read more](borrow/trait.borrowmut#tymethod.borrow_mut)
[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](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)#### 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/str.rs.html#61)### impl<S> Concat<str> for [S]where S: [Borrow](borrow/trait.borrow "trait std::borrow::Borrow")<[str](primitive.str)>,
Note: `str` in `Concat<str>` is not meaningful here. This type parameter of the trait only exists to enable another impl.
#### type Output = String
🔬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/alloc/str.rs.html#64)#### fn concat(slice: &[S]) -> String
🔬This is a nightly-only experimental API. (`slice_concat_trait` [#27747](https://github.com/rust-lang/rust/issues/27747))
Implementation of [`[T]::concat`](primitive.slice#method.concat)
[source](https://doc.rust-lang.org/src/core/fmt/mod.rs.html#2408)### impl Debug for str
[source](https://doc.rust-lang.org/src/core/fmt/mod.rs.html#2409)#### 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/str/mod.rs.html#2581)1.28.0 · ### impl Default for &mut str
[source](https://doc.rust-lang.org/src/core/str/mod.rs.html#2584)#### fn default() -> &mut str
Creates an empty mutable str
[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/str/mod.rs.html#2575)const: [unstable](https://github.com/rust-lang/rust/issues/87864 "Tracking issue for const_default_impls") · #### fn default() -> &str
Creates an empty str
[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](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/core/fmt/mod.rs.html#2433)### impl Display for str
[source](https://doc.rust-lang.org/src/core/fmt/mod.rs.html#2434)#### 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/str/mod.rs.html#2646)### impl !Error for &str
[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)#### 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)#### 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/string.rs.html#2094)### impl<'a> Extend<&'a str> for String
[source](https://doc.rust-lang.org/src/alloc/string.rs.html#2095)#### fn extend<I>(&mut self, iter: I)where I: [IntoIterator](iter/trait.intoiterator "trait std::iter::IntoIterator")<Item = &'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#2100)#### fn extend\_one(&mut self, s: &'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/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`](borrow/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/string.rs.html#2633)1.44.0 · ### impl From<&mut str> for String
[source](https://doc.rust-lang.org/src/alloc/string.rs.html#2638)#### fn from(s: &mut str) -> String
Converts a `&mut str` into a [`String`](string/struct.string "String").
The result is allocated on the heap.
[source](https://doc.rust-lang.org/src/alloc/sync.rs.html#2503)1.21.0 · ### impl From<&str> for Arc<str>
[source](https://doc.rust-lang.org/src/alloc/sync.rs.html#2514)#### fn from(v: &str) -> Arc<str>
Allocate a reference-counted `str` and copy `v` into it.
##### Example
```
let shared: Arc<str> = Arc::from("eggplant");
assert_eq!("eggplant", &shared[..]);
```
[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](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 [`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](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 [`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](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 `&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/rc.rs.html#1899)1.21.0 · ### impl From<&str> for Rc<str>
[source](https://doc.rust-lang.org/src/alloc/rc.rs.html#1910)#### fn from(v: &str) -> Rc<str>
Allocate a reference-counted string slice and copy `v` into it.
##### Example
```
let shared: Rc<str> = Rc::from("statue");
assert_eq!("statue", &shared[..]);
```
[source](https://doc.rust-lang.org/src/alloc/string.rs.html#2621)### impl From<&str> for String
[source](https://doc.rust-lang.org/src/alloc/string.rs.html#2626)#### fn from(s: &str) -> String
Converts a `&str` into a [`String`](string/struct.string "String").
The result is allocated on the heap.
[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](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/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/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](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 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/string.rs.html#1996)### impl<'a> FromIterator<&'a str> for String
[source](https://doc.rust-lang.org/src/alloc/string.rs.html#1997)#### fn from\_iter<I>(iter: I) -> Stringwhere I: [IntoIterator](iter/trait.intoiterator "trait std::iter::IntoIterator")<Item = &'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#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/core/hash/mod.rs.html#861)### impl Hash for str
[source](https://doc.rust-lang.org/src/core/hash/mod.rs.html#863)#### 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/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
The returned type after indexing.
[source](https://doc.rust-lang.org/src/core/str/traits.rs.html#64)const: unstable · #### fn index(&self, index: I) -> &<I as SliceIndex<str>>::Output
Performs the indexing (`container[index]`) operation. [Read more](ops/trait.index#tymethod.index)
[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/str/traits.rs.html#76)const: unstable · #### fn index\_mut(&mut self, index: I) -> &mut <I as SliceIndex<str>>::Output
Performs the mutable indexing (`container[index]`) operation. [Read more](ops/trait.indexmut#tymethod.index_mut)
[source](https://doc.rust-lang.org/src/alloc/str.rs.html#71)### impl<S> Join<&str> for [S]where S: [Borrow](borrow/trait.borrow "trait std::borrow::Borrow")<[str](primitive.str)>,
#### type Output = String
🔬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/alloc/str.rs.html#74)#### fn join(slice: &[S], sep: &str) -> String
🔬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/core/str/traits.rs.html#18)### impl Ord for str
Implements ordering of strings.
Strings are ordered [lexicographically](cmp/trait.ord#lexicographical-comparison) by their byte values. This orders Unicode code points based on their positions in the code charts. This is not necessarily the same as “alphabetical” order, which varies by language and locale. Sorting strings according to culturally-accepted standards requires locale-specific data that is outside the scope of the `str` type.
[source](https://doc.rust-lang.org/src/core/str/traits.rs.html#20)#### fn cmp(&self, other: &str) -> 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/alloc/string.rs.html#2227)### impl<'a, 'b> PartialEq<&'a str> for String
[source](https://doc.rust-lang.org/src/alloc/string.rs.html#2227)#### fn eq(&self, other: &&'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#2227)#### fn ne(&self, other: &&'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#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/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/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#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/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#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#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/alloc/string.rs.html#2227)### impl<'a, 'b> PartialEq<String> for &'a str
[source](https://doc.rust-lang.org/src/alloc/string.rs.html#2227)#### 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#2227)#### 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/string.rs.html#2226)### impl<'a, 'b> PartialEq<String> for str
[source](https://doc.rust-lang.org/src/alloc/string.rs.html#2226)#### 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#2226)#### 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/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/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#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/alloc/string.rs.html#2226)### impl<'a, 'b> PartialEq<str> for String
[source](https://doc.rust-lang.org/src/alloc/string.rs.html#2226)#### 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#2226)#### 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/core/str/traits.rs.html#26)### impl PartialEq<str> for str
[source](https://doc.rust-lang.org/src/core/str/traits.rs.html#28)#### 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/str/traits.rs.html#32)#### 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/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#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/core/str/traits.rs.html#48)### impl PartialOrd<str> for str
Implements comparison operations on strings.
Strings are compared [lexicographically](cmp/trait.ord#lexicographical-comparison) by their byte values. This compares Unicode code points based on their positions in the code charts. This is not necessarily the same as “alphabetical” order, which varies by language and locale. Comparing strings according to culturally-accepted standards requires locale-specific data that is outside the scope of the `str` type.
[source](https://doc.rust-lang.org/src/core/str/traits.rs.html#50)#### 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/core/str/pattern.rs.html#935)### impl<'a, 'b> Pattern<'a> for &'b str
Non-allocating substring search.
Will handle the pattern `""` as returning empty matches at each character boundary.
#### Examples
```
assert_eq!("Hello world".find("world"), Some(6));
```
[source](https://doc.rust-lang.org/src/core/str/pattern.rs.html#945)#### 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#951)#### 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#962)#### fn is\_suffix\_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 back of the haystack.
[source](https://doc.rust-lang.org/src/core/str/pattern.rs.html#968)#### fn strip\_suffix\_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 back of haystack, if it matches.
#### type Searcher = StrSearcher<'a, 'b>
🔬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#939)#### fn into\_searcher(self, haystack: &'a str) -> StrSearcher<'a, 'b>
🔬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#108)#### 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/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](ops/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](ops/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/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](ops/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](ops/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/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/str/traits.rs.html#403)1.26.0 (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](ops/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](ops/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/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/str/traits.rs.html#455)1.26.0 (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/alloc/str.rs.html#205)### impl ToOwned for str
#### type Owned = String
The resulting type after obtaining ownership.
[source](https://doc.rust-lang.org/src/alloc/str.rs.html#208)#### fn to\_owned(&self) -> String
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/str.rs.html#212)#### fn clone\_into(&self, target: &mut String)
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/net/socket_addr.rs.html#939-949)### impl ToSocketAddrs for str
#### type Iter = IntoIter<SocketAddr, Global>
Returned iterator over socket addresses which this type may correspond to. [Read more](net/trait.tosocketaddrs#associatedtype.Iter)
[source](https://doc.rust-lang.org/src/std/net/socket_addr.rs.html#941-948)#### fn to\_socket\_addrs(&self) -> Result<IntoIter<SocketAddr>>
Converts this object to an iterator of resolved [`SocketAddr`](net/enum.socketaddr "SocketAddr")s. [Read more](net/trait.tosocketaddrs#tymethod.to_socket_addrs)
[source](https://doc.rust-lang.org/src/alloc/string.rs.html#2570)1.9.0 · ### impl ToString for str
[source](https://doc.rust-lang.org/src/alloc/string.rs.html#2572)#### 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/str/traits.rs.html#38)### impl Eq for str
Auto Trait Implementations
--------------------------
### impl RefUnwindSafe for str
### impl Send for str
### impl !Sized for str
### impl Sync for str
### impl Unpin for str
### impl UnwindSafe for str
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/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)
| programming_docs |
rust Keyword move Keyword move
============
Capture a [closure](../book/ch13-01-closures)’s environment by value.
`move` converts any variables captured by reference or mutable reference to variables captured by value.
```
let data = vec![1, 2, 3];
let closure = move || println!("captured {data:?} by value");
// data is no longer available, it is owned by the closure
```
Note: `move` closures may still implement [`Fn`](ops/trait.fn "Fn") or [`FnMut`](ops/trait.fnmut "FnMut"), even though they capture variables by `move`. This is because the traits implemented by a closure type are determined by *what* the closure does with captured values, not *how* it captures them:
```
fn create_fn() -> impl Fn() {
let text = "Fn".to_owned();
move || println!("This is a: {text}")
}
let fn_plain = create_fn();
fn_plain();
```
`move` is often used when [threads](../book/ch16-01-threads#using-move-closures-with-threads) are involved.
```
let data = vec![1, 2, 3];
std::thread::spawn(move || {
println!("captured {data:?} by value")
}).join().unwrap();
// data was moved to the spawned thread, so we cannot use it here
```
`move` is also valid before an async block.
```
let capture = "hello".to_owned();
let block = async move {
println!("rust says {capture} from async block");
};
```
For more information on the `move` keyword, see the [closures](../book/ch13-01-closures) section of the Rust book or the [threads](../book/ch16-01-threads#using-move-closures-with-threads) section.
rust Primitive Type reference Primitive Type reference
========================
References, `&T` and `&mut T`.
A reference represents a borrow of some owned value. You can get one by using the `&` or `&mut` operators on a value, or by using a [`ref`](keyword.ref) or `[ref](keyword.ref) [mut](keyword.mut)` pattern.
For those familiar with pointers, a reference is just a pointer that is assumed to be aligned, not null, and pointing to memory containing a valid value of `T` - for example, `&[bool](primitive.bool)` can only point to an allocation containing the integer values `1` ([`true`](keyword.true)) or `0` ([`false`](keyword.false)), but creating a `&[bool](primitive.bool)` that points to an allocation containing the value `3` causes undefined behaviour. In fact, `[Option](option/enum.option "Option")<&T>` has the same memory representation as a nullable but aligned pointer, and can be passed across FFI boundaries as such.
In most cases, references can be used much like the original value. Field access, method calling, and indexing work the same (save for mutability rules, of course). In addition, the comparison operators transparently defer to the referent’s implementation, allowing references to be compared the same as owned values.
References have a lifetime attached to them, which represents the scope for which the borrow is valid. A lifetime is said to “outlive” another one if its representative scope is as long or longer than the other. The `'static` lifetime is the longest lifetime, which represents the total life of the program. For example, string literals have a `'static` lifetime because the text data is embedded into the binary of the program, rather than in an allocation that needs to be dynamically managed.
`&mut T` references can be freely coerced into `&T` references with the same referent type, and references with longer lifetimes can be freely coerced into references with shorter ones.
Reference equality by address, instead of comparing the values pointed to, is accomplished via implicit reference-pointer coercion and raw pointer equality via [`ptr::eq`](ptr/fn.eq "ptr::eq"), while [`PartialEq`](cmp/trait.partialeq "PartialEq") compares values.
```
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!(five_ref == other_five_ref);
assert!(ptr::eq(five_ref, same_five_ref));
assert!(!ptr::eq(five_ref, other_five_ref));
```
For more information on how to use references, see [the book’s section on “References and Borrowing”](../book/ch04-02-references-and-borrowing).
Trait implementations
---------------------
The following traits are implemented for all `&T`, regardless of the type of its referent:
* [`Copy`](marker/trait.copy "Copy")
* [`Clone`](clone/trait.clone "Clone") (Note that this will not defer to `T`’s `Clone` implementation if it exists!)
* [`Deref`](ops/trait.deref)
* [`Borrow`](borrow/trait.borrow)
* [`fmt::Pointer`](fmt/trait.pointer "fmt::Pointer")
`&mut T` references get all of the above except `Copy` and `Clone` (to prevent creating multiple simultaneous mutable borrows), plus the following, regardless of the type of its referent:
* [`DerefMut`](ops/trait.derefmut)
* [`BorrowMut`](borrow/trait.borrowmut)
The following traits are implemented on `&T` references if the underlying `T` also implements that trait:
* All the traits in [`std::fmt`](fmt/index) except [`fmt::Pointer`](fmt/trait.pointer "fmt::Pointer") (which is implemented regardless of the type of its referent) and [`fmt::Write`](fmt/trait.write "fmt::Write")
* [`PartialOrd`](cmp/trait.partialord "PartialOrd")
* [`Ord`](cmp/trait.ord "Ord")
* [`PartialEq`](cmp/trait.partialeq "PartialEq")
* [`Eq`](cmp/trait.eq "Eq")
* [`AsRef`](convert/trait.asref "AsRef")
* [`Fn`](ops/trait.fn "Fn") (in addition, `&T` references get [`FnMut`](ops/trait.fnmut "FnMut") and [`FnOnce`](ops/trait.fnonce "FnOnce") if `T: Fn`)
* [`Hash`](hash/trait.hash)
* [`ToSocketAddrs`](net/trait.tosocketaddrs)
* [`Send`](marker/trait.send "Send") (`&T` references also require `T: [Sync](marker/trait.sync "Sync")`)
`&mut T` references get all of the above except `ToSocketAddrs`, plus the following, if `T` implements that trait:
* [`AsMut`](convert/trait.asmut "AsMut")
* [`FnMut`](ops/trait.fnmut "FnMut") (in addition, `&mut T` references get [`FnOnce`](ops/trait.fnonce "FnOnce") if `T: FnMut`)
* [`fmt::Write`](fmt/trait.write "fmt::Write")
* [`Iterator`](iter/trait.iterator "Iterator")
* [`DoubleEndedIterator`](iter/trait.doubleendediterator "DoubleEndedIterator")
* [`ExactSizeIterator`](iter/trait.exactsizeiterator "ExactSizeIterator")
* [`FusedIterator`](iter/trait.fusediterator)
* [`TrustedLen`](iter/trait.trustedlen)
* [`io::Write`](io/trait.write)
* [`Read`](io/trait.read)
* [`Seek`](io/trait.seek)
* [`BufRead`](io/trait.bufread)
Note that due to method call deref coercion, simply calling a trait method will act like they work on references as well as they do on owned values! The implementations described here are meant for generic contexts, where the final type `T` is a type parameter or otherwise not locally known.
Trait Implementations
---------------------
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1519)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · ### impl<A, B> PartialEq<&B> for &Awhere A: [PartialEq](cmp/trait.partialeq "trait std::cmp::PartialEq")<B> + ?[Sized](marker/trait.sized "trait std::marker::Sized"), B: ?[Sized](marker/trait.sized "trait std::marker::Sized"),
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1524)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · #### fn eq(&self, other: &&B) -> 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#1528)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · #### fn ne(&self, other: &&B) -> 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/cmp.rs.html#1642)### impl<A, B> PartialEq<&B> for &mut Awhere A: [PartialEq](cmp/trait.partialeq "trait std::cmp::PartialEq")<B> + ?[Sized](marker/trait.sized "trait std::marker::Sized"), B: ?[Sized](marker/trait.sized "trait std::marker::Sized"),
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1647)#### fn eq(&self, other: &&B) -> 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#1651)#### fn ne(&self, other: &&B) -> 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/cmp.rs.html#1627)### impl<A, B> PartialEq<&mut B> for &Awhere A: [PartialEq](cmp/trait.partialeq "trait std::cmp::PartialEq")<B> + ?[Sized](marker/trait.sized "trait std::marker::Sized"), B: ?[Sized](marker/trait.sized "trait std::marker::Sized"),
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1632)#### fn eq(&self, other: &&mut B) -> 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#1636)#### fn ne(&self, other: &&mut B) -> 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/cmp.rs.html#1574)### impl<A, B> PartialEq<&mut B> for &mut Awhere A: [PartialEq](cmp/trait.partialeq "trait std::cmp::PartialEq")<B> + ?[Sized](marker/trait.sized "trait std::marker::Sized"), B: ?[Sized](marker/trait.sized "trait std::marker::Sized"),
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1579)#### fn eq(&self, other: &&mut B) -> 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#1583)#### fn ne(&self, other: &&mut B) -> 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/cmp.rs.html#1533)### impl<A, B> PartialOrd<&B> for &Awhere A: [PartialOrd](cmp/trait.partialord "trait std::cmp::PartialOrd")<B> + ?[Sized](marker/trait.sized "trait std::marker::Sized"), B: ?[Sized](marker/trait.sized "trait std::marker::Sized"),
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1538)#### fn partial\_cmp(&self, other: &&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#1542)#### fn lt(&self, other: &&B) -> 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#1546)#### fn le(&self, other: &&B) -> 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#1550)#### fn gt(&self, other: &&B) -> 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#1554)#### fn ge(&self, other: &&B) -> 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/cmp.rs.html#1588)### impl<A, B> PartialOrd<&mut B> for &mut Awhere A: [PartialOrd](cmp/trait.partialord "trait std::cmp::PartialOrd")<B> + ?[Sized](marker/trait.sized "trait std::marker::Sized"), B: ?[Sized](marker/trait.sized "trait std::marker::Sized"),
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1593)#### fn partial\_cmp(&self, other: &&mut 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#1597)#### fn lt(&self, other: &&mut B) -> 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#1601)#### fn le(&self, other: &&mut B) -> 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#1605)#### fn gt(&self, other: &&mut B) -> 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#1609)#### fn ge(&self, other: &&mut B) -> 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/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#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/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"),
rust Keyword struct Keyword struct
==============
A type that is composed of other types.
Structs in Rust come in three flavors: Structs with named fields, tuple structs, and unit structs.
```
struct Regular {
field1: f32,
field2: String,
pub field3: bool
}
struct Tuple(u32, String);
struct Unit;
```
Regular structs are the most commonly used. Each field defined within them has a name and a type, and once defined can be accessed using `example_struct.field` syntax. The fields of a struct share its mutability, so `foo.bar = 2;` would only be valid if `foo` was mutable. Adding `pub` to a field makes it visible to code in other modules, as well as allowing it to be directly accessed and modified.
Tuple structs are similar to regular structs, but its fields have no names. They are used like tuples, with deconstruction possible via `let TupleStruct(x, y) = foo;` syntax. For accessing individual variables, the same syntax is used as with regular tuples, namely `foo.0`, `foo.1`, etc, starting at zero.
Unit structs are most commonly used as marker. They have a size of zero bytes, but unlike empty enums they can be instantiated, making them isomorphic to the unit type `()`. Unit structs are useful when you need to implement a trait on something, but don’t need to store any data inside it.
Instantiation
-------------
Structs can be instantiated in different ways, all of which can be mixed and matched as needed. The most common way to make a new struct is via a constructor method such as `new()`, but when that isn’t available (or you’re writing the constructor itself), struct literal syntax is used:
```
let example = Foo {
field1: 42.0,
field2: "blah".to_string(),
etc: true,
};
```
It’s only possible to directly instantiate a struct using struct literal syntax when all of its fields are visible to you.
There are a handful of shortcuts provided to make writing constructors more convenient, most common of which is the Field Init shorthand. When there is a variable and a field of the same name, the assignment can be simplified from `field: field` into simply `field`. The following example of a hypothetical constructor demonstrates this:
```
struct User {
name: String,
admin: bool,
}
impl User {
pub fn new(name: String) -> Self {
Self {
name,
admin: false,
}
}
}
```
Another shortcut for struct instantiation is available, used when you need to make a new struct that has the same values as most of a previous struct of the same type, called struct update syntax:
```
let updated_thing = Foo {
field1: "a new value".to_string(),
..thing
};
```
Tuple structs are instantiated in the same way as tuples themselves, except with the struct’s name as a prefix: `Foo(123, false, 0.1)`.
Empty structs are instantiated with just their name, and don’t need anything else. `let thing = EmptyStruct;`
Style conventions
-----------------
Structs are always written in CamelCase, with few exceptions. While the trailing comma on a struct’s list of fields can be omitted, it’s usually kept for convenience in adding and removing fields down the line.
For more information on structs, take a look at the [Rust Book](../book/ch05-01-defining-structs) or the [Reference](../reference/items/structs).
rust Macro std::panic Macro std::panic
================
```
macro_rules! panic {
($($arg:tt)*) => { ... };
}
```
Panics the current thread.
This allows a program to terminate immediately and provide feedback to the caller of the program.
This macro is the perfect way to assert conditions in example code and in tests. `panic!` is closely tied with the `unwrap` method of both [`Option`](option/enum.option#method.unwrap) and [`Result`](result/enum.result#method.unwrap) enums. Both implementations call `panic!` when they are set to [`None`](option/enum.option#variant.None "None") or [`Err`](result/enum.result#variant.Err "Err") variants.
When using `panic!()` you can specify a string payload, that is built using the [`format!`](macro.format) syntax. That payload is used when injecting the panic into the calling Rust thread, causing the thread to panic entirely.
The behavior of the default `std` hook, i.e. the code that runs directly after the panic is invoked, is to print the message payload to `stderr` along with the file/line/column information of the `panic!()` call. You can override the panic hook using [`std::panic::set_hook()`](panic/fn.set_hook). Inside the hook a panic can be accessed as a `&dyn Any + Send`, which contains either a `&str` or `String` for regular `panic!()` invocations. To panic with a value of another other type, [`panic_any`](panic/fn.panic_any) can be used.
See also the macro [`compile_error!`](macro.compile_error "compile_error!"), for raising errors during compilation.
When to use `panic!` vs `Result`
--------------------------------
The Rust language provides two complementary systems for constructing / representing, reporting, propagating, reacting to, and discarding errors. These responsibilities are collectively known as “error handling.” `panic!` and `Result` are similar in that they are each the primary interface of their respective error handling systems; however, the meaning these interfaces attach to their errors and the responsibilities they fulfill within their respective error handling systems differ.
The `panic!` macro is used to construct errors that represent a bug that has been detected in your program. With `panic!` you provide a message that describes the bug and the language then constructs an error with that message, reports it, and propagates it for you.
`Result` on the other hand is used to wrap other types that represent either the successful result of some computation, `Ok(T)`, or error types that represent an anticipated runtime failure mode of that computation, `Err(E)`. `Result` is used alongside user defined types which represent the various anticipated runtime failure modes that the associated computation could encounter. `Result` must be propagated manually, often with the the help of the `?` operator and `Try` trait, and they must be reported manually, often with the help of the `Error` trait.
For more detailed information about error handling check out the [book](../book/ch09-00-error-handling) or the [`std::result`](result/index) module docs.
Current implementation
----------------------
If the main thread panics it will terminate all your threads and end your program with code `101`.
Examples
--------
ⓘ
```
panic!();
panic!("this is a terrible mistake!");
panic!("this is a {} {message}", "fancy", message = "message");
std::panic::panic_any(4); // panic with the value of 4 to be collected elsewhere
```
| programming_docs |
rust Macro std::module_path Macro std::module\_path
=======================
```
macro_rules! module_path {
() => { ... };
}
```
Expands to a string that represents the current module path.
The current module path can be thought of as the hierarchy of modules leading back up to the crate root. The first component of the path returned is the name of the crate currently being compiled.
Examples
--------
```
mod test {
pub fn foo() {
assert!(module_path!().ends_with("test"));
}
}
test::foo();
```
rust Keyword unsafe Keyword unsafe
==============
Code or interfaces whose [memory safety](../book/ch19-01-unsafe-rust) cannot be verified by the type system.
The `unsafe` keyword has two uses: to declare the existence of contracts the compiler can’t check (`unsafe fn` and `unsafe trait`), and to declare that a programmer has checked that these contracts have been upheld (`unsafe {}` and `unsafe impl`, but also `unsafe fn` – see below). They are not mutually exclusive, as can be seen in `unsafe fn`.
Unsafe abilities
----------------
**No matter what, Safe Rust can’t cause Undefined Behavior**. This is referred to as [soundness](https://rust-lang.github.io/unsafe-code-guidelines/glossary.html#soundness-of-code--of-a-library): a well-typed program actually has the desired properties. The [Nomicon](https://doc.rust-lang.org/nomicon/safe-unsafe-meaning.html) has a more detailed explanation on the subject.
To ensure soundness, Safe Rust is restricted enough that it can be automatically checked. Sometimes, however, it is necessary to write code that is correct for reasons which are too clever for the compiler to understand. In those cases, you need to use Unsafe Rust.
Here are the abilities Unsafe Rust has in addition to Safe Rust:
* Dereference [raw pointers](../reference/types/pointer)
* Implement `unsafe` [`trait`](keyword.trait)s
* Call `unsafe` functions
* Mutate [`static`](keyword.static)s (including [`extern`](keyword.extern)al ones)
* Access fields of [`union`](keyword.union)s
However, this extra power comes with extra responsibilities: it is now up to you to ensure soundness. The `unsafe` keyword helps by clearly marking the pieces of code that need to worry about this.
### The different meanings of `unsafe`
Not all uses of `unsafe` are equivalent: some are here to mark the existence of a contract the programmer must check, others are to say “I have checked the contract, go ahead and do this”. The following [discussion on Rust Internals](https://internals.rust-lang.org/t/what-does-unsafe-mean/6696) has more in-depth explanations about this but here is a summary of the main points:
* `unsafe fn`: calling this function means abiding by a contract the compiler cannot enforce.
* `unsafe trait`: implementing the [`trait`](keyword.trait) means abiding by a contract the compiler cannot enforce.
* `unsafe {}`: the contract necessary to call the operations inside the block has been checked by the programmer and is guaranteed to be respected.
* `unsafe impl`: the contract necessary to implement the trait has been checked by the programmer and is guaranteed to be respected.
`unsafe fn` also acts like an `unsafe {}` block around the code inside the function. This means it is not just a signal to the caller, but also promises that the preconditions for the operations inside the function are upheld. Mixing these two meanings can be confusing and [proposal](https://github.com/rust-lang/rfcs/pull/2585)s exist to use `unsafe {}` blocks inside such functions when making `unsafe` operations.
See the [Rustnomicon](https://doc.rust-lang.org/nomicon/index.html) and the [Reference](../reference/unsafety) for more information.
Examples
--------
### Marking elements as `unsafe`
`unsafe` can be used on functions. Note that functions and statics declared in [`extern`](keyword.extern) blocks are implicitly marked as `unsafe` (but not functions declared as `extern "something" fn ...`). Mutable statics are always unsafe, wherever they are declared. Methods can also be declared as `unsafe`:
```
static mut FOO: &str = "hello";
unsafe fn unsafe_fn() {}
extern "C" {
fn unsafe_extern_fn();
static BAR: *mut u32;
}
trait SafeTraitWithUnsafeMethod {
unsafe fn unsafe_method(&self);
}
struct S;
impl S {
unsafe fn unsafe_method_on_struct() {}
}
```
Traits can also be declared as `unsafe`:
```
unsafe trait UnsafeTrait {}
```
Since `unsafe fn` and `unsafe trait` indicate that there is a safety contract that the compiler cannot enforce, documenting it is important. The standard library has many examples of this, like the following which is an extract from [`Vec::set_len`](vec/struct.vec#method.set_len "Vec::set_len"). The `# Safety` section explains the contract that must be fulfilled to safely call the function.
ⓘ
```
/// 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`, `resize`, `extend`, or `clear`.
///
/// # Safety
///
/// - `new_len` must be less than or equal to `capacity()`.
/// - The elements at `old_len..new_len` must be initialized.
pub unsafe fn set_len(&mut self, new_len: usize)
```
### Using `unsafe {}` blocks and `impl`s
Performing `unsafe` operations requires an `unsafe {}` block:
```
/// Dereference the given pointer.
///
/// # Safety
///
/// `ptr` must be aligned and must not be dangling.
unsafe fn deref_unchecked(ptr: *const i32) -> i32 {
*ptr
}
let a = 3;
let b = &a as *const _;
// SAFETY: `a` has not been dropped and references are always aligned,
// so `b` is a valid address.
unsafe { assert_eq!(*b, deref_unchecked(b)); };
```
Traits marked as `unsafe` must be [`impl`](keyword.impl)emented using `unsafe impl`. This makes a guarantee to other `unsafe` code that the implementation satisfies the trait’s safety contract. The [Send](marker/trait.send "Send") and [Sync](marker/trait.sync "Sync") traits are examples of this behaviour in the standard library.
```
/// Implementors of this trait must guarantee an element is always
/// accessible with index 3.
unsafe trait ThreeIndexable<T> {
/// Returns a reference to the element with index 3 in `&self`.
fn three(&self) -> &T;
}
// The implementation of `ThreeIndexable` for `[T; 4]` is `unsafe`
// because the implementor must abide by a contract the compiler cannot
// check but as a programmer we know there will always be a valid element
// at index 3 to access.
unsafe impl<T> ThreeIndexable<T> for [T; 4] {
fn three(&self) -> &T {
// SAFETY: implementing the trait means there always is an element
// with index 3 accessible.
unsafe { self.get_unchecked(3) }
}
}
let a = [1, 2, 4, 8];
assert_eq!(a.three(), &8);
```
rust Macro std::column Macro std::column
=================
```
macro_rules! column {
() => { ... };
}
```
Expands to the column number at which it was invoked.
With [`line!`](macro.line "line!") and [`file!`](macro.file "file!"), these macros provide debugging information for developers about the location within the source.
The expanded expression has type `u32` and is 1-based, so the first column in each line evaluates to 1, the second to 2, etc. This is consistent with error messages by common compilers or popular editors. The returned column is *not necessarily* the line of the `column!` invocation itself, but rather the first macro invocation leading up to the invocation of the `column!` macro.
Examples
--------
```
let current_col = column!();
println!("defined on column: {current_col}");
```
`column!` counts Unicode code points, not bytes or graphemes. As a result, the first two invocations return the same value, but the third does not.
```
let a = ("foobar", column!()).1;
let b = ("人之初性本善", column!()).1;
let c = ("f̅o̅o̅b̅a̅r̅", column!()).1; // Uses combining overline (U+0305)
assert_eq!(a, b);
assert_ne!(b, c);
```
rust Keyword fn Keyword fn
==========
A function or function pointer.
Functions are the primary way code is executed within Rust. Function blocks, usually just called functions, can be defined in a variety of different places and be assigned many different attributes and modifiers.
Standalone functions that just sit within a module not attached to anything else are common, but most functions will end up being inside [`impl`](keyword.impl) blocks, either on another type itself, or as a trait impl for that type.
```
fn standalone_function() {
// code
}
pub fn public_thing(argument: bool) -> String {
// code
}
struct Thing {
foo: i32,
}
impl Thing {
pub fn new() -> Self {
Self {
foo: 42,
}
}
}
```
In addition to presenting fixed types in the form of `fn name(arg: type, ..) -> return_type`, functions can also declare a list of type parameters along with trait bounds that they fall into.
```
fn generic_function<T: Clone>(x: T) -> (T, T, T) {
(x.clone(), x.clone(), x.clone())
}
fn generic_where<T>(x: T) -> T
where T: std::ops::Add<Output = T> + Copy
{
x + x + x
}
```
Declaring trait bounds in the angle brackets is functionally identical to using a `where` clause. It’s up to the programmer to decide which works better in each situation, but `where` tends to be better when things get longer than one line.
Along with being made public via `pub`, `fn` can also have an [`extern`](keyword.extern) added for use in FFI.
For more information on the various types of functions and how they’re used, consult the [Rust book](../book/ch03-03-how-functions-work) or the [Reference](../reference/items/functions).
rust Keyword if Keyword if
==========
Evaluate a block if a condition holds.
`if` is a familiar construct to most programmers, and is the main way you’ll often do logic in your code. However, unlike in most languages, `if` blocks can also act as expressions.
```
if 1 == 2 {
println!("whoops, mathematics broke");
} else {
println!("everything's fine!");
}
let greeting = if rude {
"sup nerd."
} else {
"hello, friend!"
};
if let Ok(x) = "123".parse::<i32>() {
println!("{} double that and you get {}!", greeting, x * 2);
}
```
Shown above are the three typical forms an `if` block comes in. First is the usual kind of thing you’d see in many languages, with an optional `else` block. Second uses `if` as an expression, which is only possible if all branches return the same type. An `if` expression can be used everywhere you’d expect. The third kind of `if` block is an `if let` block, which behaves similarly to using a `match` expression:
```
if let Some(x) = Some(123) {
// code
} else {
// something else
}
match Some(123) {
Some(x) => {
// code
},
_ => {
// something else
},
}
```
Each kind of `if` expression can be mixed and matched as needed.
```
if true == false {
println!("oh no");
} else if "something" == "other thing" {
println!("oh dear");
} else if let Some(200) = "blarg".parse::<i32>().ok() {
println!("uh oh");
} else {
println!("phew, nothing's broken");
}
```
The `if` keyword is used in one other place in Rust, namely as a part of pattern matching itself, allowing patterns such as `Some(x) if x > 200` to be used.
For more information on `if` expressions, see the [Rust book](../book/ch03-05-control-flow#if-expressions) or the [Reference](../reference/expressions/if-expr).
rust Keyword match Keyword match
=============
Control flow based on pattern matching.
`match` can be used to run code conditionally. Every pattern must be handled exhaustively either explicitly or by using wildcards like `_` in the `match`. Since `match` is an expression, values can also be returned.
```
let opt = Option::None::<usize>;
let x = match opt {
Some(int) => int,
None => 10,
};
assert_eq!(x, 10);
let a_number = Option::Some(10);
match a_number {
Some(x) if x <= 5 => println!("0 to 5 num = {x}"),
Some(x @ 6..=10) => println!("6 to 10 num = {x}"),
None => panic!(),
// all other numbers
_ => panic!(),
}
```
`match` can be used to gain access to the inner members of an enum and use them directly.
```
enum Outer {
Double(Option<u8>, Option<String>),
Single(Option<u8>),
Empty
}
let get_inner = Outer::Double(None, Some(String::new()));
match get_inner {
Outer::Double(None, Some(st)) => println!("{st}"),
Outer::Single(opt) => println!("{opt:?}"),
_ => panic!(),
}
```
For more information on `match` and matching in general, see the [Reference](../reference/expressions/match-expr).
rust Primitive Type i16 Primitive Type i16
==================
The 16-bit signed integer type.
Implementations
---------------
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#214)### impl i16
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#215-216)1.43.0 · #### pub const MIN: i16 = -32\_768i16
The smallest value that can be represented by this integer type (−215)
##### Examples
Basic usage:
```
assert_eq!(i16::MIN, -32768);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#215-216)1.43.0 · #### pub const MAX: i16 = 32\_767i16
The largest value that can be represented by this integer type (215 − 1)
##### Examples
Basic usage:
```
assert_eq!(i16::MAX, 32767);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#215-216)1.53.0 · #### pub const BITS: u32 = 16u32
The size of this integer type in bits.
##### Examples
```
assert_eq!(i16::BITS, 16);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#215-216)#### pub fn from\_str\_radix(src: &str, radix: u32) -> Result<i16, ParseIntError>
Converts a string slice in a given base to an integer.
The string is expected to be an optional `+` or `-` sign followed by digits. Leading and trailing whitespace represent an error. Digits are a subset of these characters, depending on `radix`:
* `0-9`
* `a-z`
* `A-Z`
##### Panics
This function panics if `radix` is not in the range from 2 to 36.
##### Examples
Basic usage:
```
assert_eq!(i16::from_str_radix("A", 16), Ok(10));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#215-216)const: 1.32.0 · #### pub const fn count\_ones(self) -> u32
Returns the number of ones in the binary representation of `self`.
##### Examples
Basic usage:
```
let n = 0b100_0000i16;
assert_eq!(n.count_ones(), 1);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#215-216)const: 1.32.0 · #### pub const fn count\_zeros(self) -> u32
Returns the number of zeros in the binary representation of `self`.
##### Examples
Basic usage:
```
assert_eq!(i16::MAX.count_zeros(), 1);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#215-216)const: 1.32.0 · #### pub const fn leading\_zeros(self) -> u32
Returns the number of leading zeros in the binary representation of `self`.
##### Examples
Basic usage:
```
let n = -1i16;
assert_eq!(n.leading_zeros(), 0);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#215-216)const: 1.32.0 · #### pub const fn trailing\_zeros(self) -> u32
Returns the number of trailing zeros in the binary representation of `self`.
##### Examples
Basic usage:
```
let n = -4i16;
assert_eq!(n.trailing_zeros(), 2);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#215-216)1.46.0 (const: 1.46.0) · #### pub const fn leading\_ones(self) -> u32
Returns the number of leading ones in the binary representation of `self`.
##### Examples
Basic usage:
```
let n = -1i16;
assert_eq!(n.leading_ones(), 16);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#215-216)1.46.0 (const: 1.46.0) · #### pub const fn trailing\_ones(self) -> u32
Returns the number of trailing ones in the binary representation of `self`.
##### Examples
Basic usage:
```
let n = 3i16;
assert_eq!(n.trailing_ones(), 2);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#215-216)const: 1.32.0 · #### pub const fn rotate\_left(self, n: u32) -> i16
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:
```
let n = -0x5ffdi16;
let m = 0x3a;
assert_eq!(n.rotate_left(4), m);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#215-216)const: 1.32.0 · #### pub const fn rotate\_right(self, n: u32) -> i16
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:
```
let n = 0x3ai16;
let m = -0x5ffd;
assert_eq!(n.rotate_right(4), m);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#215-216)const: 1.32.0 · #### pub const fn swap\_bytes(self) -> i16
Reverses the byte order of the integer.
##### Examples
Basic usage:
```
let n = 0x1234i16;
let m = n.swap_bytes();
assert_eq!(m, 0x3412);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#215-216)1.37.0 (const: 1.37.0) · #### pub const fn reverse\_bits(self) -> i16
Reverses the order of bits in the integer. The least significant bit becomes the most significant bit, second least-significant bit becomes second most-significant bit, etc.
##### Examples
Basic usage:
```
let n = 0x1234i16;
let m = n.reverse_bits();
assert_eq!(m, 0x2c48);
assert_eq!(0, 0i16.reverse_bits());
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#215-216)const: 1.32.0 · #### pub const fn from\_be(x: i16) -> i16
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:
```
let n = 0x1Ai16;
if cfg!(target_endian = "big") {
assert_eq!(i16::from_be(n), n)
} else {
assert_eq!(i16::from_be(n), n.swap_bytes())
}
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#215-216)const: 1.32.0 · #### pub const fn from\_le(x: i16) -> i16
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:
```
let n = 0x1Ai16;
if cfg!(target_endian = "little") {
assert_eq!(i16::from_le(n), n)
} else {
assert_eq!(i16::from_le(n), n.swap_bytes())
}
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#215-216)const: 1.32.0 · #### pub const fn to\_be(self) -> i16
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:
```
let n = 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/mod.rs.html#215-216)const: 1.32.0 · #### pub const fn to\_le(self) -> i16
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:
```
let n = 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/mod.rs.html#215-216)const: 1.47.0 · #### pub const fn checked\_add(self, rhs: i16) -> Option<i16>
Checked integer addition. Computes `self + rhs`, returning `None` if overflow occurred.
##### Examples
Basic usage:
```
assert_eq!((i16::MAX - 2).checked_add(1), Some(i16::MAX - 1));
assert_eq!((i16::MAX - 2).checked_add(3), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#215-216)const: [unstable](https://github.com/rust-lang/rust/issues/85122 "Tracking issue for const_inherent_unchecked_arith") · #### pub unsafe fn unchecked\_add(self, rhs: i16) -> i16
🔬This is a nightly-only experimental API. (`unchecked_math` [#85122](https://github.com/rust-lang/rust/issues/85122))
Unchecked integer addition. Computes `self + rhs`, assuming overflow cannot occur.
##### Safety
This results in undefined behavior when `self + rhs > i16::MAX` or `self + rhs < i16::MIN`, i.e. when [`checked_add`](primitive.i16#method.checked_add) would return `None`.
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#215-216)const: [unstable](https://github.com/rust-lang/rust/issues/87840 "Tracking issue for mixed_integer_ops") · #### pub fn checked\_add\_unsigned(self, rhs: u16) -> Option<i16>
🔬This is a nightly-only experimental API. (`mixed_integer_ops` [#87840](https://github.com/rust-lang/rust/issues/87840))
Checked addition with an unsigned integer. Computes `self + rhs`, returning `None` if overflow occurred.
##### Examples
Basic usage:
```
assert_eq!(1i16.checked_add_unsigned(2), Some(3));
assert_eq!((i16::MAX - 2).checked_add_unsigned(3), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#215-216)const: 1.47.0 · #### pub const fn checked\_sub(self, rhs: i16) -> Option<i16>
Checked integer subtraction. Computes `self - rhs`, returning `None` if overflow occurred.
##### Examples
Basic usage:
```
assert_eq!((i16::MIN + 2).checked_sub(1), Some(i16::MIN + 1));
assert_eq!((i16::MIN + 2).checked_sub(3), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#215-216)const: [unstable](https://github.com/rust-lang/rust/issues/85122 "Tracking issue for const_inherent_unchecked_arith") · #### pub unsafe fn unchecked\_sub(self, rhs: i16) -> i16
🔬This is a nightly-only experimental API. (`unchecked_math` [#85122](https://github.com/rust-lang/rust/issues/85122))
Unchecked integer subtraction. Computes `self - rhs`, assuming overflow cannot occur.
##### Safety
This results in undefined behavior when `self - rhs > i16::MAX` or `self - rhs < i16::MIN`, i.e. when [`checked_sub`](primitive.i16#method.checked_sub) would return `None`.
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#215-216)const: [unstable](https://github.com/rust-lang/rust/issues/87840 "Tracking issue for mixed_integer_ops") · #### pub fn checked\_sub\_unsigned(self, rhs: u16) -> Option<i16>
🔬This is a nightly-only experimental API. (`mixed_integer_ops` [#87840](https://github.com/rust-lang/rust/issues/87840))
Checked subtraction with an unsigned integer. Computes `self - rhs`, returning `None` if overflow occurred.
##### Examples
Basic usage:
```
assert_eq!(1i16.checked_sub_unsigned(2), Some(-1));
assert_eq!((i16::MIN + 2).checked_sub_unsigned(3), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#215-216)const: 1.47.0 · #### pub const fn checked\_mul(self, rhs: i16) -> Option<i16>
Checked integer multiplication. Computes `self * rhs`, returning `None` if overflow occurred.
##### Examples
Basic usage:
```
assert_eq!(i16::MAX.checked_mul(1), Some(i16::MAX));
assert_eq!(i16::MAX.checked_mul(2), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#215-216)const: [unstable](https://github.com/rust-lang/rust/issues/85122 "Tracking issue for const_inherent_unchecked_arith") · #### pub unsafe fn unchecked\_mul(self, rhs: i16) -> i16
🔬This is a nightly-only experimental API. (`unchecked_math` [#85122](https://github.com/rust-lang/rust/issues/85122))
Unchecked integer multiplication. Computes `self * rhs`, assuming overflow cannot occur.
##### Safety
This results in undefined behavior when `self * rhs > i16::MAX` or `self * rhs < i16::MIN`, i.e. when [`checked_mul`](primitive.i16#method.checked_mul) would return `None`.
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#215-216)const: 1.52.0 · #### pub const fn checked\_div(self, rhs: i16) -> Option<i16>
Checked integer division. Computes `self / rhs`, returning `None` if `rhs == 0` or the division results in overflow.
##### Examples
Basic usage:
```
assert_eq!((i16::MIN + 1).checked_div(-1), Some(32767));
assert_eq!(i16::MIN.checked_div(-1), None);
assert_eq!((1i16).checked_div(0), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#215-216)1.38.0 (const: 1.52.0) · #### pub const fn checked\_div\_euclid(self, rhs: i16) -> Option<i16>
Checked Euclidean division. Computes `self.div_euclid(rhs)`, returning `None` if `rhs == 0` or the division results in overflow.
##### Examples
Basic usage:
```
assert_eq!((i16::MIN + 1).checked_div_euclid(-1), Some(32767));
assert_eq!(i16::MIN.checked_div_euclid(-1), None);
assert_eq!((1i16).checked_div_euclid(0), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#215-216)1.7.0 (const: 1.52.0) · #### pub const fn checked\_rem(self, rhs: i16) -> Option<i16>
Checked integer remainder. Computes `self % rhs`, returning `None` if `rhs == 0` or the division results in overflow.
##### Examples
Basic usage:
```
assert_eq!(5i16.checked_rem(2), Some(1));
assert_eq!(5i16.checked_rem(0), None);
assert_eq!(i16::MIN.checked_rem(-1), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#215-216)1.38.0 (const: 1.52.0) · #### pub const fn checked\_rem\_euclid(self, rhs: i16) -> Option<i16>
Checked Euclidean remainder. Computes `self.rem_euclid(rhs)`, returning `None` if `rhs == 0` or the division results in overflow.
##### Examples
Basic usage:
```
assert_eq!(5i16.checked_rem_euclid(2), Some(1));
assert_eq!(5i16.checked_rem_euclid(0), None);
assert_eq!(i16::MIN.checked_rem_euclid(-1), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#215-216)1.7.0 (const: 1.47.0) · #### pub const fn checked\_neg(self) -> Option<i16>
Checked negation. Computes `-self`, returning `None` if `self == MIN`.
##### Examples
Basic usage:
```
assert_eq!(5i16.checked_neg(), Some(-5));
assert_eq!(i16::MIN.checked_neg(), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#215-216)1.7.0 (const: 1.47.0) · #### pub const fn checked\_shl(self, rhs: u32) -> Option<i16>
Checked shift left. Computes `self << rhs`, returning `None` if `rhs` is larger than or equal to the number of bits in `self`.
##### Examples
Basic usage:
```
assert_eq!(0x1i16.checked_shl(4), Some(0x10));
assert_eq!(0x1i16.checked_shl(129), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#215-216)const: [unstable](https://github.com/rust-lang/rust/issues/85122 "Tracking issue for const_inherent_unchecked_arith") · #### pub unsafe fn unchecked\_shl(self, rhs: i16) -> i16
🔬This is a nightly-only experimental API. (`unchecked_math` [#85122](https://github.com/rust-lang/rust/issues/85122))
Unchecked shift left. Computes `self << rhs`, assuming that `rhs` is less than the number of bits in `self`.
##### Safety
This results in undefined behavior if `rhs` is larger than or equal to the number of bits in `self`, i.e. when [`checked_shl`](primitive.i16#method.checked_shl) would return `None`.
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#215-216)1.7.0 (const: 1.47.0) · #### pub const fn checked\_shr(self, rhs: u32) -> Option<i16>
Checked shift right. Computes `self >> rhs`, returning `None` if `rhs` is larger than or equal to the number of bits in `self`.
##### Examples
Basic usage:
```
assert_eq!(0x10i16.checked_shr(4), Some(0x1));
assert_eq!(0x10i16.checked_shr(128), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#215-216)const: [unstable](https://github.com/rust-lang/rust/issues/85122 "Tracking issue for const_inherent_unchecked_arith") · #### pub unsafe fn unchecked\_shr(self, rhs: i16) -> i16
🔬This is a nightly-only experimental API. (`unchecked_math` [#85122](https://github.com/rust-lang/rust/issues/85122))
Unchecked shift right. Computes `self >> rhs`, assuming that `rhs` is less than the number of bits in `self`.
##### Safety
This results in undefined behavior if `rhs` is larger than or equal to the number of bits in `self`, i.e. when [`checked_shr`](primitive.i16#method.checked_shr) would return `None`.
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#215-216)1.13.0 (const: 1.47.0) · #### pub const fn checked\_abs(self) -> Option<i16>
Checked absolute value. Computes `self.abs()`, returning `None` if `self == MIN`.
##### Examples
Basic usage:
```
assert_eq!((-5i16).checked_abs(), Some(5));
assert_eq!(i16::MIN.checked_abs(), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#215-216)1.34.0 (const: 1.50.0) · #### pub const fn checked\_pow(self, exp: u32) -> Option<i16>
Checked exponentiation. Computes `self.pow(exp)`, returning `None` if overflow occurred.
##### Examples
Basic usage:
```
assert_eq!(8i16.checked_pow(2), Some(64));
assert_eq!(i16::MAX.checked_pow(2), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#215-216)const: 1.47.0 · #### pub const fn saturating\_add(self, rhs: i16) -> i16
Saturating integer addition. Computes `self + rhs`, saturating at the numeric bounds instead of overflowing.
##### Examples
Basic usage:
```
assert_eq!(100i16.saturating_add(1), 101);
assert_eq!(i16::MAX.saturating_add(100), i16::MAX);
assert_eq!(i16::MIN.saturating_add(-1), i16::MIN);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#215-216)const: [unstable](https://github.com/rust-lang/rust/issues/87840 "Tracking issue for mixed_integer_ops") · #### pub fn saturating\_add\_unsigned(self, rhs: u16) -> i16
🔬This is a nightly-only experimental API. (`mixed_integer_ops` [#87840](https://github.com/rust-lang/rust/issues/87840))
Saturating addition with an unsigned integer. Computes `self + rhs`, saturating at the numeric bounds instead of overflowing.
##### Examples
Basic usage:
```
assert_eq!(1i16.saturating_add_unsigned(2), 3);
assert_eq!(i16::MAX.saturating_add_unsigned(100), i16::MAX);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#215-216)const: 1.47.0 · #### pub const fn saturating\_sub(self, rhs: i16) -> i16
Saturating integer subtraction. Computes `self - rhs`, saturating at the numeric bounds instead of overflowing.
##### Examples
Basic usage:
```
assert_eq!(100i16.saturating_sub(127), -27);
assert_eq!(i16::MIN.saturating_sub(100), i16::MIN);
assert_eq!(i16::MAX.saturating_sub(-1), i16::MAX);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#215-216)const: [unstable](https://github.com/rust-lang/rust/issues/87840 "Tracking issue for mixed_integer_ops") · #### pub fn saturating\_sub\_unsigned(self, rhs: u16) -> i16
🔬This is a nightly-only experimental API. (`mixed_integer_ops` [#87840](https://github.com/rust-lang/rust/issues/87840))
Saturating subtraction with an unsigned integer. Computes `self - rhs`, saturating at the numeric bounds instead of overflowing.
##### Examples
Basic usage:
```
assert_eq!(100i16.saturating_sub_unsigned(127), -27);
assert_eq!(i16::MIN.saturating_sub_unsigned(100), i16::MIN);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#215-216)1.45.0 (const: 1.47.0) · #### pub const fn saturating\_neg(self) -> i16
Saturating integer negation. Computes `-self`, returning `MAX` if `self == MIN` instead of overflowing.
##### Examples
Basic usage:
```
assert_eq!(100i16.saturating_neg(), -100);
assert_eq!((-100i16).saturating_neg(), 100);
assert_eq!(i16::MIN.saturating_neg(), i16::MAX);
assert_eq!(i16::MAX.saturating_neg(), i16::MIN + 1);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#215-216)1.45.0 (const: 1.47.0) · #### pub const fn saturating\_abs(self) -> i16
Saturating absolute value. Computes `self.abs()`, returning `MAX` if `self == MIN` instead of overflowing.
##### Examples
Basic usage:
```
assert_eq!(100i16.saturating_abs(), 100);
assert_eq!((-100i16).saturating_abs(), 100);
assert_eq!(i16::MIN.saturating_abs(), i16::MAX);
assert_eq!((i16::MIN + 1).saturating_abs(), i16::MAX);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#215-216)1.7.0 (const: 1.47.0) · #### pub const fn saturating\_mul(self, rhs: i16) -> i16
Saturating integer multiplication. Computes `self * rhs`, saturating at the numeric bounds instead of overflowing.
##### Examples
Basic usage:
```
assert_eq!(10i16.saturating_mul(12), 120);
assert_eq!(i16::MAX.saturating_mul(10), i16::MAX);
assert_eq!(i16::MIN.saturating_mul(10), i16::MIN);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#215-216)1.58.0 (const: 1.58.0) · #### pub const fn saturating\_div(self, rhs: i16) -> i16
Saturating integer division. Computes `self / rhs`, saturating at the numeric bounds instead of overflowing.
##### Examples
Basic usage:
```
assert_eq!(5i16.saturating_div(2), 2);
assert_eq!(i16::MAX.saturating_div(-1), i16::MIN + 1);
assert_eq!(i16::MIN.saturating_div(-1), i16::MAX);
```
ⓘ
```
let _ = 1i16.saturating_div(0);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#215-216)1.34.0 (const: 1.50.0) · #### pub const fn saturating\_pow(self, exp: u32) -> i16
Saturating integer exponentiation. Computes `self.pow(exp)`, saturating at the numeric bounds instead of overflowing.
##### Examples
Basic usage:
```
assert_eq!((-4i16).saturating_pow(3), -64);
assert_eq!(i16::MIN.saturating_pow(2), i16::MAX);
assert_eq!(i16::MIN.saturating_pow(3), i16::MIN);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#215-216)const: 1.32.0 · #### pub const fn wrapping\_add(self, rhs: i16) -> i16
Wrapping (modular) addition. Computes `self + rhs`, wrapping around at the boundary of the type.
##### Examples
Basic usage:
```
assert_eq!(100i16.wrapping_add(27), 127);
assert_eq!(i16::MAX.wrapping_add(2), i16::MIN + 1);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#215-216)const: [unstable](https://github.com/rust-lang/rust/issues/87840 "Tracking issue for mixed_integer_ops") · #### pub fn wrapping\_add\_unsigned(self, rhs: u16) -> i16
🔬This is a nightly-only experimental API. (`mixed_integer_ops` [#87840](https://github.com/rust-lang/rust/issues/87840))
Wrapping (modular) addition with an unsigned integer. Computes `self + rhs`, wrapping around at the boundary of the type.
##### Examples
Basic usage:
```
assert_eq!(100i16.wrapping_add_unsigned(27), 127);
assert_eq!(i16::MAX.wrapping_add_unsigned(2), i16::MIN + 1);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#215-216)const: 1.32.0 · #### pub const fn wrapping\_sub(self, rhs: i16) -> i16
Wrapping (modular) subtraction. Computes `self - rhs`, wrapping around at the boundary of the type.
##### Examples
Basic usage:
```
assert_eq!(0i16.wrapping_sub(127), -127);
assert_eq!((-2i16).wrapping_sub(i16::MAX), i16::MAX);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#215-216)const: [unstable](https://github.com/rust-lang/rust/issues/87840 "Tracking issue for mixed_integer_ops") · #### pub fn wrapping\_sub\_unsigned(self, rhs: u16) -> i16
🔬This is a nightly-only experimental API. (`mixed_integer_ops` [#87840](https://github.com/rust-lang/rust/issues/87840))
Wrapping (modular) subtraction with an unsigned integer. Computes `self - rhs`, wrapping around at the boundary of the type.
##### Examples
Basic usage:
```
assert_eq!(0i16.wrapping_sub_unsigned(127), -127);
assert_eq!((-2i16).wrapping_sub_unsigned(u16::MAX), -1);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#215-216)const: 1.32.0 · #### pub const fn wrapping\_mul(self, rhs: i16) -> i16
Wrapping (modular) multiplication. Computes `self * rhs`, wrapping around at the boundary of the type.
##### Examples
Basic usage:
```
assert_eq!(10i16.wrapping_mul(12), 120);
assert_eq!(11i8.wrapping_mul(12), -124);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#215-216)1.2.0 (const: 1.52.0) · #### pub const fn wrapping\_div(self, rhs: i16) -> i16
Wrapping (modular) division. Computes `self / rhs`, wrapping around at the boundary of the type.
The only case where such wrapping can occur is when one divides `MIN / -1` on a signed type (where `MIN` is the negative minimal value for the type); this is equivalent to `-MIN`, a positive value that is too large to represent in the type. In such a case, this function returns `MIN` itself.
##### Panics
This function will panic if `rhs` is 0.
##### Examples
Basic usage:
```
assert_eq!(100i16.wrapping_div(10), 10);
assert_eq!((-128i8).wrapping_div(-1), -128);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#215-216)1.38.0 (const: 1.52.0) · #### pub const fn wrapping\_div\_euclid(self, rhs: i16) -> i16
Wrapping Euclidean division. Computes `self.div_euclid(rhs)`, wrapping around at the boundary of the type.
Wrapping will only occur in `MIN / -1` on a signed type (where `MIN` is the negative minimal value for the type). This is equivalent to `-MIN`, a positive value that is too large to represent in the type. In this case, this method returns `MIN` itself.
##### Panics
This function will panic if `rhs` is 0.
##### Examples
Basic usage:
```
assert_eq!(100i16.wrapping_div_euclid(10), 10);
assert_eq!((-128i8).wrapping_div_euclid(-1), -128);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#215-216)1.2.0 (const: 1.52.0) · #### pub const fn wrapping\_rem(self, rhs: i16) -> i16
Wrapping (modular) remainder. Computes `self % rhs`, wrapping around at the boundary of the type.
Such wrap-around never actually occurs mathematically; implementation artifacts make `x % y` invalid for `MIN / -1` on a signed type (where `MIN` is the negative minimal value). In such a case, this function returns `0`.
##### Panics
This function will panic if `rhs` is 0.
##### Examples
Basic usage:
```
assert_eq!(100i16.wrapping_rem(10), 0);
assert_eq!((-128i8).wrapping_rem(-1), 0);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#215-216)1.38.0 (const: 1.52.0) · #### pub const fn wrapping\_rem\_euclid(self, rhs: i16) -> i16
Wrapping Euclidean remainder. Computes `self.rem_euclid(rhs)`, wrapping around at the boundary of the type.
Wrapping will only occur in `MIN % -1` on a signed type (where `MIN` is the negative minimal value for the type). In this case, this method returns 0.
##### Panics
This function will panic if `rhs` is 0.
##### Examples
Basic usage:
```
assert_eq!(100i16.wrapping_rem_euclid(10), 0);
assert_eq!((-128i8).wrapping_rem_euclid(-1), 0);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#215-216)1.2.0 (const: 1.32.0) · #### pub const fn wrapping\_neg(self) -> i16
Wrapping (modular) negation. Computes `-self`, wrapping around at the boundary of the type.
The only case where such wrapping can occur is when one negates `MIN` on a signed type (where `MIN` is 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:
```
assert_eq!(100i16.wrapping_neg(), -100);
assert_eq!(i16::MIN.wrapping_neg(), i16::MIN);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#215-216)1.2.0 (const: 1.32.0) · #### pub const fn wrapping\_shl(self, rhs: u32) -> i16
Panic-free bitwise shift-left; yields `self << mask(rhs)`, where `mask` removes any high-order bits of `rhs` that would cause the shift to exceed the bitwidth of the type.
Note that this is *not* the same as a rotate-left; the RHS of a wrapping shift-left is restricted to the range of the type, rather than the bits shifted out of the LHS being returned to the other end. The primitive integer types all implement a [`rotate_left`](primitive.i16#method.rotate_left) function, which may be what you want instead.
##### Examples
Basic usage:
```
assert_eq!((-1i16).wrapping_shl(7), -128);
assert_eq!((-1i16).wrapping_shl(128), -1);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#215-216)1.2.0 (const: 1.32.0) · #### pub const fn wrapping\_shr(self, rhs: u32) -> i16
Panic-free bitwise shift-right; yields `self >> mask(rhs)`, where `mask` removes any high-order bits of `rhs` that would cause the shift to exceed the bitwidth of the type.
Note that this is *not* the same as a rotate-right; the RHS of a wrapping shift-right is restricted to the range of the type, rather than the bits shifted out of the LHS being returned to the other end. The primitive integer types all implement a [`rotate_right`](primitive.i16#method.rotate_right) function, which may be what you want instead.
##### Examples
Basic usage:
```
assert_eq!((-128i16).wrapping_shr(7), -1);
assert_eq!((-128i16).wrapping_shr(64), -128);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#215-216)1.13.0 (const: 1.32.0) · #### pub const fn wrapping\_abs(self) -> i16
Wrapping (modular) absolute value. Computes `self.abs()`, 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:
```
assert_eq!(100i16.wrapping_abs(), 100);
assert_eq!((-100i16).wrapping_abs(), 100);
assert_eq!(i16::MIN.wrapping_abs(), i16::MIN);
assert_eq!((-128i8).wrapping_abs() as u8, 128);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#215-216)1.51.0 (const: 1.51.0) · #### pub const fn unsigned\_abs(self) -> u16
Computes the absolute value of `self` without any wrapping or panicking.
##### Examples
Basic usage:
```
assert_eq!(100i16.unsigned_abs(), 100u16);
assert_eq!((-100i16).unsigned_abs(), 100u16);
assert_eq!((-128i8).unsigned_abs(), 128u8);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#215-216)1.34.0 (const: 1.50.0) · #### pub const fn wrapping\_pow(self, exp: u32) -> i16
Wrapping (modular) exponentiation. Computes `self.pow(exp)`, wrapping around at the boundary of the type.
##### Examples
Basic usage:
```
assert_eq!(3i16.wrapping_pow(4), 81);
assert_eq!(3i8.wrapping_pow(5), -13);
assert_eq!(3i8.wrapping_pow(6), -39);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#215-216)1.7.0 (const: 1.32.0) · #### pub const fn overflowing\_add(self, rhs: i16) -> (i16, bool)
Calculates `self` + `rhs`
Returns a tuple of the addition along with a boolean indicating whether an arithmetic overflow would occur. If an overflow would have occurred then the wrapped value is returned.
##### Examples
Basic usage:
```
assert_eq!(5i16.overflowing_add(2), (7, false));
assert_eq!(i16::MAX.overflowing_add(1), (i16::MIN, true));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#215-216)const: [unstable](https://github.com/rust-lang/rust/issues/85532 "Tracking issue for const_bigint_helper_methods") · #### pub fn carrying\_add(self, rhs: i16, carry: bool) -> (i16, bool)
🔬This is a nightly-only experimental API. (`bigint_helper_methods` [#85532](https://github.com/rust-lang/rust/issues/85532))
Calculates `self + rhs + carry` without the ability to overflow.
Performs “signed ternary addition” which takes in an extra bit to add, and may return an additional bit of overflow. This signed function is used only on the highest-ordered data, for which the signed overflow result indicates whether the big integer overflowed or not.
##### Examples
Basic usage:
```
#![feature(bigint_helper_methods)]
assert_eq!(5i16.carrying_add(2, false), (7, false));
assert_eq!(5i16.carrying_add(2, true), (8, false));
assert_eq!(i16::MAX.carrying_add(1, false), (i16::MIN, true));
assert_eq!(i16::MAX.carrying_add(0, true), (i16::MIN, true));
assert_eq!(i16::MAX.carrying_add(1, true), (i16::MIN + 1, true));
assert_eq!(i16::MAX.carrying_add(i16::MAX, true), (-1, true));
assert_eq!(i16::MIN.carrying_add(-1, true), (i16::MIN, false));
assert_eq!(0i16.carrying_add(i16::MAX, true), (i16::MIN, true));
```
If `carry` is false, this method is equivalent to [`overflowing_add`](primitive.i16#method.overflowing_add):
```
#![feature(bigint_helper_methods)]
assert_eq!(5_i16.carrying_add(2, false), 5_i16.overflowing_add(2));
assert_eq!(i16::MAX.carrying_add(1, false), i16::MAX.overflowing_add(1));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#215-216)const: [unstable](https://github.com/rust-lang/rust/issues/87840 "Tracking issue for mixed_integer_ops") · #### pub fn overflowing\_add\_unsigned(self, rhs: u16) -> (i16, bool)
🔬This is a nightly-only experimental API. (`mixed_integer_ops` [#87840](https://github.com/rust-lang/rust/issues/87840))
Calculates `self` + `rhs` with an unsigned `rhs`
Returns a tuple of the addition along with a boolean indicating whether an arithmetic overflow would occur. If an overflow would have occurred then the wrapped value is returned.
##### Examples
Basic usage:
```
assert_eq!(1i16.overflowing_add_unsigned(2), (3, false));
assert_eq!((i16::MIN).overflowing_add_unsigned(u16::MAX), (i16::MAX, false));
assert_eq!((i16::MAX - 2).overflowing_add_unsigned(3), (i16::MIN, true));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#215-216)1.7.0 (const: 1.32.0) · #### pub const fn overflowing\_sub(self, rhs: i16) -> (i16, bool)
Calculates `self` - `rhs`
Returns a tuple of the subtraction along with a boolean indicating whether an arithmetic overflow would occur. If an overflow would have occurred then the wrapped value is returned.
##### Examples
Basic usage:
```
assert_eq!(5i16.overflowing_sub(2), (3, false));
assert_eq!(i16::MIN.overflowing_sub(1), (i16::MAX, true));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#215-216)const: [unstable](https://github.com/rust-lang/rust/issues/85532 "Tracking issue for const_bigint_helper_methods") · #### pub fn borrowing\_sub(self, rhs: i16, borrow: bool) -> (i16, bool)
🔬This is a nightly-only experimental API. (`bigint_helper_methods` [#85532](https://github.com/rust-lang/rust/issues/85532))
Calculates `self - rhs - borrow` without the ability to overflow.
Performs “signed ternary subtraction” which takes in an extra bit to subtract, and may return an additional bit of overflow. This signed function is used only on the highest-ordered data, for which the signed overflow result indicates whether the big integer overflowed or not.
##### Examples
Basic usage:
```
#![feature(bigint_helper_methods)]
assert_eq!(5i16.borrowing_sub(2, false), (3, false));
assert_eq!(5i16.borrowing_sub(2, true), (2, false));
assert_eq!(0i16.borrowing_sub(1, false), (-1, false));
assert_eq!(0i16.borrowing_sub(1, true), (-2, false));
assert_eq!(i16::MIN.borrowing_sub(1, true), (i16::MAX - 1, true));
assert_eq!(i16::MAX.borrowing_sub(-1, false), (i16::MIN, true));
assert_eq!(i16::MAX.borrowing_sub(-1, true), (i16::MAX, false));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#215-216)const: [unstable](https://github.com/rust-lang/rust/issues/87840 "Tracking issue for mixed_integer_ops") · #### pub fn overflowing\_sub\_unsigned(self, rhs: u16) -> (i16, bool)
🔬This is a nightly-only experimental API. (`mixed_integer_ops` [#87840](https://github.com/rust-lang/rust/issues/87840))
Calculates `self` - `rhs` with an unsigned `rhs`
Returns a tuple of the subtraction along with a boolean indicating whether an arithmetic overflow would occur. If an overflow would have occurred then the wrapped value is returned.
##### Examples
Basic usage:
```
assert_eq!(1i16.overflowing_sub_unsigned(2), (-1, false));
assert_eq!((i16::MAX).overflowing_sub_unsigned(u16::MAX), (i16::MIN, false));
assert_eq!((i16::MIN + 2).overflowing_sub_unsigned(3), (i16::MAX, true));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#215-216)1.7.0 (const: 1.32.0) · #### pub const fn overflowing\_mul(self, rhs: i16) -> (i16, bool)
Calculates the multiplication of `self` and `rhs`.
Returns a tuple of the multiplication along with a boolean indicating whether an arithmetic overflow would occur. If an overflow would have occurred then the wrapped value is returned.
##### Examples
Basic usage:
```
assert_eq!(5i16.overflowing_mul(2), (10, false));
assert_eq!(1_000_000_000i32.overflowing_mul(10), (1410065408, true));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#215-216)1.7.0 (const: 1.52.0) · #### pub const fn overflowing\_div(self, rhs: i16) -> (i16, bool)
Calculates the divisor when `self` is divided by `rhs`.
Returns a tuple of the divisor along with a boolean indicating whether an arithmetic overflow would occur. If an overflow would occur then self is returned.
##### Panics
This function will panic if `rhs` is 0.
##### Examples
Basic usage:
```
assert_eq!(5i16.overflowing_div(2), (2, false));
assert_eq!(i16::MIN.overflowing_div(-1), (i16::MIN, true));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#215-216)1.38.0 (const: 1.52.0) · #### pub const fn overflowing\_div\_euclid(self, rhs: i16) -> (i16, bool)
Calculates the quotient of Euclidean division `self.div_euclid(rhs)`.
Returns a tuple of the divisor along with a boolean indicating whether an arithmetic overflow would occur. If an overflow would occur then `self` is returned.
##### Panics
This function will panic if `rhs` is 0.
##### Examples
Basic usage:
```
assert_eq!(5i16.overflowing_div_euclid(2), (2, false));
assert_eq!(i16::MIN.overflowing_div_euclid(-1), (i16::MIN, true));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#215-216)1.7.0 (const: 1.52.0) · #### pub const fn overflowing\_rem(self, rhs: i16) -> (i16, bool)
Calculates the remainder when `self` is divided by `rhs`.
Returns a tuple of the remainder after dividing along with a boolean indicating whether an arithmetic overflow would occur. If an overflow would occur then 0 is returned.
##### Panics
This function will panic if `rhs` is 0.
##### Examples
Basic usage:
```
assert_eq!(5i16.overflowing_rem(2), (1, false));
assert_eq!(i16::MIN.overflowing_rem(-1), (0, true));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#215-216)1.38.0 (const: 1.52.0) · #### pub const fn overflowing\_rem\_euclid(self, rhs: i16) -> (i16, bool)
Overflowing Euclidean remainder. Calculates `self.rem_euclid(rhs)`.
Returns a tuple of the remainder after dividing along with a boolean indicating whether an arithmetic overflow would occur. If an overflow would occur then 0 is returned.
##### Panics
This function will panic if `rhs` is 0.
##### Examples
Basic usage:
```
assert_eq!(5i16.overflowing_rem_euclid(2), (1, false));
assert_eq!(i16::MIN.overflowing_rem_euclid(-1), (0, true));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#215-216)1.7.0 (const: 1.32.0) · #### pub const fn overflowing\_neg(self) -> (i16, bool)
Negates self, overflowing if this is equal to the minimum value.
Returns a tuple of the negated version of self along with a boolean indicating whether an overflow happened. If `self` is the minimum value (e.g., `i32::MIN` for values of type `i32`), then the minimum value will be returned again and `true` will be returned for an overflow happening.
##### Examples
Basic usage:
```
assert_eq!(2i16.overflowing_neg(), (-2, false));
assert_eq!(i16::MIN.overflowing_neg(), (i16::MIN, true));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#215-216)1.7.0 (const: 1.32.0) · #### pub const fn overflowing\_shl(self, rhs: u32) -> (i16, bool)
Shifts self left by `rhs` bits.
Returns a tuple of the shifted version of self along with a boolean indicating whether the shift value was larger than or equal to the number of bits. If the shift value is too large, then value is masked (N-1) where N is the number of bits, and this value is then used to perform the shift.
##### Examples
Basic usage:
```
assert_eq!(0x1i16.overflowing_shl(4), (0x10, false));
assert_eq!(0x1i32.overflowing_shl(36), (0x10, true));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#215-216)1.7.0 (const: 1.32.0) · #### pub const fn overflowing\_shr(self, rhs: u32) -> (i16, bool)
Shifts self right by `rhs` bits.
Returns a tuple of the shifted version of self along with a boolean indicating whether the shift value was larger than or equal to the number of bits. If the shift value is too large, then value is masked (N-1) where N is the number of bits, and this value is then used to perform the shift.
##### Examples
Basic usage:
```
assert_eq!(0x10i16.overflowing_shr(4), (0x1, false));
assert_eq!(0x10i32.overflowing_shr(36), (0x1, true));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#215-216)1.13.0 (const: 1.32.0) · #### pub const fn overflowing\_abs(self) -> (i16, bool)
Computes the absolute value of `self`.
Returns a tuple of the absolute version of self along with a boolean indicating whether an overflow happened. If self is the minimum value (e.g., i16::MIN for values of type i16), then the minimum value will be returned again and true will be returned for an overflow happening.
##### Examples
Basic usage:
```
assert_eq!(10i16.overflowing_abs(), (10, false));
assert_eq!((-10i16).overflowing_abs(), (10, false));
assert_eq!((i16::MIN).overflowing_abs(), (i16::MIN, true));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#215-216)1.34.0 (const: 1.50.0) · #### pub const fn overflowing\_pow(self, exp: u32) -> (i16, bool)
Raises self to the power of `exp`, using exponentiation by squaring.
Returns a tuple of the exponentiation along with a bool indicating whether an overflow happened.
##### Examples
Basic usage:
```
assert_eq!(3i16.overflowing_pow(4), (81, false));
assert_eq!(3i8.overflowing_pow(5), (-13, true));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#215-216)const: 1.50.0 · #### pub const fn pow(self, exp: u32) -> i16
Raises self to the power of `exp`, using exponentiation by squaring.
##### Examples
Basic usage:
```
let x: i16 = 2; // or any other integer type
assert_eq!(x.pow(5), 32);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#215-216)1.38.0 (const: 1.52.0) · #### pub const fn div\_euclid(self, rhs: i16) -> i16
Calculates the quotient of Euclidean division of `self` by `rhs`.
This computes the integer `q` such that `self = q * rhs + r`, with `r = self.rem_euclid(rhs)` and `0 <= r < abs(rhs)`.
In other words, the result is `self / rhs` rounded to the integer `q` such that `self >= q * rhs`. If `self > 0`, this is equal to round towards zero (the default in Rust); if `self < 0`, this is equal to round towards +/- infinity.
##### Panics
This function will panic if `rhs` is 0 or the division results in overflow.
##### Examples
Basic usage:
```
let a: i16 = 7; // or any other integer type
let b = 4;
assert_eq!(a.div_euclid(b), 1); // 7 >= 4 * 1
assert_eq!(a.div_euclid(-b), -1); // 7 >= -4 * -1
assert_eq!((-a).div_euclid(b), -2); // -7 >= 4 * -2
assert_eq!((-a).div_euclid(-b), 2); // -7 >= -4 * 2
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#215-216)1.38.0 (const: 1.52.0) · #### pub const fn rem\_euclid(self, rhs: i16) -> i16
Calculates the least nonnegative remainder of `self (mod rhs)`.
This is done as if by the Euclidean division algorithm – given `r = self.rem_euclid(rhs)`, `self = rhs * self.div_euclid(rhs) + r`, and `0 <= r < abs(rhs)`.
##### Panics
This function will panic if `rhs` is 0 or the division results in overflow.
##### Examples
Basic usage:
```
let a: i16 = 7; // or any other integer type
let b = 4;
assert_eq!(a.rem_euclid(b), 3);
assert_eq!((-a).rem_euclid(b), 1);
assert_eq!(a.rem_euclid(-b), 3);
assert_eq!((-a).rem_euclid(-b), 1);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#215-216)#### pub const fn div\_floor(self, rhs: i16) -> i16
🔬This is a nightly-only experimental API. (`int_roundings` [#88581](https://github.com/rust-lang/rust/issues/88581))
Calculates the quotient of `self` and `rhs`, rounding the result towards negative infinity.
##### Panics
This function will panic if `rhs` is zero.
###### [Overflow behavior](#overflow-behavior)
On overflow, this function will panic if overflow checks are enabled (default in debug mode) and wrap if overflow checks are disabled (default in release mode).
##### Examples
Basic usage:
```
#![feature(int_roundings)]
let a: i16 = 8;
let b = 3;
assert_eq!(a.div_floor(b), 2);
assert_eq!(a.div_floor(-b), -3);
assert_eq!((-a).div_floor(b), -3);
assert_eq!((-a).div_floor(-b), 2);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#215-216)#### pub const fn div\_ceil(self, rhs: i16) -> i16
🔬This is a nightly-only experimental API. (`int_roundings` [#88581](https://github.com/rust-lang/rust/issues/88581))
Calculates the quotient of `self` and `rhs`, rounding the result towards positive infinity.
##### Panics
This function will panic if `rhs` is zero.
###### [Overflow behavior](#overflow-behavior-1)
On overflow, this function will panic if overflow checks are enabled (default in debug mode) and wrap if overflow checks are disabled (default in release mode).
##### Examples
Basic usage:
```
#![feature(int_roundings)]
let a: i16 = 8;
let b = 3;
assert_eq!(a.div_ceil(b), 3);
assert_eq!(a.div_ceil(-b), -2);
assert_eq!((-a).div_ceil(b), -2);
assert_eq!((-a).div_ceil(-b), 3);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#215-216)#### pub const fn next\_multiple\_of(self, rhs: i16) -> i16
🔬This is a nightly-only experimental API. (`int_roundings` [#88581](https://github.com/rust-lang/rust/issues/88581))
If `rhs` is positive, calculates the smallest value greater than or equal to `self` that is a multiple of `rhs`. If `rhs` is negative, calculates the largest value less than or equal to `self` that is a multiple of `rhs`.
##### Panics
This function will panic if `rhs` is zero.
###### [Overflow behavior](#overflow-behavior-2)
On overflow, this function will panic if overflow checks are enabled (default in debug mode) and wrap if overflow checks are disabled (default in release mode).
##### Examples
Basic usage:
```
#![feature(int_roundings)]
assert_eq!(16_i16.next_multiple_of(8), 16);
assert_eq!(23_i16.next_multiple_of(8), 24);
assert_eq!(16_i16.next_multiple_of(-8), 16);
assert_eq!(23_i16.next_multiple_of(-8), 16);
assert_eq!((-16_i16).next_multiple_of(8), -16);
assert_eq!((-23_i16).next_multiple_of(8), -16);
assert_eq!((-16_i16).next_multiple_of(-8), -16);
assert_eq!((-23_i16).next_multiple_of(-8), -24);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#215-216)#### pub const fn checked\_next\_multiple\_of(self, rhs: i16) -> Option<i16>
🔬This is a nightly-only experimental API. (`int_roundings` [#88581](https://github.com/rust-lang/rust/issues/88581))
If `rhs` is positive, calculates the smallest value greater than or equal to `self` that is a multiple of `rhs`. If `rhs` is negative, calculates the largest value less than or equal to `self` that is a multiple of `rhs`. Returns `None` if `rhs` is zero or the operation would result in overflow.
##### Examples
Basic usage:
```
#![feature(int_roundings)]
assert_eq!(16_i16.checked_next_multiple_of(8), Some(16));
assert_eq!(23_i16.checked_next_multiple_of(8), Some(24));
assert_eq!(16_i16.checked_next_multiple_of(-8), Some(16));
assert_eq!(23_i16.checked_next_multiple_of(-8), Some(16));
assert_eq!((-16_i16).checked_next_multiple_of(8), Some(-16));
assert_eq!((-23_i16).checked_next_multiple_of(8), Some(-16));
assert_eq!((-16_i16).checked_next_multiple_of(-8), Some(-16));
assert_eq!((-23_i16).checked_next_multiple_of(-8), Some(-24));
assert_eq!(1_i16.checked_next_multiple_of(0), None);
assert_eq!(i16::MAX.checked_next_multiple_of(2), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#215-216)#### pub const fn ilog(self, base: i16) -> u32
🔬This is a nightly-only experimental API. (`int_log` [#70887](https://github.com/rust-lang/rust/issues/70887))
Returns the logarithm of the number with respect to an arbitrary base, rounded down.
This method might not be optimized owing to implementation details; `ilog2` can produce results more efficiently for base 2, and `ilog10` can produce results more efficiently for base 10.
##### Panics
When the number is negative, zero, or if the base is not at least 2; it panics in debug mode and the return value is 0 in release mode.
##### Examples
```
#![feature(int_log)]
assert_eq!(5i16.ilog(5), 1);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#215-216)#### 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.
##### Panics
When the number is negative or zero it panics in debug mode and the return value is 0 in release mode.
##### Examples
```
#![feature(int_log)]
assert_eq!(2i16.ilog2(), 1);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#215-216)#### 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.
##### Panics
When the number is negative or zero it panics in debug mode and the return value is 0 in release mode.
##### Example
```
#![feature(int_log)]
assert_eq!(10i16.ilog10(), 1);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#215-216)#### pub const fn checked\_ilog(self, base: i16) -> Option<u32>
🔬This is a nightly-only experimental API. (`int_log` [#70887](https://github.com/rust-lang/rust/issues/70887))
Returns the logarithm of the number with respect to an arbitrary base, rounded down.
Returns `None` if the number is negative or zero, or if the base is not at least 2.
This method might not be optimized owing to implementation details; `checked_ilog2` can produce results more efficiently for base 2, and `checked_ilog10` can produce results more efficiently for base 10.
##### Examples
```
#![feature(int_log)]
assert_eq!(5i16.checked_ilog(5), Some(1));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#215-216)#### pub const fn checked\_ilog2(self) -> Option<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.
Returns `None` if the number is negative or zero.
##### Examples
```
#![feature(int_log)]
assert_eq!(2i16.checked_ilog2(), Some(1));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#215-216)#### pub const fn checked\_ilog10(self) -> Option<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.
Returns `None` if the number is negative or zero.
##### Example
```
#![feature(int_log)]
assert_eq!(10i16.checked_ilog10(), Some(1));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#215-216)const: 1.32.0 · #### pub const fn abs(self) -> i16
Computes the absolute value of `self`.
##### Overflow behavior
The absolute value of `i16::MIN` cannot be represented as an `i16`, and attempting to calculate it will cause an overflow. This means that code in debug mode will trigger a panic on this case and optimized code will return `i16::MIN` without a panic.
##### Examples
Basic usage:
```
assert_eq!(10i16.abs(), 10);
assert_eq!((-10i16).abs(), 10);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#215-216)1.60.0 (const: 1.60.0) · #### pub const fn abs\_diff(self, other: i16) -> u16
Computes the absolute difference between `self` and `other`.
This function always returns the correct answer without overflow or panics by returning an unsigned integer.
##### Examples
Basic usage:
```
assert_eq!(100i16.abs_diff(80), 20u16);
assert_eq!(100i16.abs_diff(110), 10u16);
assert_eq!((-100i16).abs_diff(80), 180u16);
assert_eq!((-100i16).abs_diff(-120), 20u16);
assert_eq!(i16::MIN.abs_diff(i16::MAX), u16::MAX);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#215-216)const: 1.47.0 · #### pub const fn signum(self) -> i16
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:
```
assert_eq!(10i16.signum(), 1);
assert_eq!(0i16.signum(), 0);
assert_eq!((-10i16).signum(), -1);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#215-216)const: 1.32.0 · #### pub const fn is\_positive(self) -> bool
Returns `true` if `self` is positive and `false` if the number is zero or negative.
##### Examples
Basic usage:
```
assert!(10i16.is_positive());
assert!(!(-10i16).is_positive());
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#215-216)const: 1.32.0 · #### pub const fn is\_negative(self) -> bool
Returns `true` if `self` is negative and `false` if the number is zero or positive.
##### Examples
Basic usage:
```
assert!((-10i16).is_negative());
assert!(!10i16.is_negative());
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#215-216)1.32.0 (const: 1.44.0) · #### pub const fn to\_be\_bytes(self) -> [u8; 2]
Return the memory representation of this integer as a byte array in big-endian (network) byte order.
##### Examples
```
let bytes = 0x1234i16.to_be_bytes();
assert_eq!(bytes, [0x12, 0x34]);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#215-216)1.32.0 (const: 1.44.0) · #### pub const fn to\_le\_bytes(self) -> [u8; 2]
Return the memory representation of this integer as a byte array in little-endian byte order.
##### Examples
```
let bytes = 0x1234i16.to_le_bytes();
assert_eq!(bytes, [0x34, 0x12]);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#215-216)1.32.0 (const: 1.44.0) · #### pub const fn to\_ne\_bytes(self) -> [u8; 2]
Return the memory representation of this integer as a byte array in native byte order.
As the target platform’s native endianness is used, portable code should use [`to_be_bytes`](primitive.i16#method.to_be_bytes) or [`to_le_bytes`](primitive.i16#method.to_le_bytes), as appropriate, instead.
##### Examples
```
let bytes = 0x1234i16.to_ne_bytes();
assert_eq!(
bytes,
if cfg!(target_endian = "big") {
[0x12, 0x34]
} else {
[0x34, 0x12]
}
);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#215-216)1.32.0 (const: 1.44.0) · #### pub const fn from\_be\_bytes(bytes: [u8; 2]) -> i16
Create an integer value from its representation as a byte array in big endian.
##### Examples
```
let value = i16::from_be_bytes([0x12, 0x34]);
assert_eq!(value, 0x1234);
```
When starting from a slice rather than an array, fallible conversion APIs can be used:
```
fn read_be_i16(input: &mut &[u8]) -> i16 {
let (int_bytes, rest) = input.split_at(std::mem::size_of::<i16>());
*input = rest;
i16::from_be_bytes(int_bytes.try_into().unwrap())
}
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#215-216)1.32.0 (const: 1.44.0) · #### pub const fn from\_le\_bytes(bytes: [u8; 2]) -> i16
Create an integer value from its representation as a byte array in little endian.
##### Examples
```
let value = i16::from_le_bytes([0x34, 0x12]);
assert_eq!(value, 0x1234);
```
When starting from a slice rather than an array, fallible conversion APIs can be used:
```
fn read_le_i16(input: &mut &[u8]) -> i16 {
let (int_bytes, rest) = input.split_at(std::mem::size_of::<i16>());
*input = rest;
i16::from_le_bytes(int_bytes.try_into().unwrap())
}
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#215-216)1.32.0 (const: 1.44.0) · #### pub const fn from\_ne\_bytes(bytes: [u8; 2]) -> i16
Create an integer value from its memory representation as a byte array in native endianness.
As the target platform’s native endianness is used, portable code likely wants to use [`from_be_bytes`](primitive.i16#method.from_be_bytes) or [`from_le_bytes`](primitive.i16#method.from_le_bytes), as appropriate instead.
##### Examples
```
let value = i16::from_ne_bytes(if cfg!(target_endian = "big") {
[0x12, 0x34]
} else {
[0x34, 0x12]
});
assert_eq!(value, 0x1234);
```
When starting from a slice rather than an array, fallible conversion APIs can be used:
```
fn read_ne_i16(input: &mut &[u8]) -> i16 {
let (int_bytes, rest) = input.split_at(std::mem::size_of::<i16>());
*input = rest;
i16::from_ne_bytes(int_bytes.try_into().unwrap())
}
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#215-216)const: 1.32.0 · #### pub const fn min\_value() -> i16
👎Deprecating in a future Rust version: replaced by the `MIN` associated constant on this type
New code should prefer to use [`i16::MIN`](primitive.i16#associatedconstant.MIN "i16::MIN") instead.
Returns the smallest value that can be represented by this integer type.
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#215-216)const: 1.32.0 · #### pub const fn max\_value() -> i16
👎Deprecating in a future Rust version: replaced by the `MAX` associated constant on this type
New code should prefer to use [`i16::MAX`](primitive.i16#associatedconstant.MAX "i16::MAX") instead.
Returns the largest value that can be represented by this integer type.
Trait Implementations
---------------------
[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
The resulting type after applying the `+` operator.
[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") · #### fn add(self, other: &i16) -> <i16 as Add<i16>>::Output
Performs the `+` operation. [Read more](ops/trait.add#tymethod.add)
[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
The resulting type after applying the `+` operator.
[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") · #### fn add(self, other: &i16) -> <i16 as Add<i16>>::Output
Performs the `+` operation. [Read more](ops/trait.add#tymethod.add)
[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
The resulting type after applying the `+` operator.
[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") · #### fn add(self, other: i16) -> <i16 as Add<i16>>::Output
Performs the `+` operation. [Read more](ops/trait.add#tymethod.add)
[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
The resulting type after applying the `+` operator.
[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") · #### fn add(self, other: i16) -> i16
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<&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/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/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/ops/arith.rs.html#786)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/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/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/ops/arith.rs.html#786)1.8.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/ops/arith.rs.html#786)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/fmt/num.rs.html#176)### impl Binary for i16
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#176)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error>
Formats the value using the given formatter.
[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
The resulting type after applying the `&` operator.
[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") · #### fn bitand(self, other: &i16) -> <i16 as BitAnd<i16>>::Output
Performs the `&` operation. [Read more](ops/trait.bitand#tymethod.bitand)
[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
The resulting type after applying the `&` operator.
[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") · #### fn bitand(self, other: &i16) -> <i16 as BitAnd<i16>>::Output
Performs the `&` operation. [Read more](ops/trait.bitand#tymethod.bitand)
[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
The resulting type after applying the `&` operator.
[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") · #### fn bitand(self, other: i16) -> <i16 as BitAnd<i16>>::Output
Performs the `&` operation. [Read more](ops/trait.bitand#tymethod.bitand)
[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
The resulting type after applying the `&` operator.
[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") · #### fn bitand(self, rhs: i16) -> i16
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<&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/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/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/ops/bit.rs.html#734)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/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/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/ops/bit.rs.html#734)1.8.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/ops/bit.rs.html#734)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/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
The resulting type after applying the `|` operator.
[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") · #### fn bitor(self, other: &i16) -> <i16 as BitOr<i16>>::Output
Performs the `|` operation. [Read more](ops/trait.bitor#tymethod.bitor)
[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
The resulting type after applying the `|` operator.
[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") · #### fn bitor(self, other: &i16) -> <i16 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 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/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
The resulting type after applying the `|` operator.
[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") · #### fn bitor(self, other: i16) -> <i16 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 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/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
The resulting type after applying the `|` operator.
[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") · #### fn bitor(self, rhs: i16) -> i16
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<&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/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/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/ops/bit.rs.html#806)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/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/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/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/ops/bit.rs.html#806)1.8.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/ops/bit.rs.html#806)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/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
The resulting type after applying the `^` operator.
[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") · #### fn bitxor(self, other: &i16) -> <i16 as BitXor<i16>>::Output
Performs the `^` operation. [Read more](ops/trait.bitxor#tymethod.bitxor)
[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
The resulting type after applying the `^` operator.
[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") · #### fn bitxor(self, other: &i16) -> <i16 as BitXor<i16>>::Output
Performs the `^` operation. [Read more](ops/trait.bitxor#tymethod.bitxor)
[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
The resulting type after applying the `^` operator.
[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") · #### fn bitxor(self, other: i16) -> <i16 as BitXor<i16>>::Output
Performs the `^` operation. [Read more](ops/trait.bitxor#tymethod.bitxor)
[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
The resulting type after applying the `^` operator.
[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") · #### fn bitxor(self, other: i16) -> i16
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<&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/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/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/ops/bit.rs.html#878)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/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/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/ops/bit.rs.html#878)1.8.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/ops/bit.rs.html#878)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/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") · #### fn clone(&self) -> i16
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/num.rs.html#197-200)### impl Debug for i16
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#197-200)#### 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/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#216)const: [unstable](https://github.com/rust-lang/rust/issues/87864 "Tracking issue for const_default_impls") · #### fn default() -> i16
Returns the default value of `0`
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#461-464)### impl Display for i16
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#461-464)#### 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/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
The resulting type after applying the `/` operator.
[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") · #### fn div(self, other: &i16) -> <i16 as Div<i16>>::Output
Performs the `/` operation. [Read more](ops/trait.div#tymethod.div)
[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
The resulting type after applying the `/` operator.
[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") · #### fn div(self, other: &i16) -> <i16 as Div<i16>>::Output
Performs the `/` operation. [Read more](ops/trait.div#tymethod.div)
[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
The resulting type after applying the `/` operator.
[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") · #### fn div(self, other: i16) -> <i16 as Div<i16>>::Output
Performs the `/` operation. [Read more](ops/trait.div#tymethod.div)
[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
The resulting type after applying the `/` operator.
[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") · #### fn div(self, other: i16) -> i16
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<&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/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/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/ops/arith.rs.html#968)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/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/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/ops/arith.rs.html#968)1.8.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/ops/arith.rs.html#968)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/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#93)1.28.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<bool> for i16
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#93)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: bool) -> i16
Converts a `bool` to a `i16`. The resulting value is `0` for `false` and `1` for `true` values.
##### Examples
```
assert_eq!(i16::from(true), 1);
assert_eq!(i16::from(false), 0);
```
[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/87852 "Tracking issue for const_num_from_num")) · ### impl From<i16> for AtomicI16
[source](https://doc.rust-lang.org/src/core/sync/atomic.rs.html#2715-2733)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(v: i16) -> AtomicI16
Converts an `i16` into an `AtomicI16`.
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#157)1.6.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<i16> for f32
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#157)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: i16) -> f32
Converts `i16` to `f32` losslessly.
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#158)1.6.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<i16> for f64
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#158)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: i16) -> f64
Converts `i16` to `f64` losslessly.
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#120)1.26.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<i16> for i128
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#120)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: i16) -> i128
Converts `i16` to `i128` losslessly.
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#118)1.5.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<i16> for i32
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#118)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: i16) -> i32
Converts `i16` to `i32` losslessly.
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#119)1.5.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<i16> for i64
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#119)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: i16) -> i64
Converts `i16` to `i64` losslessly.
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#142)1.26.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<i16> for isize
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#142)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: i16) -> isize
Converts `i16` to `isize` losslessly.
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#113)1.5.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<i8> for i16
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#113)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: i8) -> i16
Converts `i8` to `i16` losslessly.
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#126)1.5.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<u8> for i16
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#126)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: u8) -> i16
Converts `u8` to `i16` losslessly.
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#1018)### impl FromStr for i16
#### type Err = ParseIntError
The associated error which can be returned from parsing.
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#1018)#### fn from\_str(src: &str) -> Result<i16, ParseIntError>
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/hash/mod.rs.html#829-842)### impl Hash for i16
[source](https://doc.rust-lang.org/src/core/hash/mod.rs.html#829-842)#### 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#829-842)#### fn hash\_slice<H>(data: &[i16], 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/fmt/num.rs.html#465-468)1.42.0 · ### impl LowerExp for i16
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#465-468)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error>
Formats the value using the given formatter.
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#176)### impl LowerHex for i16
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#176)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error>
Formats the value using the given formatter.
[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
The resulting type after applying the `*` operator.
[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") · #### fn mul(self, other: &i16) -> <i16 as Mul<i16>>::Output
Performs the `*` operation. [Read more](ops/trait.mul#tymethod.mul)
[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
The resulting type after applying the `*` operator.
[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") · #### fn mul(self, other: &i16) -> <i16 as Mul<i16>>::Output
Performs the `*` operation. [Read more](ops/trait.mul#tymethod.mul)
[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
The resulting type after applying the `*` operator.
[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") · #### fn mul(self, other: i16) -> <i16 as Mul<i16>>::Output
Performs the `*` operation. [Read more](ops/trait.mul#tymethod.mul)
[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
The resulting type after applying the `*` operator.
[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") · #### fn mul(self, other: i16) -> i16
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<&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/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/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/ops/arith.rs.html#911)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/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/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/ops/arith.rs.html#911)1.8.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/ops/arith.rs.html#911)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/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
The resulting type after applying the `-` operator.
[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") · #### fn neg(self) -> <i16 as Neg>::Output
Performs the unary `-` operation. [Read more](ops/trait.neg#tymethod.neg)
[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
The resulting type after applying the `-` operator.
[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") · #### fn neg(self) -> i16
Performs the unary `-` operation. [Read more](ops/trait.neg#tymethod.neg)
[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
The resulting type after applying the `!` operator.
[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") · #### fn not(self) -> <i16 as Not>::Output
Performs the unary `!` operation. [Read more](ops/trait.not#tymethod.not)
[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
The resulting type after applying the `!` operator.
[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") · #### fn not(self) -> i16
Performs the unary `!` operation. [Read more](ops/trait.not#tymethod.not)
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#176)### impl Octal for i16
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#176)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error>
Formats the value using the given formatter.
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1486)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · ### impl Ord for i16
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1486)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · #### fn cmp(&self, other: &i16) -> 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/cmp.rs.html#1366-1368)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · ### impl PartialEq<i16> for i16
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1366-1368)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · #### fn eq(&self, other: &i16) -> 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#1366-1368)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · #### fn ne(&self, other: &i16) -> 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/cmp.rs.html#1486)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · ### impl PartialOrd<i16> for i16
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1486)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · #### fn partial\_cmp(&self, other: &i16) -> 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#1486)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · #### fn lt(&self, other: &i16) -> 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#1486)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · #### fn le(&self, other: &i16) -> 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#1486)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · #### fn ge(&self, other: &i16) -> 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/cmp.rs.html#1486)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · #### fn gt(&self, other: &i16) -> 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/iter/traits/accum.rs.html#141)1.12.0 · ### impl<'a> Product<&'a i16> for i16
[source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)#### fn product<I>(iter: I) -> i16where I: [Iterator](iter/trait.iterator "trait std::iter::Iterator")<Item = &'a [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.12.0 · ### impl Product<i16> for i16
[source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)#### fn product<I>(iter: I) -> i16where I: [Iterator](iter/trait.iterator "trait std::iter::Iterator")<Item = [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/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
The resulting type after applying the `%` operator.
[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") · #### fn rem(self, other: &i16) -> <i16 as Rem<i16>>::Output
Performs the `%` operation. [Read more](ops/trait.rem#tymethod.rem)
[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
The resulting type after applying the `%` operator.
[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") · #### fn rem(self, other: &i16) -> <i16 as Rem<i16>>::Output
Performs the `%` operation. [Read more](ops/trait.rem#tymethod.rem)
[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
The resulting type after applying the `%` operator.
[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") · #### fn rem(self, other: i16) -> <i16 as Rem<i16>>::Output
Performs the `%` operation. [Read more](ops/trait.rem#tymethod.rem)
[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
The resulting type after applying the `%` operator.
[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") · #### fn rem(self, other: i16) -> i16
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<&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/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/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/ops/arith.rs.html#1029)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/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/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/ops/arith.rs.html#1029)1.8.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/ops/arith.rs.html#1029)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/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i128) -> <i16 as Shl<i128>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i128) -> <i16 as Shl<i128>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i16) -> <i128 as Shl<i16>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i16) -> <i16 as Shl<i16>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i16) -> <i32 as Shl<i16>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i16) -> <i64 as Shl<i16>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i16) -> <i8 as Shl<i16>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i16) -> <isize as Shl<i16>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i16) -> <u128 as Shl<i16>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i16) -> <u16 as Shl<i16>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i16) -> <u32 as Shl<i16>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i16) -> <u64 as Shl<i16>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i16) -> <u8 as Shl<i16>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i16) -> <usize as Shl<i16>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i16) -> <i128 as Shl<i16>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i16) -> <i16 as Shl<i16>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i16) -> <i32 as Shl<i16>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i16) -> <i64 as Shl<i16>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i16) -> <i8 as Shl<i16>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i16) -> <isize as Shl<i16>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i16) -> <u128 as Shl<i16>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i16) -> <u16 as Shl<i16>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i16) -> <u32 as Shl<i16>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i16) -> <u64 as Shl<i16>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i16) -> <u8 as Shl<i16>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i16) -> <usize as Shl<i16>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i32) -> <i16 as Shl<i32>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i32) -> <i16 as Shl<i32>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i64) -> <i16 as Shl<i64>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i64) -> <i16 as Shl<i64>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i8) -> <i16 as Shl<i8>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i8) -> <i16 as Shl<i8>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &isize) -> <i16 as Shl<isize>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &isize) -> <i16 as Shl<isize>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u128) -> <i16 as Shl<u128>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u128) -> <i16 as Shl<u128>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u16) -> <i16 as Shl<u16>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u16) -> <i16 as Shl<u16>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u32) -> <i16 as Shl<u32>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u32) -> <i16 as Shl<u32>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u64) -> <i16 as Shl<u64>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u64) -> <i16 as Shl<u64>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u8) -> <i16 as Shl<u8>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u8) -> <i16 as Shl<u8>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &usize) -> <i16 as Shl<usize>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &usize) -> <i16 as Shl<usize>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i128) -> <i16 as Shl<i128>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i128) -> i16
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i16) -> <i128 as Shl<i16>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i16) -> <i16 as Shl<i16>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i16) -> <i32 as Shl<i16>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i16) -> <i64 as Shl<i16>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i16) -> <i8 as Shl<i16>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i16) -> <isize as Shl<i16>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i16) -> <u128 as Shl<i16>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i16) -> <u16 as Shl<i16>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i16) -> <u32 as Shl<i16>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i16) -> <u64 as Shl<i16>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i16) -> <u8 as Shl<i16>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i16) -> <usize as Shl<i16>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i16) -> i128
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i16) -> i16
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i16) -> i32
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i16) -> i64
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i16) -> i8
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i16) -> isize
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i16) -> u128
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i16) -> u16
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i16) -> u32
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i16) -> u64
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i16) -> u8
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i16) -> usize
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i32) -> <i16 as Shl<i32>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i32) -> i16
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i64) -> <i16 as Shl<i64>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i64) -> i16
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i8) -> <i16 as Shl<i8>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i8) -> i16
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: isize) -> <i16 as Shl<isize>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: isize) -> i16
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u128) -> <i16 as Shl<u128>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u128) -> i16
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u16) -> <i16 as Shl<u16>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u16) -> i16
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u32) -> <i16 as Shl<u32>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u32) -> i16
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u64) -> <i16 as Shl<u64>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u64) -> i16
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u8) -> <i16 as Shl<u8>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u8) -> i16
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: usize) -> <i16 as Shl<usize>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: usize) -> i16
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &i128)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &i16)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &i16)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &i16)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &i16)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &i16)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &i16)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &i16)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &i16)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &i16)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &i16)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &i16)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &i16)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &i32)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &i64)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &i8)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &isize)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &u128)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &u16)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &u32)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &u64)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &u8)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)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/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: i128)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: i16)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: i16)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: i16)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: i16)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: i16)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: i16)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: i16)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: i16)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: i16)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: i16)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: i16)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: i16)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: i32)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: i64)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: i8)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: isize)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: u128)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: u16)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: u32)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: u64)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: u8)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)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/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i128) -> <i16 as Shr<i128>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i128) -> <i16 as Shr<i128>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i16) -> <i128 as Shr<i16>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i16) -> <i16 as Shr<i16>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i16) -> <i32 as Shr<i16>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i16) -> <i64 as Shr<i16>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i16) -> <i8 as Shr<i16>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i16) -> <isize as Shr<i16>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i16) -> <u128 as Shr<i16>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i16) -> <u16 as Shr<i16>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i16) -> <u32 as Shr<i16>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i16) -> <u64 as Shr<i16>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i16) -> <u8 as Shr<i16>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i16) -> <usize as Shr<i16>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i16) -> <i128 as Shr<i16>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i16) -> <i16 as Shr<i16>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i16) -> <i32 as Shr<i16>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i16) -> <i64 as Shr<i16>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i16) -> <i8 as Shr<i16>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i16) -> <isize as Shr<i16>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i16) -> <u128 as Shr<i16>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i16) -> <u16 as Shr<i16>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i16) -> <u32 as Shr<i16>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i16) -> <u64 as Shr<i16>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i16) -> <u8 as Shr<i16>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i16) -> <usize as Shr<i16>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i32) -> <i16 as Shr<i32>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i32) -> <i16 as Shr<i32>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i64) -> <i16 as Shr<i64>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i64) -> <i16 as Shr<i64>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i8) -> <i16 as Shr<i8>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i8) -> <i16 as Shr<i8>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &isize) -> <i16 as Shr<isize>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &isize) -> <i16 as Shr<isize>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u128) -> <i16 as Shr<u128>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u128) -> <i16 as Shr<u128>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u16) -> <i16 as Shr<u16>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u16) -> <i16 as Shr<u16>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u32) -> <i16 as Shr<u32>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u32) -> <i16 as Shr<u32>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u64) -> <i16 as Shr<u64>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u64) -> <i16 as Shr<u64>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u8) -> <i16 as Shr<u8>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u8) -> <i16 as Shr<u8>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &usize) -> <i16 as Shr<usize>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &usize) -> <i16 as Shr<usize>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i128) -> <i16 as Shr<i128>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i128) -> i16
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i16) -> <i128 as Shr<i16>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i16) -> <i16 as Shr<i16>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i16) -> <i32 as Shr<i16>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i16) -> <i64 as Shr<i16>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i16) -> <i8 as Shr<i16>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i16) -> <isize as Shr<i16>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i16) -> <u128 as Shr<i16>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i16) -> <u16 as Shr<i16>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i16) -> <u32 as Shr<i16>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i16) -> <u64 as Shr<i16>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i16) -> <u8 as Shr<i16>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i16) -> <usize as Shr<i16>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i16) -> i128
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i16) -> i16
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i16) -> i32
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i16) -> i64
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i16) -> i8
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i16) -> isize
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i16) -> u128
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i16) -> u16
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i16) -> u32
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i16) -> u64
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i16) -> u8
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i16) -> usize
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i32) -> <i16 as Shr<i32>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i32) -> i16
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i64) -> <i16 as Shr<i64>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i64) -> i16
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i8) -> <i16 as Shr<i8>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i8) -> i16
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: isize) -> <i16 as Shr<isize>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: isize) -> i16
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u128) -> <i16 as Shr<u128>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u128) -> i16
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u16) -> <i16 as Shr<u16>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u16) -> i16
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u32) -> <i16 as Shr<u32>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u32) -> i16
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u64) -> <i16 as Shr<u64>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u64) -> i16
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u8) -> <i16 as Shr<u8>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u8) -> i16
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: usize) -> <i16 as Shr<usize>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: usize) -> i16
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &i128)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &i16)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &i16)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &i16)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &i16)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &i16)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &i16)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &i16)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &i16)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &i16)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &i16)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &i16)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &i16)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &i32)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &i64)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &i8)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &isize)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &u128)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &u16)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &u32)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &u64)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &u8)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)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/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: i128)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: i16)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: i16)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: i16)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: i16)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: i16)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: i16)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: i16)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: i16)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: i16)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: i16)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: i16)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: i16)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: i32)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: i64)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: i8)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: isize)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: u128)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: u16)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: u32)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: u64)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: u8)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)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/up/up/portable-simd/crates/core_simd/src/vector.rs.html#705)### impl SimdElement for i16
#### type Mask = i16
🔬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.
[source](https://doc.rust-lang.org/src/core/iter/range.rs.html#391-394)### impl Step for i16
[source](https://doc.rust-lang.org/src/core/iter/range.rs.html#391-394)#### unsafe fn forward\_unchecked(start: i16, n: usize) -> i16
🔬This is a nightly-only experimental API. (`step_trait` [#42168](https://github.com/rust-lang/rust/issues/42168))
Returns the value that would be obtained by taking the *successor* of `self` `count` times. [Read more](iter/trait.step#method.forward_unchecked)
[source](https://doc.rust-lang.org/src/core/iter/range.rs.html#391-394)#### unsafe fn backward\_unchecked(start: i16, n: usize) -> i16
🔬This is a nightly-only experimental API. (`step_trait` [#42168](https://github.com/rust-lang/rust/issues/42168))
Returns the value that would be obtained by taking the *predecessor* of `self` `count` times. [Read more](iter/trait.step#method.backward_unchecked)
[source](https://doc.rust-lang.org/src/core/iter/range.rs.html#391-394)#### fn forward(start: i16, n: usize) -> i16
🔬This is a nightly-only experimental API. (`step_trait` [#42168](https://github.com/rust-lang/rust/issues/42168))
Returns the value that would be obtained by taking the *successor* of `self` `count` times. [Read more](iter/trait.step#method.forward)
[source](https://doc.rust-lang.org/src/core/iter/range.rs.html#391-394)#### fn backward(start: i16, n: usize) -> i16
🔬This is a nightly-only experimental API. (`step_trait` [#42168](https://github.com/rust-lang/rust/issues/42168))
Returns the value that would be obtained by taking the *predecessor* of `self` `count` times. [Read more](iter/trait.step#method.backward)
[source](https://doc.rust-lang.org/src/core/iter/range.rs.html#391-394)#### fn steps\_between(start: &i16, end: &i16) -> Option<usize>
🔬This is a nightly-only experimental API. (`step_trait` [#42168](https://github.com/rust-lang/rust/issues/42168))
Returns the number of *successor* steps required to get from `start` to `end`. [Read more](iter/trait.step#tymethod.steps_between)
[source](https://doc.rust-lang.org/src/core/iter/range.rs.html#391-394)#### fn forward\_checked(start: i16, n: usize) -> Option<i16>
🔬This is a nightly-only experimental API. (`step_trait` [#42168](https://github.com/rust-lang/rust/issues/42168))
Returns the value that would be obtained by taking the *successor* of `self` `count` times. [Read more](iter/trait.step#tymethod.forward_checked)
[source](https://doc.rust-lang.org/src/core/iter/range.rs.html#391-394)#### fn backward\_checked(start: i16, n: usize) -> Option<i16>
🔬This is a nightly-only experimental API. (`step_trait` [#42168](https://github.com/rust-lang/rust/issues/42168))
Returns the value that would be obtained by taking the *predecessor* of `self` `count` times. [Read more](iter/trait.step#tymethod.backward_checked)
[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
The resulting type after applying the `-` operator.
[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") · #### fn sub(self, other: &i16) -> <i16 as Sub<i16>>::Output
Performs the `-` operation. [Read more](ops/trait.sub#tymethod.sub)
[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
The resulting type after applying the `-` operator.
[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") · #### fn sub(self, other: &i16) -> <i16 as Sub<i16>>::Output
Performs the `-` operation. [Read more](ops/trait.sub#tymethod.sub)
[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
The resulting type after applying the `-` operator.
[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") · #### fn sub(self, other: i16) -> <i16 as Sub<i16>>::Output
Performs the `-` operation. [Read more](ops/trait.sub#tymethod.sub)
[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
The resulting type after applying the `-` operator.
[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") · #### fn sub(self, other: i16) -> i16
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<&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/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/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/ops/arith.rs.html#853)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/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/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/ops/arith.rs.html#853)1.8.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/ops/arith.rs.html#853)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/iter/traits/accum.rs.html#141)1.12.0 · ### impl<'a> Sum<&'a i16> for i16
[source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)#### fn sum<I>(iter: I) -> i16where I: [Iterator](iter/trait.iterator "trait std::iter::Iterator")<Item = &'a [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.12.0 · ### impl Sum<i16> for i16
[source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)#### fn sum<I>(iter: I) -> i16where I: [Iterator](iter/trait.iterator "trait std::iter::Iterator")<Item = [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/convert/num.rs.html#276)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<i128> for i16
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#276)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: i128) -> Result<i16, <i16 as TryFrom<i128>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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/convert/num.rs.html#273)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<i16> for i8
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#273)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: i16) -> Result<i8, <i8 as TryFrom<i16>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#287)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<i16> for u128
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#287)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: i16) -> Result<u128, <u128 as TryFrom<i16>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#287)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<i16> for u16
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#287)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: i16) -> Result<u16, <u16 as TryFrom<i16>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#287)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<i16> for u32
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#287)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: i16) -> Result<u32, <u32 as TryFrom<i16>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#287)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<i16> for u64
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#287)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: i16) -> Result<u64, <u64 as TryFrom<i16>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#291)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<i16> for u8
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#291)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: i16) -> Result<u8, <u8 as TryFrom<i16>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#366)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<i16> for usize
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#366)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: i16) -> Result<usize, <usize as TryFrom<i16>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#274)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<i32> for i16
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#274)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: i32) -> Result<i16, <i16 as TryFrom<i32>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#275)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<i64> for i16
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#275)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: i64) -> Result<i16, <i16 as TryFrom<i64>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#361)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<isize> for i16
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#361)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: isize) -> Result<i16, <i16 as TryFrom<isize>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#283)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<u128> for i16
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#283)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: u128) -> Result<i16, <i16 as TryFrom<u128>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#280)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<u16> for i16
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#280)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: u16) -> Result<i16, <i16 as TryFrom<u16>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#281)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<u32> for i16
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#281)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: u32) -> Result<i16, <i16 as TryFrom<u32>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#282)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<u64> for i16
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#282)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: u64) -> Result<i16, <i16 as TryFrom<u64>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#356)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<usize> for i16
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#356)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: usize) -> Result<i16, <i16 as TryFrom<usize>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### type Error = TryFromIntError
The type returned in the event of a conversion error.
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#465-468)1.42.0 · ### impl UpperExp for i16
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#465-468)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error>
Formats the value using the given formatter.
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#176)### impl UpperHex for i16
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#176)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error>
Formats the value using the given formatter.
[source](https://doc.rust-lang.org/src/core/marker.rs.html#830-835)### impl Copy for i16
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1377)### impl Eq for i16
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#38)### impl FloatToInt<i16> for f32
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#39)### impl FloatToInt<i16> for f64
[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/iter/range.rs.html#17)### impl TrustedStep for i16
Auto Trait Implementations
--------------------------
### impl RefUnwindSafe for i16
### impl Send for i16
### impl Sync for i16
### impl Unpin for i16
### impl UnwindSafe for i16
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 Keyword loop Keyword loop
============
Loop indefinitely.
`loop` is used to define the simplest kind of loop supported in Rust. It runs the code inside it until the code uses `break` or the program exits.
```
loop {
println!("hello world forever!");
}
let mut i = 1;
loop {
println!("i is {i}");
if i > 100 {
break;
}
i *= 2;
}
assert_eq!(i, 128);
```
Unlike the other kinds of loops in Rust (`while`, `while let`, and `for`), loops can be used as expressions that return values via `break`.
```
let mut i = 1;
let something = loop {
i *= 2;
if i > 100 {
break i;
}
};
assert_eq!(something, 128);
```
Every `break` in a loop has to have the same type. When it’s not explicitly giving something, `break;` returns `()`.
For more information on `loop` and loops in general, see the [Reference](../reference/expressions/loop-expr).
See also, [`for`](keyword.for), [`while`](keyword.while).
rust Keyword trait Keyword trait
=============
A common interface for a group of types.
A `trait` is like an interface that data types can implement. When a type implements a trait it can be treated abstractly as that trait using generics or trait objects.
Traits can be made up of three varieties of associated items:
* functions and methods
* types
* constants
Traits may also contain additional type parameters. Those type parameters or the trait itself can be constrained by other traits.
Traits can serve as markers or carry other logical semantics that aren’t expressed through their items. When a type implements that trait it is promising to uphold its contract. [`Send`](marker/trait.send "Send") and [`Sync`](marker/trait.sync "Sync") are two such marker traits present in the standard library.
See the [Reference](../reference/items/traits) for a lot more information on traits.
Examples
--------
Traits are declared using the `trait` keyword. Types can implement them using [`impl`](keyword.impl) `Trait` [`for`](keyword.for) `Type`:
```
trait Zero {
const ZERO: Self;
fn is_zero(&self) -> bool;
}
impl Zero for i32 {
const ZERO: Self = 0;
fn is_zero(&self) -> bool {
*self == Self::ZERO
}
}
assert_eq!(i32::ZERO, 0);
assert!(i32::ZERO.is_zero());
assert!(!4.is_zero());
```
With an associated type:
```
trait Builder {
type Built;
fn build(&self) -> Self::Built;
}
```
Traits can be generic, with constraints or without:
```
trait MaybeFrom<T> {
fn maybe_from(value: T) -> Option<Self>
where
Self: Sized;
}
```
Traits can build upon the requirements of other traits. In the example below `Iterator` is a **supertrait** and `ThreeIterator` is a **subtrait**:
```
trait ThreeIterator: std::iter::Iterator {
fn next_three(&mut self) -> Option<[Self::Item; 3]>;
}
```
Traits can be used in functions, as parameters:
```
fn debug_iter<I: Iterator>(it: I) where I::Item: std::fmt::Debug {
for elem in it {
println!("{elem:#?}");
}
}
// u8_len_1, u8_len_2 and u8_len_3 are equivalent
fn u8_len_1(val: impl Into<Vec<u8>>) -> usize {
val.into().len()
}
fn u8_len_2<T: Into<Vec<u8>>>(val: T) -> usize {
val.into().len()
}
fn u8_len_3<T>(val: T) -> usize
where
T: Into<Vec<u8>>,
{
val.into().len()
}
```
Or as return types:
```
fn from_zero_to(v: u8) -> impl Iterator<Item = u8> {
(0..v).into_iter()
}
```
The use of the [`impl`](keyword.impl) keyword in this position allows the function writer to hide the concrete type as an implementation detail which can change without breaking user’s code.
Trait objects
-------------
A *trait object* is an opaque value of another type that implements a set of traits. A trait object implements all specified traits as well as their supertraits (if any).
The syntax is the following: `dyn BaseTrait + AutoTrait1 + ... AutoTraitN`. Only one `BaseTrait` can be used so this will not compile:
ⓘ
```
trait A {}
trait B {}
let _: Box<dyn A + B>;
```
Neither will this, which is a syntax error:
ⓘ
```
trait A {}
trait B {}
let _: Box<dyn A + dyn B>;
```
On the other hand, this is correct:
```
trait A {}
let _: Box<dyn A + Send + Sync>;
```
The [Reference](../reference/types/trait-object) has more information about trait objects, their limitations and the differences between editions.
Unsafe traits
-------------
Some traits may be unsafe to implement. Using the [`unsafe`](keyword.unsafe) keyword in front of the trait’s declaration is used to mark this:
```
unsafe trait UnsafeTrait {}
unsafe impl UnsafeTrait for i32 {}
```
Differences between the 2015 and 2018 editions
----------------------------------------------
In the 2015 edition the parameters pattern was not needed for traits:
ⓘ
```
trait Tr {
fn f(i32);
}
```
This behavior is no longer valid in edition 2018.
rust Keyword return Keyword return
==============
Return a value from a function.
A `return` marks the end of an execution path in a function:
```
fn foo() -> i32 {
return 3;
}
assert_eq!(foo(), 3);
```
`return` is not needed when the returned value is the last expression in the function. In this case the `;` is omitted:
```
fn foo() -> i32 {
3
}
assert_eq!(foo(), 3);
```
`return` returns from the function immediately (an “early return”):
```
use std::fs::File;
use std::io::{Error, ErrorKind, Read, Result};
fn main() -> Result<()> {
let mut file = match File::open("foo.txt") {
Ok(f) => f,
Err(e) => return Err(e),
};
let mut contents = String::new();
let size = match file.read_to_string(&mut contents) {
Ok(s) => s,
Err(e) => return Err(e),
};
if contents.contains("impossible!") {
return Err(Error::new(ErrorKind::Other, "oh no!"));
}
if size > 9000 {
return Err(Error::new(ErrorKind::Other, "over 9000!"));
}
assert_eq!(contents, "Hello, world!");
Ok(())
}
```
rust Primitive Type fn Primitive Type fn
=================
Function pointers, like `fn(usize) -> bool`.
*See also the traits [`Fn`](ops/trait.fn), [`FnMut`](ops/trait.fnmut), and [`FnOnce`](ops/trait.fnonce).*
Function pointers are pointers that point to *code*, not data. They can be called just like functions. Like references, function pointers are, among other things, assumed to not be null, so if you want to pass a function pointer over FFI and be able to accommodate null pointers, make your type [`Option<fn()>`](option/index#options-and-pointers-nullable-pointers) with your required signature.
#### Safety
Plain function pointers are obtained by casting either plain functions, or closures that don’t capture an environment:
```
fn add_one(x: usize) -> usize {
x + 1
}
let ptr: fn(usize) -> usize = add_one;
assert_eq!(ptr(5), 6);
let clos: fn(usize) -> usize = |x| x + 5;
assert_eq!(clos(5), 10);
```
In addition to varying based on their signature, function pointers come in two flavors: safe and unsafe. Plain `fn()` function pointers can only point to safe functions, while `unsafe fn()` function pointers can point to safe or unsafe functions.
```
fn add_one(x: usize) -> usize {
x + 1
}
unsafe fn add_one_unsafely(x: usize) -> usize {
x + 1
}
let safe_ptr: fn(usize) -> usize = add_one;
//ERROR: mismatched types: expected normal fn, found unsafe fn
//let bad_ptr: fn(usize) -> usize = add_one_unsafely;
let unsafe_ptr: unsafe fn(usize) -> usize = add_one_unsafely;
let really_safe_ptr: unsafe fn(usize) -> usize = add_one;
```
#### ABI
On top of that, function pointers can vary based on what ABI they use. This is achieved by adding the `extern` keyword before the type, followed by the ABI in question. The default ABI is “Rust”, i.e., `fn()` is the exact same type as `extern "Rust" fn()`. A pointer to a function with C ABI would have type `extern "C" fn()`.
`extern "ABI" { ... }` blocks declare functions with ABI “ABI”. The default here is “C”, i.e., functions declared in an `extern {...}` block have “C” ABI.
For more information and a list of supported ABIs, see [the nomicon’s section on foreign calling conventions](https://doc.rust-lang.org/nomicon/ffi.html#foreign-calling-conventions).
#### Variadic functions
Extern function declarations with the “C” or “cdecl” ABIs can also be *variadic*, allowing them to be called with a variable number of arguments. Normal Rust functions, even those with an `extern "ABI"`, cannot be variadic. For more information, see [the nomicon’s section on variadic functions](https://doc.rust-lang.org/nomicon/ffi.html#variadic-functions).
#### Creating function pointers
When `bar` is the name of a function, then the expression `bar` is *not* a function pointer. Rather, it denotes a value of an unnameable type that uniquely identifies the function `bar`. The value is zero-sized because the type already identifies the function. This has the advantage that “calling” the value (it implements the `Fn*` traits) does not require dynamic dispatch.
This zero-sized type *coerces* to a regular function pointer. For example:
```
use std::mem;
fn bar(x: i32) {}
let not_bar_ptr = bar; // `not_bar_ptr` is zero-sized, uniquely identifying `bar`
assert_eq!(mem::size_of_val(¬_bar_ptr), 0);
let bar_ptr: fn(i32) = not_bar_ptr; // force coercion to function pointer
assert_eq!(mem::size_of_val(&bar_ptr), mem::size_of::<usize>());
let footgun = &bar; // this is a shared reference to the zero-sized type identifying `bar`
```
The last line shows that `&bar` is not a function pointer either. Rather, it is a reference to the function-specific ZST. `&bar` is basically never what you want when `bar` is a function.
#### Casting to and from integers
You cast function pointers directly to integers:
```
let fnptr: fn(i32) -> i32 = |x| x+2;
let fnptr_addr = fnptr as usize;
```
However, a direct cast back is not possible. You need to use `transmute`:
```
let fnptr = fnptr_addr as *const ();
let fnptr: fn(i32) -> i32 = unsafe { std::mem::transmute(fnptr) };
assert_eq!(fnptr(40), 42);
```
Crucially, we `as`-cast to a raw pointer before `transmute`ing to a function pointer. This avoids an integer-to-pointer `transmute`, which can be problematic. Transmuting between raw pointers and function pointers (i.e., two pointer types) is fine.
Note that all of this is not portable to platforms where function pointers and data pointers have different sizes.
#### Trait implementations
In this documentation the shorthand `fn (T₁, T₂, …, Tₙ)` is used to represent non-variadic function pointers of varying length. Note that this is a convenience notation to avoid repetitive documentation, not valid Rust syntax.
Due to a temporary restriction in Rust’s type system, these traits are only implemented on functions that take 12 arguments or less, with the `"Rust"` and `"C"` ABIs. In the future, this may change:
* [`PartialEq`](cmp/trait.partialeq "PartialEq")
* [`Eq`](cmp/trait.eq "Eq")
* [`PartialOrd`](cmp/trait.partialord "PartialOrd")
* [`Ord`](cmp/trait.ord "Ord")
* [`Hash`](hash/trait.hash)
* [`Pointer`](fmt/trait.pointer)
* [`Debug`](fmt/macro.debug "Debug")
The following traits are implemented for function pointers with any number of arguments and any ABI. These traits have implementations that are automatically generated by the compiler, so are not limited by missing language features:
* [`Clone`](clone/trait.clone "Clone")
* [`Copy`](marker/trait.copy "Copy")
* [`Send`](marker/trait.send "Send")
* [`Sync`](marker/trait.sync "Sync")
* [`Unpin`](marker/trait.unpin "Unpin")
* [`UnwindSafe`](panic/trait.unwindsafe)
* [`RefUnwindSafe`](panic/trait.refunwindsafe)
In addition, all *safe* function pointers implement [`Fn`](ops/trait.fn), [`FnMut`](ops/trait.fnmut), and [`FnOnce`](ops/trait.fnonce), because these traits are specially known to the compiler.
Trait Implementations
---------------------
[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/std/primitive_docs.rs.html#1540-1542)#### 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/core/ptr/mod.rs.html#1949)1.4.0 · ### impl<Ret, T> Debug for extern "C" fn (T₁, T₂, …, Tₙ, ...) -> Ret
This trait is implemented for function pointers with up to twelve arguments.
[source](https://doc.rust-lang.org/src/core/ptr/mod.rs.html#1949)#### 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/mod.rs.html#1949)1.4.0 · ### impl<Ret, T> Debug for extern "C" fn (T₁, T₂, …, Tₙ) -> Ret
This trait is implemented for function pointers with up to twelve arguments.
[source](https://doc.rust-lang.org/src/core/ptr/mod.rs.html#1949)#### 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/mod.rs.html#1949)1.4.0 · ### impl<Ret, T> Debug for fn (T₁, T₂, …, Tₙ) -> Ret
This trait is implemented for function pointers with up to twelve arguments.
[source](https://doc.rust-lang.org/src/core/ptr/mod.rs.html#1949)#### 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/mod.rs.html#1949)1.4.0 · ### impl<Ret, T> Debug for unsafe extern "C" fn (T₁, T₂, …, Tₙ, ...) -> Ret
This trait is implemented for function pointers with up to twelve arguments.
[source](https://doc.rust-lang.org/src/core/ptr/mod.rs.html#1949)#### 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/mod.rs.html#1949)1.4.0 · ### impl<Ret, T> Debug for unsafe extern "C" fn (T₁, T₂, …, Tₙ) -> Ret
This trait is implemented for function pointers with up to twelve arguments.
[source](https://doc.rust-lang.org/src/core/ptr/mod.rs.html#1949)#### 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/mod.rs.html#1949)1.4.0 · ### impl<Ret, T> Debug for unsafe fn (T₁, T₂, …, Tₙ) -> Ret
This trait is implemented for function pointers with up to twelve arguments.
[source](https://doc.rust-lang.org/src/core/ptr/mod.rs.html#1949)#### 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/mod.rs.html#1949)1.4.0 · ### impl<Ret, T> Hash for extern "C" fn (T₁, T₂, …, Tₙ, ...) -> Ret
This trait is implemented for function pointers with up to twelve arguments.
[source](https://doc.rust-lang.org/src/core/ptr/mod.rs.html#1949)#### fn hash<HH>(&self, state: &mut HH)where HH: [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/mod.rs.html#1949)1.4.0 · ### impl<Ret, T> Hash for extern "C" fn (T₁, T₂, …, Tₙ) -> Ret
This trait is implemented for function pointers with up to twelve arguments.
[source](https://doc.rust-lang.org/src/core/ptr/mod.rs.html#1949)#### fn hash<HH>(&self, state: &mut HH)where HH: [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/mod.rs.html#1949)1.4.0 · ### impl<Ret, T> Hash for fn (T₁, T₂, …, Tₙ) -> Ret
This trait is implemented for function pointers with up to twelve arguments.
[source](https://doc.rust-lang.org/src/core/ptr/mod.rs.html#1949)#### fn hash<HH>(&self, state: &mut HH)where HH: [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/mod.rs.html#1949)1.4.0 · ### impl<Ret, T> Hash for unsafe extern "C" fn (T₁, T₂, …, Tₙ, ...) -> Ret
This trait is implemented for function pointers with up to twelve arguments.
[source](https://doc.rust-lang.org/src/core/ptr/mod.rs.html#1949)#### fn hash<HH>(&self, state: &mut HH)where HH: [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/mod.rs.html#1949)1.4.0 · ### impl<Ret, T> Hash for unsafe extern "C" fn (T₁, T₂, …, Tₙ) -> Ret
This trait is implemented for function pointers with up to twelve arguments.
[source](https://doc.rust-lang.org/src/core/ptr/mod.rs.html#1949)#### fn hash<HH>(&self, state: &mut HH)where HH: [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/mod.rs.html#1949)1.4.0 · ### impl<Ret, T> Hash for unsafe fn (T₁, T₂, …, Tₙ) -> Ret
This trait is implemented for function pointers with up to twelve arguments.
[source](https://doc.rust-lang.org/src/core/ptr/mod.rs.html#1949)#### fn hash<HH>(&self, state: &mut HH)where HH: [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/mod.rs.html#1949)1.4.0 · ### impl<Ret, T> Ord for extern "C" fn (T₁, T₂, …, Tₙ, ...) -> Ret
This trait is implemented for function pointers with up to twelve arguments.
[source](https://doc.rust-lang.org/src/core/ptr/mod.rs.html#1949)#### fn cmp(&self, other: &extern "C" fn(T, ...) -> Ret) -> 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/mod.rs.html#1949)1.4.0 · ### impl<Ret, T> Ord for extern "C" fn (T₁, T₂, …, Tₙ) -> Ret
This trait is implemented for function pointers with up to twelve arguments.
[source](https://doc.rust-lang.org/src/core/ptr/mod.rs.html#1949)#### fn cmp(&self, other: &extern "C" fn(T) -> Ret) -> 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/mod.rs.html#1949)1.4.0 · ### impl<Ret, T> Ord for fn (T₁, T₂, …, Tₙ) -> Ret
This trait is implemented for function pointers with up to twelve arguments.
[source](https://doc.rust-lang.org/src/core/ptr/mod.rs.html#1949)#### fn cmp(&self, other: &fn(T) -> Ret) -> 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/mod.rs.html#1949)1.4.0 · ### impl<Ret, T> Ord for unsafe extern "C" fn (T₁, T₂, …, Tₙ, ...) -> Ret
This trait is implemented for function pointers with up to twelve arguments.
[source](https://doc.rust-lang.org/src/core/ptr/mod.rs.html#1949)#### fn cmp(&self, other: &unsafe extern "C" fn(T, ...) -> Ret) -> 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/mod.rs.html#1949)1.4.0 · ### impl<Ret, T> Ord for unsafe extern "C" fn (T₁, T₂, …, Tₙ) -> Ret
This trait is implemented for function pointers with up to twelve arguments.
[source](https://doc.rust-lang.org/src/core/ptr/mod.rs.html#1949)#### fn cmp(&self, other: &unsafe extern "C" fn(T) -> Ret) -> 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/mod.rs.html#1949)1.4.0 · ### impl<Ret, T> Ord for unsafe fn (T₁, T₂, …, Tₙ) -> Ret
This trait is implemented for function pointers with up to twelve arguments.
[source](https://doc.rust-lang.org/src/core/ptr/mod.rs.html#1949)#### fn cmp(&self, other: &unsafe fn(T) -> Ret) -> 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/mod.rs.html#1949)1.4.0 · ### impl<Ret, T> PartialEq<extern "C" fn(T, ...) -> Ret> for extern "C" fn (T₁, T₂, …, Tₙ, ...) -> Ret
This trait is implemented for function pointers with up to twelve arguments.
[source](https://doc.rust-lang.org/src/core/ptr/mod.rs.html#1949)#### fn eq(&self, other: &extern "C" fn(T, ...) -> Ret) -> 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/ptr/mod.rs.html#1949)1.4.0 · ### impl<Ret, T> PartialEq<extern "C" fn(T) -> Ret> for extern "C" fn (T₁, T₂, …, Tₙ) -> Ret
This trait is implemented for function pointers with up to twelve arguments.
[source](https://doc.rust-lang.org/src/core/ptr/mod.rs.html#1949)#### fn eq(&self, other: &extern "C" fn(T) -> Ret) -> 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/ptr/mod.rs.html#1949)1.4.0 · ### impl<Ret, T> PartialEq<fn(T) -> Ret> for fn (T₁, T₂, …, Tₙ) -> Ret
This trait is implemented for function pointers with up to twelve arguments.
[source](https://doc.rust-lang.org/src/core/ptr/mod.rs.html#1949)#### fn eq(&self, other: &fn(T) -> Ret) -> 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/ptr/mod.rs.html#1949)1.4.0 · ### impl<Ret, T> PartialEq<unsafe extern "C" fn(T, ...) -> Ret> for unsafe extern "C" fn (T₁, T₂, …, Tₙ, ...) -> Ret
This trait is implemented for function pointers with up to twelve arguments.
[source](https://doc.rust-lang.org/src/core/ptr/mod.rs.html#1949)#### fn eq(&self, other: &unsafe extern "C" fn(T, ...) -> Ret) -> 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/ptr/mod.rs.html#1949)1.4.0 · ### impl<Ret, T> PartialEq<unsafe extern "C" fn(T) -> Ret> for unsafe extern "C" fn (T₁, T₂, …, Tₙ) -> Ret
This trait is implemented for function pointers with up to twelve arguments.
[source](https://doc.rust-lang.org/src/core/ptr/mod.rs.html#1949)#### fn eq(&self, other: &unsafe extern "C" fn(T) -> Ret) -> 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/ptr/mod.rs.html#1949)1.4.0 · ### impl<Ret, T> PartialEq<unsafe fn(T) -> Ret> for unsafe fn (T₁, T₂, …, Tₙ) -> Ret
This trait is implemented for function pointers with up to twelve arguments.
[source](https://doc.rust-lang.org/src/core/ptr/mod.rs.html#1949)#### fn eq(&self, other: &unsafe fn(T) -> Ret) -> 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/ptr/mod.rs.html#1949)1.4.0 · ### impl<Ret, T> PartialOrd<extern "C" fn(T, ...) -> Ret> for extern "C" fn (T₁, T₂, …, Tₙ, ...) -> Ret
This trait is implemented for function pointers with up to twelve arguments.
[source](https://doc.rust-lang.org/src/core/ptr/mod.rs.html#1949)#### fn partial\_cmp(&self, other: &extern "C" fn(T, ...) -> Ret) -> 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/ptr/mod.rs.html#1949)1.4.0 · ### impl<Ret, T> PartialOrd<extern "C" fn(T) -> Ret> for extern "C" fn (T₁, T₂, …, Tₙ) -> Ret
This trait is implemented for function pointers with up to twelve arguments.
[source](https://doc.rust-lang.org/src/core/ptr/mod.rs.html#1949)#### fn partial\_cmp(&self, other: &extern "C" fn(T) -> Ret) -> 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/ptr/mod.rs.html#1949)1.4.0 · ### impl<Ret, T> PartialOrd<fn(T) -> Ret> for fn (T₁, T₂, …, Tₙ) -> Ret
This trait is implemented for function pointers with up to twelve arguments.
[source](https://doc.rust-lang.org/src/core/ptr/mod.rs.html#1949)#### fn partial\_cmp(&self, other: &fn(T) -> Ret) -> 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/ptr/mod.rs.html#1949)1.4.0 · ### impl<Ret, T> PartialOrd<unsafe extern "C" fn(T, ...) -> Ret> for unsafe extern "C" fn (T₁, T₂, …, Tₙ, ...) -> Ret
This trait is implemented for function pointers with up to twelve arguments.
[source](https://doc.rust-lang.org/src/core/ptr/mod.rs.html#1949)#### fn partial\_cmp( &self, other: &unsafe extern "C" fn(T, ...) -> Ret) -> 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/ptr/mod.rs.html#1949)1.4.0 · ### impl<Ret, T> PartialOrd<unsafe extern "C" fn(T) -> Ret> for unsafe extern "C" fn (T₁, T₂, …, Tₙ) -> Ret
This trait is implemented for function pointers with up to twelve arguments.
[source](https://doc.rust-lang.org/src/core/ptr/mod.rs.html#1949)#### fn partial\_cmp(&self, other: &unsafe extern "C" fn(T) -> Ret) -> 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/ptr/mod.rs.html#1949)1.4.0 · ### impl<Ret, T> PartialOrd<unsafe fn(T) -> Ret> for unsafe fn (T₁, T₂, …, Tₙ) -> Ret
This trait is implemented for function pointers with up to twelve arguments.
[source](https://doc.rust-lang.org/src/core/ptr/mod.rs.html#1949)#### fn partial\_cmp(&self, other: &unsafe fn(T) -> Ret) -> 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/ptr/mod.rs.html#1949)1.4.0 · ### impl<Ret, T> Pointer for extern "C" fn (T₁, T₂, …, Tₙ, ...) -> Ret
This trait is implemented for function pointers with up to twelve arguments.
[source](https://doc.rust-lang.org/src/core/ptr/mod.rs.html#1949)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error>
Formats the value using the given formatter.
[source](https://doc.rust-lang.org/src/core/ptr/mod.rs.html#1949)1.4.0 · ### impl<Ret, T> Pointer for extern "C" fn (T₁, T₂, …, Tₙ) -> Ret
This trait is implemented for function pointers with up to twelve arguments.
[source](https://doc.rust-lang.org/src/core/ptr/mod.rs.html#1949)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error>
Formats the value using the given formatter.
[source](https://doc.rust-lang.org/src/core/ptr/mod.rs.html#1949)1.4.0 · ### impl<Ret, T> Pointer for fn (T₁, T₂, …, Tₙ) -> Ret
This trait is implemented for function pointers with up to twelve arguments.
[source](https://doc.rust-lang.org/src/core/ptr/mod.rs.html#1949)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error>
Formats the value using the given formatter.
[source](https://doc.rust-lang.org/src/core/ptr/mod.rs.html#1949)1.4.0 · ### impl<Ret, T> Pointer for unsafe extern "C" fn (T₁, T₂, …, Tₙ, ...) -> Ret
This trait is implemented for function pointers with up to twelve arguments.
[source](https://doc.rust-lang.org/src/core/ptr/mod.rs.html#1949)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error>
Formats the value using the given formatter.
[source](https://doc.rust-lang.org/src/core/ptr/mod.rs.html#1949)1.4.0 · ### impl<Ret, T> Pointer for unsafe extern "C" fn (T₁, T₂, …, Tₙ) -> Ret
This trait is implemented for function pointers with up to twelve arguments.
[source](https://doc.rust-lang.org/src/core/ptr/mod.rs.html#1949)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error>
Formats the value using the given formatter.
[source](https://doc.rust-lang.org/src/core/ptr/mod.rs.html#1949)1.4.0 · ### impl<Ret, T> Pointer for unsafe fn (T₁, T₂, …, Tₙ) -> Ret
This trait is implemented for function pointers with up to twelve arguments.
[source](https://doc.rust-lang.org/src/core/ptr/mod.rs.html#1949)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error>
Formats the value using the given formatter.
[source](https://doc.rust-lang.org/src/std/primitive_docs.rs.html#1550-1552)### impl<Ret, T> Copy 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/ptr/mod.rs.html#1949)1.4.0 · ### impl<Ret, T> Eq for extern "C" fn (T₁, T₂, …, Tₙ, ...) -> Ret
This trait is implemented for function pointers with up to twelve arguments.
[source](https://doc.rust-lang.org/src/core/ptr/mod.rs.html#1949)1.4.0 · ### impl<Ret, T> Eq for extern "C" fn (T₁, T₂, …, Tₙ) -> Ret
This trait is implemented for function pointers with up to twelve arguments.
[source](https://doc.rust-lang.org/src/core/ptr/mod.rs.html#1949)1.4.0 · ### impl<Ret, T> Eq for fn (T₁, T₂, …, Tₙ) -> Ret
This trait is implemented for function pointers with up to twelve arguments.
[source](https://doc.rust-lang.org/src/core/ptr/mod.rs.html#1949)1.4.0 · ### impl<Ret, T> Eq for unsafe extern "C" fn (T₁, T₂, …, Tₙ, ...) -> Ret
This trait is implemented for function pointers with up to twelve arguments.
[source](https://doc.rust-lang.org/src/core/ptr/mod.rs.html#1949)1.4.0 · ### impl<Ret, T> Eq for unsafe extern "C" fn (T₁, T₂, …, Tₙ) -> Ret
This trait is implemented for function pointers with up to twelve arguments.
[source](https://doc.rust-lang.org/src/core/ptr/mod.rs.html#1949)1.4.0 · ### impl<Ret, T> Eq for unsafe fn (T₁, T₂, …, Tₙ) -> Ret
This trait is implemented for function pointers with up to twelve arguments.
Auto Trait Implementations
--------------------------
### impl<Ret, T> RefUnwindSafe for fn (T₁, T₂, …, Tₙ) -> Ret
### impl<Ret, T> Send for fn (T₁, T₂, …, Tₙ) -> Ret
### impl<Ret, T> Sync for fn (T₁, T₂, …, Tₙ) -> Ret
### impl<Ret, T> Unpin for fn (T₁, T₂, …, Tₙ) -> Ret
### impl<Ret, T> UnwindSafe for fn (T₁, T₂, …, Tₙ) -> Ret
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/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/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 Primitive Type usize Primitive Type usize
====================
The pointer-sized unsigned integer type.
The size of this primitive is how many bytes it takes to reference any location in memory. For example, on a 32 bit target, this is 4 bytes and on a 64 bit target, this is 8 bytes.
Implementations
---------------
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#901)### impl usize
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#902-907)1.43.0 · #### pub const MIN: usize = 0usize
The smallest value that can be represented by this integer type.
##### Examples
Basic usage:
```
assert_eq!(usize::MIN, 0);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#902-907)1.43.0 · #### pub const MAX: usize = 18\_446\_744\_073\_709\_551\_615usize
The largest value that can be represented by this integer type (264 − 1 on 64-bit targets)
##### Examples
Basic usage:
```
assert_eq!(usize::MAX, 18446744073709551615);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#902-907)1.53.0 · #### pub const BITS: u32 = 64u32
The size of this integer type in bits.
##### Examples
```
assert_eq!(usize::BITS, 64);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#902-907)#### pub fn from\_str\_radix(src: &str, radix: u32) -> Result<usize, ParseIntError>
Converts a string slice in a given base to an integer.
The string is expected to be an optional `+` sign followed by digits. Leading and trailing whitespace represent an error. Digits are a subset of these characters, depending on `radix`:
* `0-9`
* `a-z`
* `A-Z`
##### Panics
This function panics if `radix` is not in the range from 2 to 36.
##### Examples
Basic usage:
```
assert_eq!(usize::from_str_radix("A", 16), Ok(10));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#902-907)const: 1.32.0 · #### pub const fn count\_ones(self) -> u32
Returns the number of ones in the binary representation of `self`.
##### Examples
Basic usage:
```
let n = 0b01001100usize;
assert_eq!(n.count_ones(), 3);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#902-907)const: 1.32.0 · #### pub const fn count\_zeros(self) -> u32
Returns the number of zeros in the binary representation of `self`.
##### Examples
Basic usage:
```
assert_eq!(usize::MAX.count_zeros(), 0);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#902-907)const: 1.32.0 · #### pub const fn leading\_zeros(self) -> u32
Returns the number of leading zeros in the binary representation of `self`.
##### Examples
Basic usage:
```
let n = usize::MAX >> 2;
assert_eq!(n.leading_zeros(), 2);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#902-907)const: 1.32.0 · #### pub const fn trailing\_zeros(self) -> u32
Returns the number of trailing zeros in the binary representation of `self`.
##### Examples
Basic usage:
```
let n = 0b0101000usize;
assert_eq!(n.trailing_zeros(), 3);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#902-907)1.46.0 (const: 1.46.0) · #### pub const fn leading\_ones(self) -> u32
Returns the number of leading ones in the binary representation of `self`.
##### Examples
Basic usage:
```
let n = !(usize::MAX >> 2);
assert_eq!(n.leading_ones(), 2);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#902-907)1.46.0 (const: 1.46.0) · #### pub const fn trailing\_ones(self) -> u32
Returns the number of trailing ones in the binary representation of `self`.
##### Examples
Basic usage:
```
let n = 0b1010111usize;
assert_eq!(n.trailing_ones(), 3);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#902-907)const: 1.32.0 · #### pub const fn rotate\_left(self, n: u32) -> usize
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:
```
let n = 0xaa00000000006e1usize;
let m = 0x6e10aa;
assert_eq!(n.rotate_left(12), m);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#902-907)const: 1.32.0 · #### pub const fn rotate\_right(self, n: u32) -> usize
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:
```
let n = 0x6e10aausize;
let m = 0xaa00000000006e1;
assert_eq!(n.rotate_right(12), m);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#902-907)const: 1.32.0 · #### pub const fn swap\_bytes(self) -> usize
Reverses the byte order of the integer.
##### Examples
Basic usage:
```
let n = 0x1234567890123456usize;
let m = n.swap_bytes();
assert_eq!(m, 0x5634129078563412);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#902-907)1.37.0 (const: 1.37.0) · #### pub const fn reverse\_bits(self) -> usize
Reverses the order of bits in the integer. The least significant bit becomes the most significant bit, second least-significant bit becomes second most-significant bit, etc.
##### Examples
Basic usage:
```
let n = 0x1234567890123456usize;
let m = n.reverse_bits();
assert_eq!(m, 0x6a2c48091e6a2c48);
assert_eq!(0, 0usize.reverse_bits());
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#902-907)const: 1.32.0 · #### pub const fn from\_be(x: usize) -> usize
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:
```
let n = 0x1Ausize;
if cfg!(target_endian = "big") {
assert_eq!(usize::from_be(n), n)
} else {
assert_eq!(usize::from_be(n), n.swap_bytes())
}
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#902-907)const: 1.32.0 · #### pub const fn from\_le(x: usize) -> usize
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:
```
let n = 0x1Ausize;
if cfg!(target_endian = "little") {
assert_eq!(usize::from_le(n), n)
} else {
assert_eq!(usize::from_le(n), n.swap_bytes())
}
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#902-907)const: 1.32.0 · #### pub const fn to\_be(self) -> usize
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:
```
let n = 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/mod.rs.html#902-907)const: 1.32.0 · #### pub const fn to\_le(self) -> usize
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:
```
let n = 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/mod.rs.html#902-907)const: 1.47.0 · #### pub const fn checked\_add(self, rhs: usize) -> Option<usize>
Checked integer addition. Computes `self + rhs`, returning `None` if overflow occurred.
##### Examples
Basic usage:
```
assert_eq!((usize::MAX - 2).checked_add(1), Some(usize::MAX - 1));
assert_eq!((usize::MAX - 2).checked_add(3), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#902-907)const: [unstable](https://github.com/rust-lang/rust/issues/85122 "Tracking issue for const_inherent_unchecked_arith") · #### pub unsafe fn unchecked\_add(self, rhs: usize) -> usize
🔬This is a nightly-only experimental API. (`unchecked_math` [#85122](https://github.com/rust-lang/rust/issues/85122))
Unchecked integer addition. Computes `self + rhs`, assuming overflow cannot occur.
##### Safety
This results in undefined behavior when `self + rhs > usize::MAX` or `self + rhs < usize::MIN`, i.e. when [`checked_add`](primitive.usize#method.checked_add) would return `None`.
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#902-907)const: [unstable](https://github.com/rust-lang/rust/issues/87840 "Tracking issue for mixed_integer_ops") · #### pub fn checked\_add\_signed(self, rhs: isize) -> Option<usize>
🔬This is a nightly-only experimental API. (`mixed_integer_ops` [#87840](https://github.com/rust-lang/rust/issues/87840))
Checked addition with a signed integer. Computes `self + rhs`, returning `None` if overflow occurred.
##### Examples
Basic usage:
```
assert_eq!(1usize.checked_add_signed(2), Some(3));
assert_eq!(1usize.checked_add_signed(-2), None);
assert_eq!((usize::MAX - 2).checked_add_signed(3), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#902-907)const: 1.47.0 · #### pub const fn checked\_sub(self, rhs: usize) -> Option<usize>
Checked integer subtraction. Computes `self - rhs`, returning `None` if overflow occurred.
##### Examples
Basic usage:
```
assert_eq!(1usize.checked_sub(1), Some(0));
assert_eq!(0usize.checked_sub(1), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#902-907)const: [unstable](https://github.com/rust-lang/rust/issues/85122 "Tracking issue for const_inherent_unchecked_arith") · #### pub unsafe fn unchecked\_sub(self, rhs: usize) -> usize
🔬This is a nightly-only experimental API. (`unchecked_math` [#85122](https://github.com/rust-lang/rust/issues/85122))
Unchecked integer subtraction. Computes `self - rhs`, assuming overflow cannot occur.
##### Safety
This results in undefined behavior when `self - rhs > usize::MAX` or `self - rhs < usize::MIN`, i.e. when [`checked_sub`](primitive.usize#method.checked_sub) would return `None`.
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#902-907)const: 1.47.0 · #### pub const fn checked\_mul(self, rhs: usize) -> Option<usize>
Checked integer multiplication. Computes `self * rhs`, returning `None` if overflow occurred.
##### Examples
Basic usage:
```
assert_eq!(5usize.checked_mul(1), Some(5));
assert_eq!(usize::MAX.checked_mul(2), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#902-907)const: [unstable](https://github.com/rust-lang/rust/issues/85122 "Tracking issue for const_inherent_unchecked_arith") · #### pub unsafe fn unchecked\_mul(self, rhs: usize) -> usize
🔬This is a nightly-only experimental API. (`unchecked_math` [#85122](https://github.com/rust-lang/rust/issues/85122))
Unchecked integer multiplication. Computes `self * rhs`, assuming overflow cannot occur.
##### Safety
This results in undefined behavior when `self * rhs > usize::MAX` or `self * rhs < usize::MIN`, i.e. when [`checked_mul`](primitive.usize#method.checked_mul) would return `None`.
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#902-907)const: 1.52.0 · #### pub const fn checked\_div(self, rhs: usize) -> Option<usize>
Checked integer division. Computes `self / rhs`, returning `None` if `rhs == 0`.
##### Examples
Basic usage:
```
assert_eq!(128usize.checked_div(2), Some(64));
assert_eq!(1usize.checked_div(0), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#902-907)1.38.0 (const: 1.52.0) · #### pub const fn checked\_div\_euclid(self, rhs: usize) -> Option<usize>
Checked Euclidean division. Computes `self.div_euclid(rhs)`, returning `None` if `rhs == 0`.
##### Examples
Basic usage:
```
assert_eq!(128usize.checked_div_euclid(2), Some(64));
assert_eq!(1usize.checked_div_euclid(0), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#902-907)1.7.0 (const: 1.52.0) · #### pub const fn checked\_rem(self, rhs: usize) -> Option<usize>
Checked integer remainder. Computes `self % rhs`, returning `None` if `rhs == 0`.
##### Examples
Basic usage:
```
assert_eq!(5usize.checked_rem(2), Some(1));
assert_eq!(5usize.checked_rem(0), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#902-907)1.38.0 (const: 1.52.0) · #### pub const fn checked\_rem\_euclid(self, rhs: usize) -> Option<usize>
Checked Euclidean modulo. Computes `self.rem_euclid(rhs)`, returning `None` if `rhs == 0`.
##### Examples
Basic usage:
```
assert_eq!(5usize.checked_rem_euclid(2), Some(1));
assert_eq!(5usize.checked_rem_euclid(0), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#902-907)#### pub const fn ilog(self, base: usize) -> u32
🔬This is a nightly-only experimental API. (`int_log` [#70887](https://github.com/rust-lang/rust/issues/70887))
Returns the logarithm of the number with respect to an arbitrary base, rounded down.
This method might not be optimized owing to implementation details; `ilog2` can produce results more efficiently for base 2, and `ilog10` can produce results more efficiently for base 10.
##### Panics
When the number is zero, or if the base is not at least 2; it panics in debug mode and the return value is 0 in release mode.
##### Examples
```
#![feature(int_log)]
assert_eq!(5usize.ilog(5), 1);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#902-907)#### 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.
##### Panics
When the number is zero it panics in debug mode and the return value is 0 in release mode.
##### Examples
```
#![feature(int_log)]
assert_eq!(2usize.ilog2(), 1);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#902-907)#### 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.
##### Panics
When the number is zero it panics in debug mode and the return value is 0 in release mode.
##### Example
```
#![feature(int_log)]
assert_eq!(10usize.ilog10(), 1);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#902-907)#### pub const fn checked\_ilog(self, base: usize) -> Option<u32>
🔬This is a nightly-only experimental API. (`int_log` [#70887](https://github.com/rust-lang/rust/issues/70887))
Returns the logarithm of the number with respect to an arbitrary base, rounded down.
Returns `None` if the number is zero, or if the base is not at least 2.
This method might not be optimized owing to implementation details; `checked_ilog2` can produce results more efficiently for base 2, and `checked_ilog10` can produce results more efficiently for base 10.
##### Examples
```
#![feature(int_log)]
assert_eq!(5usize.checked_ilog(5), Some(1));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#902-907)#### pub const fn checked\_ilog2(self) -> Option<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.
Returns `None` if the number is zero.
##### Examples
```
#![feature(int_log)]
assert_eq!(2usize.checked_ilog2(), Some(1));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#902-907)#### pub const fn checked\_ilog10(self) -> Option<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.
Returns `None` if the number is zero.
##### Examples
```
#![feature(int_log)]
assert_eq!(10usize.checked_ilog10(), Some(1));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#902-907)1.7.0 (const: 1.47.0) · #### pub const fn checked\_neg(self) -> Option<usize>
Checked negation. Computes `-self`, returning `None` unless `self == 0`.
Note that negating any positive integer will overflow.
##### Examples
Basic usage:
```
assert_eq!(0usize.checked_neg(), Some(0));
assert_eq!(1usize.checked_neg(), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#902-907)1.7.0 (const: 1.47.0) · #### pub const fn checked\_shl(self, rhs: u32) -> Option<usize>
Checked shift left. Computes `self << rhs`, returning `None` if `rhs` is larger than or equal to the number of bits in `self`.
##### Examples
Basic usage:
```
assert_eq!(0x1usize.checked_shl(4), Some(0x10));
assert_eq!(0x10usize.checked_shl(129), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#902-907)const: [unstable](https://github.com/rust-lang/rust/issues/85122 "Tracking issue for const_inherent_unchecked_arith") · #### pub unsafe fn unchecked\_shl(self, rhs: usize) -> usize
🔬This is a nightly-only experimental API. (`unchecked_math` [#85122](https://github.com/rust-lang/rust/issues/85122))
Unchecked shift left. Computes `self << rhs`, assuming that `rhs` is less than the number of bits in `self`.
##### Safety
This results in undefined behavior if `rhs` is larger than or equal to the number of bits in `self`, i.e. when [`checked_shl`](primitive.usize#method.checked_shl) would return `None`.
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#902-907)1.7.0 (const: 1.47.0) · #### pub const fn checked\_shr(self, rhs: u32) -> Option<usize>
Checked shift right. Computes `self >> rhs`, returning `None` if `rhs` is larger than or equal to the number of bits in `self`.
##### Examples
Basic usage:
```
assert_eq!(0x10usize.checked_shr(4), Some(0x1));
assert_eq!(0x10usize.checked_shr(129), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#902-907)const: [unstable](https://github.com/rust-lang/rust/issues/85122 "Tracking issue for const_inherent_unchecked_arith") · #### pub unsafe fn unchecked\_shr(self, rhs: usize) -> usize
🔬This is a nightly-only experimental API. (`unchecked_math` [#85122](https://github.com/rust-lang/rust/issues/85122))
Unchecked shift right. Computes `self >> rhs`, assuming that `rhs` is less than the number of bits in `self`.
##### Safety
This results in undefined behavior if `rhs` is larger than or equal to the number of bits in `self`, i.e. when [`checked_shr`](primitive.usize#method.checked_shr) would return `None`.
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#902-907)1.34.0 (const: 1.50.0) · #### pub const fn checked\_pow(self, exp: u32) -> Option<usize>
Checked exponentiation. Computes `self.pow(exp)`, returning `None` if overflow occurred.
##### Examples
Basic usage:
```
assert_eq!(2usize.checked_pow(5), Some(32));
assert_eq!(usize::MAX.checked_pow(2), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#902-907)const: 1.47.0 · #### pub const fn saturating\_add(self, rhs: usize) -> usize
Saturating integer addition. Computes `self + rhs`, saturating at the numeric bounds instead of overflowing.
##### Examples
Basic usage:
```
assert_eq!(100usize.saturating_add(1), 101);
assert_eq!(usize::MAX.saturating_add(127), usize::MAX);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#902-907)const: [unstable](https://github.com/rust-lang/rust/issues/87840 "Tracking issue for mixed_integer_ops") · #### pub fn saturating\_add\_signed(self, rhs: isize) -> usize
🔬This is a nightly-only experimental API. (`mixed_integer_ops` [#87840](https://github.com/rust-lang/rust/issues/87840))
Saturating addition with a signed integer. Computes `self + rhs`, saturating at the numeric bounds instead of overflowing.
##### Examples
Basic usage:
```
assert_eq!(1usize.saturating_add_signed(2), 3);
assert_eq!(1usize.saturating_add_signed(-2), 0);
assert_eq!((usize::MAX - 2).saturating_add_signed(4), usize::MAX);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#902-907)const: 1.47.0 · #### pub const fn saturating\_sub(self, rhs: usize) -> usize
Saturating integer subtraction. Computes `self - rhs`, saturating at the numeric bounds instead of overflowing.
##### Examples
Basic usage:
```
assert_eq!(100usize.saturating_sub(27), 73);
assert_eq!(13usize.saturating_sub(127), 0);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#902-907)1.7.0 (const: 1.47.0) · #### pub const fn saturating\_mul(self, rhs: usize) -> usize
Saturating integer multiplication. Computes `self * rhs`, saturating at the numeric bounds instead of overflowing.
##### Examples
Basic usage:
```
assert_eq!(2usize.saturating_mul(10), 20);
assert_eq!((usize::MAX).saturating_mul(10), usize::MAX);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#902-907)1.58.0 (const: 1.58.0) · #### pub const fn saturating\_div(self, rhs: usize) -> usize
Saturating integer division. Computes `self / rhs`, saturating at the numeric bounds instead of overflowing.
##### Examples
Basic usage:
```
assert_eq!(5usize.saturating_div(2), 2);
```
ⓘ
```
let _ = 1usize.saturating_div(0);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#902-907)1.34.0 (const: 1.50.0) · #### pub const fn saturating\_pow(self, exp: u32) -> usize
Saturating integer exponentiation. Computes `self.pow(exp)`, saturating at the numeric bounds instead of overflowing.
##### Examples
Basic usage:
```
assert_eq!(4usize.saturating_pow(3), 64);
assert_eq!(usize::MAX.saturating_pow(2), usize::MAX);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#902-907)const: 1.32.0 · #### pub const fn wrapping\_add(self, rhs: usize) -> usize
Wrapping (modular) addition. Computes `self + rhs`, wrapping around at the boundary of the type.
##### Examples
Basic usage:
```
assert_eq!(200usize.wrapping_add(55), 255);
assert_eq!(200usize.wrapping_add(usize::MAX), 199);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#902-907)const: [unstable](https://github.com/rust-lang/rust/issues/87840 "Tracking issue for mixed_integer_ops") · #### pub fn wrapping\_add\_signed(self, rhs: isize) -> usize
🔬This is a nightly-only experimental API. (`mixed_integer_ops` [#87840](https://github.com/rust-lang/rust/issues/87840))
Wrapping (modular) addition with a signed integer. Computes `self + rhs`, wrapping around at the boundary of the type.
##### Examples
Basic usage:
```
assert_eq!(1usize.wrapping_add_signed(2), 3);
assert_eq!(1usize.wrapping_add_signed(-2), usize::MAX);
assert_eq!((usize::MAX - 2).wrapping_add_signed(4), 1);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#902-907)const: 1.32.0 · #### pub const fn wrapping\_sub(self, rhs: usize) -> usize
Wrapping (modular) subtraction. Computes `self - rhs`, wrapping around at the boundary of the type.
##### Examples
Basic usage:
```
assert_eq!(100usize.wrapping_sub(100), 0);
assert_eq!(100usize.wrapping_sub(usize::MAX), 101);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#902-907)const: 1.32.0 · #### pub const fn wrapping\_mul(self, rhs: usize) -> usize
Wrapping (modular) multiplication. Computes `self * rhs`, wrapping around at the boundary of the type.
##### Examples
Basic usage:
Please note that this example is shared between integer types. Which explains why `u8` is used here.
```
assert_eq!(10u8.wrapping_mul(12), 120);
assert_eq!(25u8.wrapping_mul(12), 44);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#902-907)1.2.0 (const: 1.52.0) · #### pub const fn wrapping\_div(self, rhs: usize) -> usize
Wrapping (modular) division. Computes `self / rhs`. Wrapped division on unsigned types is just normal division. There’s no way wrapping could ever happen. This function exists, so that all operations are accounted for in the wrapping operations.
##### Examples
Basic usage:
```
assert_eq!(100usize.wrapping_div(10), 10);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#902-907)1.38.0 (const: 1.52.0) · #### pub const fn wrapping\_div\_euclid(self, rhs: usize) -> usize
Wrapping Euclidean division. Computes `self.div_euclid(rhs)`. Wrapped division on unsigned types is just normal division. There’s no way wrapping could ever happen. This function exists, so that all operations are accounted for in the wrapping operations. Since, for the positive integers, all common definitions of division are equal, this is exactly equal to `self.wrapping_div(rhs)`.
##### Examples
Basic usage:
```
assert_eq!(100usize.wrapping_div_euclid(10), 10);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#902-907)1.2.0 (const: 1.52.0) · #### pub const fn wrapping\_rem(self, rhs: usize) -> usize
Wrapping (modular) remainder. Computes `self % rhs`. Wrapped remainder calculation on unsigned types is just the regular remainder calculation. There’s no way wrapping could ever happen. This function exists, so that all operations are accounted for in the wrapping operations.
##### Examples
Basic usage:
```
assert_eq!(100usize.wrapping_rem(10), 0);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#902-907)1.38.0 (const: 1.52.0) · #### pub const fn wrapping\_rem\_euclid(self, rhs: usize) -> usize
Wrapping Euclidean modulo. Computes `self.rem_euclid(rhs)`. Wrapped modulo calculation on unsigned types is just the regular remainder calculation. There’s no way wrapping could ever happen. This function exists, so that all operations are accounted for in the wrapping operations. Since, for the positive integers, all common definitions of division are equal, this is exactly equal to `self.wrapping_rem(rhs)`.
##### Examples
Basic usage:
```
assert_eq!(100usize.wrapping_rem_euclid(10), 0);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#902-907)1.2.0 (const: 1.32.0) · #### pub const fn wrapping\_neg(self) -> usize
Wrapping (modular) negation. Computes `-self`, wrapping around at the boundary of the type.
Since unsigned types do not have negative equivalents all applications of this function will wrap (except for `-0`). For values smaller than the corresponding signed type’s maximum the result is the same as casting the corresponding signed value. Any larger values are equivalent to `MAX + 1 - (val - MAX - 1)` where `MAX` is the corresponding signed type’s maximum.
##### Examples
Basic usage:
Please note that this example is shared between integer types. Which explains why `i8` is used here.
```
assert_eq!(100i8.wrapping_neg(), -100);
assert_eq!((-128i8).wrapping_neg(), -128);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#902-907)1.2.0 (const: 1.32.0) · #### pub const fn wrapping\_shl(self, rhs: u32) -> usize
Panic-free bitwise shift-left; yields `self << mask(rhs)`, where `mask` removes any high-order bits of `rhs` that would cause the shift to exceed the bitwidth of the type.
Note that this is *not* the same as a rotate-left; the RHS of a wrapping shift-left is restricted to the range of the type, rather than the bits shifted out of the LHS being returned to the other end. The primitive integer types all implement a [`rotate_left`](primitive.usize#method.rotate_left) function, which may be what you want instead.
##### Examples
Basic usage:
```
assert_eq!(1usize.wrapping_shl(7), 128);
assert_eq!(1usize.wrapping_shl(128), 1);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#902-907)1.2.0 (const: 1.32.0) · #### pub const fn wrapping\_shr(self, rhs: u32) -> usize
Panic-free bitwise shift-right; yields `self >> mask(rhs)`, where `mask` removes any high-order bits of `rhs` that would cause the shift to exceed the bitwidth of the type.
Note that this is *not* the same as a rotate-right; the RHS of a wrapping shift-right is restricted to the range of the type, rather than the bits shifted out of the LHS being returned to the other end. The primitive integer types all implement a [`rotate_right`](primitive.usize#method.rotate_right) function, which may be what you want instead.
##### Examples
Basic usage:
```
assert_eq!(128usize.wrapping_shr(7), 1);
assert_eq!(128usize.wrapping_shr(128), 128);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#902-907)1.34.0 (const: 1.50.0) · #### pub const fn wrapping\_pow(self, exp: u32) -> usize
Wrapping (modular) exponentiation. Computes `self.pow(exp)`, wrapping around at the boundary of the type.
##### Examples
Basic usage:
```
assert_eq!(3usize.wrapping_pow(5), 243);
assert_eq!(3u8.wrapping_pow(6), 217);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#902-907)1.7.0 (const: 1.32.0) · #### pub const fn overflowing\_add(self, rhs: usize) -> (usize, bool)
Calculates `self` + `rhs`
Returns a tuple of the addition along with a boolean indicating whether an arithmetic overflow would occur. If an overflow would have occurred then the wrapped value is returned.
##### Examples
Basic usage
```
assert_eq!(5usize.overflowing_add(2), (7, false));
assert_eq!(usize::MAX.overflowing_add(1), (0, true));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#902-907)const: [unstable](https://github.com/rust-lang/rust/issues/85532 "Tracking issue for const_bigint_helper_methods") · #### pub fn carrying\_add(self, rhs: usize, carry: bool) -> (usize, bool)
🔬This is a nightly-only experimental API. (`bigint_helper_methods` [#85532](https://github.com/rust-lang/rust/issues/85532))
Calculates `self + rhs + carry` without the ability to overflow.
Performs “ternary addition” which takes in an extra bit to add, and may return an additional bit of overflow. This allows for chaining together multiple additions to create “big integers” which represent larger values.
This can be thought of as a 64-bit “full adder”, in the electronics sense.
##### Examples
Basic usage
```
#![feature(bigint_helper_methods)]
assert_eq!(5usize.carrying_add(2, false), (7, false));
assert_eq!(5usize.carrying_add(2, true), (8, false));
assert_eq!(usize::MAX.carrying_add(1, false), (0, true));
assert_eq!(usize::MAX.carrying_add(0, true), (0, true));
assert_eq!(usize::MAX.carrying_add(1, true), (1, true));
assert_eq!(usize::MAX.carrying_add(usize::MAX, true), (usize::MAX, true));
```
If `carry` is false, this method is equivalent to [`overflowing_add`](primitive.usize#method.overflowing_add):
```
#![feature(bigint_helper_methods)]
assert_eq!(5_usize.carrying_add(2, false), 5_usize.overflowing_add(2));
assert_eq!(usize::MAX.carrying_add(1, false), usize::MAX.overflowing_add(1));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#902-907)const: [unstable](https://github.com/rust-lang/rust/issues/87840 "Tracking issue for mixed_integer_ops") · #### pub fn overflowing\_add\_signed(self, rhs: isize) -> (usize, bool)
🔬This is a nightly-only experimental API. (`mixed_integer_ops` [#87840](https://github.com/rust-lang/rust/issues/87840))
Calculates `self` + `rhs` with a signed `rhs`
Returns a tuple of the addition along with a boolean indicating whether an arithmetic overflow would occur. If an overflow would have occurred then the wrapped value is returned.
##### Examples
Basic usage:
```
assert_eq!(1usize.overflowing_add_signed(2), (3, false));
assert_eq!(1usize.overflowing_add_signed(-2), (usize::MAX, true));
assert_eq!((usize::MAX - 2).overflowing_add_signed(4), (1, true));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#902-907)1.7.0 (const: 1.32.0) · #### pub const fn overflowing\_sub(self, rhs: usize) -> (usize, bool)
Calculates `self` - `rhs`
Returns a tuple of the subtraction along with a boolean indicating whether an arithmetic overflow would occur. If an overflow would have occurred then the wrapped value is returned.
##### Examples
Basic usage
```
assert_eq!(5usize.overflowing_sub(2), (3, false));
assert_eq!(0usize.overflowing_sub(1), (usize::MAX, true));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#902-907)const: [unstable](https://github.com/rust-lang/rust/issues/85532 "Tracking issue for const_bigint_helper_methods") · #### pub fn borrowing\_sub(self, rhs: usize, borrow: bool) -> (usize, bool)
🔬This is a nightly-only experimental API. (`bigint_helper_methods` [#85532](https://github.com/rust-lang/rust/issues/85532))
Calculates `self - rhs - borrow` without the ability to overflow.
Performs “ternary subtraction” which takes in an extra bit to subtract, and may return an additional bit of overflow. This allows for chaining together multiple subtractions to create “big integers” which represent larger values.
##### Examples
Basic usage
```
#![feature(bigint_helper_methods)]
assert_eq!(5usize.borrowing_sub(2, false), (3, false));
assert_eq!(5usize.borrowing_sub(2, true), (2, false));
assert_eq!(0usize.borrowing_sub(1, false), (usize::MAX, true));
assert_eq!(0usize.borrowing_sub(1, true), (usize::MAX - 1, true));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#902-907)1.60.0 (const: 1.60.0) · #### pub const fn abs\_diff(self, other: usize) -> usize
Computes the absolute difference between `self` and `other`.
##### Examples
Basic usage:
```
assert_eq!(100usize.abs_diff(80), 20usize);
assert_eq!(100usize.abs_diff(110), 10usize);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#902-907)1.7.0 (const: 1.32.0) · #### pub const fn overflowing\_mul(self, rhs: usize) -> (usize, bool)
Calculates the multiplication of `self` and `rhs`.
Returns a tuple of the multiplication along with a boolean indicating whether an arithmetic overflow would occur. If an overflow would have occurred then the wrapped value is returned.
##### Examples
Basic usage:
Please note that this example is shared between integer types. Which explains why `u32` is used here.
```
assert_eq!(5u32.overflowing_mul(2), (10, false));
assert_eq!(1_000_000_000u32.overflowing_mul(10), (1410065408, true));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#902-907)1.7.0 (const: 1.52.0) · #### pub const fn overflowing\_div(self, rhs: usize) -> (usize, bool)
Calculates the divisor when `self` is divided by `rhs`.
Returns a tuple of the divisor along with a boolean indicating whether an arithmetic overflow would occur. Note that for unsigned integers overflow never occurs, so the second value is always `false`.
##### Panics
This function will panic if `rhs` is 0.
##### Examples
Basic usage
```
assert_eq!(5usize.overflowing_div(2), (2, false));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#902-907)1.38.0 (const: 1.52.0) · #### pub const fn overflowing\_div\_euclid(self, rhs: usize) -> (usize, bool)
Calculates the quotient of Euclidean division `self.div_euclid(rhs)`.
Returns a tuple of the divisor along with a boolean indicating whether an arithmetic overflow would occur. Note that for unsigned integers overflow never occurs, so the second value is always `false`. Since, for the positive integers, all common definitions of division are equal, this is exactly equal to `self.overflowing_div(rhs)`.
##### Panics
This function will panic if `rhs` is 0.
##### Examples
Basic usage
```
assert_eq!(5usize.overflowing_div_euclid(2), (2, false));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#902-907)1.7.0 (const: 1.52.0) · #### pub const fn overflowing\_rem(self, rhs: usize) -> (usize, bool)
Calculates the remainder when `self` is divided by `rhs`.
Returns a tuple of the remainder after dividing along with a boolean indicating whether an arithmetic overflow would occur. Note that for unsigned integers overflow never occurs, so the second value is always `false`.
##### Panics
This function will panic if `rhs` is 0.
##### Examples
Basic usage
```
assert_eq!(5usize.overflowing_rem(2), (1, false));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#902-907)1.38.0 (const: 1.52.0) · #### pub const fn overflowing\_rem\_euclid(self, rhs: usize) -> (usize, bool)
Calculates the remainder `self.rem_euclid(rhs)` as if by Euclidean division.
Returns a tuple of the modulo after dividing along with a boolean indicating whether an arithmetic overflow would occur. Note that for unsigned integers overflow never occurs, so the second value is always `false`. Since, for the positive integers, all common definitions of division are equal, this operation is exactly equal to `self.overflowing_rem(rhs)`.
##### Panics
This function will panic if `rhs` is 0.
##### Examples
Basic usage
```
assert_eq!(5usize.overflowing_rem_euclid(2), (1, false));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#902-907)1.7.0 (const: 1.32.0) · #### pub const fn overflowing\_neg(self) -> (usize, bool)
Negates self in an overflowing fashion.
Returns `!self + 1` using wrapping operations to return the value that represents the negation of this unsigned value. Note that for positive unsigned values overflow always occurs, but negating 0 does not overflow.
##### Examples
Basic usage
```
assert_eq!(0usize.overflowing_neg(), (0, false));
assert_eq!(2usize.overflowing_neg(), (-2i32 as usize, true));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#902-907)1.7.0 (const: 1.32.0) · #### pub const fn overflowing\_shl(self, rhs: u32) -> (usize, bool)
Shifts self left by `rhs` bits.
Returns a tuple of the shifted version of self along with a boolean indicating whether the shift value was larger than or equal to the number of bits. If the shift value is too large, then value is masked (N-1) where N is the number of bits, and this value is then used to perform the shift.
##### Examples
Basic usage
```
assert_eq!(0x1usize.overflowing_shl(4), (0x10, false));
assert_eq!(0x1usize.overflowing_shl(132), (0x10, true));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#902-907)1.7.0 (const: 1.32.0) · #### pub const fn overflowing\_shr(self, rhs: u32) -> (usize, bool)
Shifts self right by `rhs` bits.
Returns a tuple of the shifted version of self along with a boolean indicating whether the shift value was larger than or equal to the number of bits. If the shift value is too large, then value is masked (N-1) where N is the number of bits, and this value is then used to perform the shift.
##### Examples
Basic usage
```
assert_eq!(0x10usize.overflowing_shr(4), (0x1, false));
assert_eq!(0x10usize.overflowing_shr(132), (0x1, true));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#902-907)1.34.0 (const: 1.50.0) · #### pub const fn overflowing\_pow(self, exp: u32) -> (usize, bool)
Raises self to the power of `exp`, using exponentiation by squaring.
Returns a tuple of the exponentiation along with a bool indicating whether an overflow happened.
##### Examples
Basic usage:
```
assert_eq!(3usize.overflowing_pow(5), (243, false));
assert_eq!(3u8.overflowing_pow(6), (217, true));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#902-907)const: 1.50.0 · #### pub const fn pow(self, exp: u32) -> usize
Raises self to the power of `exp`, using exponentiation by squaring.
##### Examples
Basic usage:
```
assert_eq!(2usize.pow(5), 32);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#902-907)1.38.0 (const: 1.52.0) · #### pub const fn div\_euclid(self, rhs: usize) -> usize
Performs Euclidean division.
Since, for the positive integers, all common definitions of division are equal, this is exactly equal to `self / rhs`.
##### Panics
This function will panic if `rhs` is 0.
##### Examples
Basic usage:
```
assert_eq!(7usize.div_euclid(4), 1); // or any other integer type
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#902-907)1.38.0 (const: 1.52.0) · #### pub const fn rem\_euclid(self, rhs: usize) -> usize
Calculates the least remainder of `self (mod rhs)`.
Since, for the positive integers, all common definitions of division are equal, this is exactly equal to `self % rhs`.
##### Panics
This function will panic if `rhs` is 0.
##### Examples
Basic usage:
```
assert_eq!(7usize.rem_euclid(4), 3); // or any other integer type
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#902-907)#### pub const fn div\_floor(self, rhs: usize) -> usize
🔬This is a nightly-only experimental API. (`int_roundings` [#88581](https://github.com/rust-lang/rust/issues/88581))
Calculates the quotient of `self` and `rhs`, rounding the result towards negative infinity.
This is the same as performing `self / rhs` for all unsigned integers.
##### Panics
This function will panic if `rhs` is zero.
##### Examples
Basic usage:
```
#![feature(int_roundings)]
assert_eq!(7_usize.div_floor(4), 1);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#902-907)#### pub const fn div\_ceil(self, rhs: usize) -> usize
🔬This is a nightly-only experimental API. (`int_roundings` [#88581](https://github.com/rust-lang/rust/issues/88581))
Calculates the quotient of `self` and `rhs`, rounding the result towards positive infinity.
##### Panics
This function will panic if `rhs` is zero.
###### [Overflow behavior](#overflow-behavior)
On overflow, this function will panic if overflow checks are enabled (default in debug mode) and wrap if overflow checks are disabled (default in release mode).
##### Examples
Basic usage:
```
#![feature(int_roundings)]
assert_eq!(7_usize.div_ceil(4), 2);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#902-907)#### pub const fn next\_multiple\_of(self, rhs: usize) -> usize
🔬This is a nightly-only experimental API. (`int_roundings` [#88581](https://github.com/rust-lang/rust/issues/88581))
Calculates the smallest value greater than or equal to `self` that is a multiple of `rhs`.
##### Panics
This function will panic if `rhs` is zero.
###### [Overflow behavior](#overflow-behavior-1)
On overflow, this function will panic if overflow checks are enabled (default in debug mode) and wrap if overflow checks are disabled (default in release mode).
##### Examples
Basic usage:
```
#![feature(int_roundings)]
assert_eq!(16_usize.next_multiple_of(8), 16);
assert_eq!(23_usize.next_multiple_of(8), 24);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#902-907)#### pub const fn checked\_next\_multiple\_of(self, rhs: usize) -> Option<usize>
🔬This is a nightly-only experimental API. (`int_roundings` [#88581](https://github.com/rust-lang/rust/issues/88581))
Calculates the smallest value greater than or equal to `self` that is a multiple of `rhs`. Returns `None` if `rhs` is zero or the operation would result in overflow.
##### Examples
Basic usage:
```
#![feature(int_roundings)]
assert_eq!(16_usize.checked_next_multiple_of(8), Some(16));
assert_eq!(23_usize.checked_next_multiple_of(8), Some(24));
assert_eq!(1_usize.checked_next_multiple_of(0), None);
assert_eq!(usize::MAX.checked_next_multiple_of(2), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#902-907)const: 1.32.0 · #### pub const fn is\_power\_of\_two(self) -> bool
Returns `true` if and only if `self == 2^k` for some `k`.
##### Examples
Basic usage:
```
assert!(16usize.is_power_of_two());
assert!(!10usize.is_power_of_two());
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#902-907)const: 1.50.0 · #### pub const fn next\_power\_of\_two(self) -> usize
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`), it panics in debug mode and the return value is wrapped to 0 in release mode (the only situation in which method can return 0).
##### Examples
Basic usage:
```
assert_eq!(2usize.next_power_of_two(), 2);
assert_eq!(3usize.next_power_of_two(), 4);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#902-907)const: 1.50.0 · #### pub const fn checked\_next\_power\_of\_two(self) -> Option<usize>
Returns the smallest power of two greater than or equal to `n`. If the next power of two is greater than the type’s maximum value, `None` is returned, otherwise the power of two is wrapped in `Some`.
##### Examples
Basic usage:
```
assert_eq!(2usize.checked_next_power_of_two(), Some(2));
assert_eq!(3usize.checked_next_power_of_two(), Some(4));
assert_eq!(usize::MAX.checked_next_power_of_two(), None);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#902-907)const: [unstable](https://github.com/rust-lang/rust/issues/32463 "Tracking issue for wrapping_next_power_of_two") · #### pub fn wrapping\_next\_power\_of\_two(self) -> 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 `n`. If the next power of two is greater than the type’s maximum value, the return value is wrapped to `0`.
##### Examples
Basic usage:
```
#![feature(wrapping_next_power_of_two)]
assert_eq!(2usize.wrapping_next_power_of_two(), 2);
assert_eq!(3usize.wrapping_next_power_of_two(), 4);
assert_eq!(usize::MAX.wrapping_next_power_of_two(), 0);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#902-907)1.32.0 (const: 1.44.0) · #### pub const fn to\_be\_bytes(self) -> [u8; 8]
Return the memory representation of this integer as a byte array in big-endian (network) byte order.
**Note**: This function returns an array of length 2, 4 or 8 bytes depending on the target pointer size.
##### Examples
```
let bytes = 0x1234567890123456usize.to_be_bytes();
assert_eq!(bytes, [0x12, 0x34, 0x56, 0x78, 0x90, 0x12, 0x34, 0x56]);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#902-907)1.32.0 (const: 1.44.0) · #### pub const fn to\_le\_bytes(self) -> [u8; 8]
Return the memory representation of this integer as a byte array in little-endian byte order.
**Note**: This function returns an array of length 2, 4 or 8 bytes depending on the target pointer size.
##### Examples
```
let bytes = 0x1234567890123456usize.to_le_bytes();
assert_eq!(bytes, [0x56, 0x34, 0x12, 0x90, 0x78, 0x56, 0x34, 0x12]);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#902-907)1.32.0 (const: 1.44.0) · #### pub const fn to\_ne\_bytes(self) -> [u8; 8]
Return the memory representation of this integer as a byte array in native byte order.
As the target platform’s native endianness is used, portable code should use [`to_be_bytes`](primitive.usize#method.to_be_bytes) or [`to_le_bytes`](primitive.usize#method.to_le_bytes), as appropriate, instead.
**Note**: This function returns an array of length 2, 4 or 8 bytes depending on the target pointer size.
##### Examples
```
let bytes = 0x1234567890123456usize.to_ne_bytes();
assert_eq!(
bytes,
if cfg!(target_endian = "big") {
[0x12, 0x34, 0x56, 0x78, 0x90, 0x12, 0x34, 0x56]
} else {
[0x56, 0x34, 0x12, 0x90, 0x78, 0x56, 0x34, 0x12]
}
);
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#902-907)1.32.0 (const: 1.44.0) · #### pub const fn from\_be\_bytes(bytes: [u8; 8]) -> usize
Create a native endian integer value from its representation as a byte array in big endian.
**Note**: This function takes an array of length 2, 4 or 8 bytes depending on the target pointer size.
##### Examples
```
let value = usize::from_be_bytes([0x12, 0x34, 0x56, 0x78, 0x90, 0x12, 0x34, 0x56]);
assert_eq!(value, 0x1234567890123456);
```
When starting from a slice rather than an array, fallible conversion APIs can be used:
```
fn read_be_usize(input: &mut &[u8]) -> usize {
let (int_bytes, rest) = input.split_at(std::mem::size_of::<usize>());
*input = rest;
usize::from_be_bytes(int_bytes.try_into().unwrap())
}
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#902-907)1.32.0 (const: 1.44.0) · #### pub const fn from\_le\_bytes(bytes: [u8; 8]) -> usize
Create a native endian integer value from its representation as a byte array in little endian.
**Note**: This function takes an array of length 2, 4 or 8 bytes depending on the target pointer size.
##### Examples
```
let value = usize::from_le_bytes([0x56, 0x34, 0x12, 0x90, 0x78, 0x56, 0x34, 0x12]);
assert_eq!(value, 0x1234567890123456);
```
When starting from a slice rather than an array, fallible conversion APIs can be used:
```
fn read_le_usize(input: &mut &[u8]) -> usize {
let (int_bytes, rest) = input.split_at(std::mem::size_of::<usize>());
*input = rest;
usize::from_le_bytes(int_bytes.try_into().unwrap())
}
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#902-907)1.32.0 (const: 1.44.0) · #### pub const fn from\_ne\_bytes(bytes: [u8; 8]) -> usize
Create a native endian integer value from its memory representation as a byte array in native endianness.
As the target platform’s native endianness is used, portable code likely wants to use [`from_be_bytes`](primitive.usize#method.from_be_bytes) or [`from_le_bytes`](primitive.usize#method.from_le_bytes), as appropriate instead.
**Note**: This function takes an array of length 2, 4 or 8 bytes depending on the target pointer size.
##### Examples
```
let value = usize::from_ne_bytes(if cfg!(target_endian = "big") {
[0x12, 0x34, 0x56, 0x78, 0x90, 0x12, 0x34, 0x56]
} else {
[0x56, 0x34, 0x12, 0x90, 0x78, 0x56, 0x34, 0x12]
});
assert_eq!(value, 0x1234567890123456);
```
When starting from a slice rather than an array, fallible conversion APIs can be used:
```
fn read_ne_usize(input: &mut &[u8]) -> usize {
let (int_bytes, rest) = input.split_at(std::mem::size_of::<usize>());
*input = rest;
usize::from_ne_bytes(int_bytes.try_into().unwrap())
}
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#902-907)const: 1.32.0 · #### pub const fn min\_value() -> usize
👎Deprecating in a future Rust version: replaced by the `MIN` associated constant on this type
New code should prefer to use [`usize::MIN`](primitive.usize#associatedconstant.MIN "usize::MIN") instead.
Returns the smallest value that can be represented by this integer type.
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#902-907)const: 1.32.0 · #### pub const fn max\_value() -> usize
👎Deprecating in a future Rust version: replaced by the `MAX` associated constant on this type
New code should prefer to use [`usize::MAX`](primitive.usize#associatedconstant.MAX "usize::MAX") instead.
Returns the largest value that can be represented by this integer type.
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#908)const: [unstable](https://github.com/rust-lang/rust/issues/85532 "Tracking issue for const_bigint_helper_methods") · #### pub fn widening\_mul(self, rhs: usize) -> (usize, usize)
🔬This is a nightly-only experimental API. (`bigint_helper_methods` [#85532](https://github.com/rust-lang/rust/issues/85532))
Calculates the complete product `self * rhs` without the possibility to overflow.
This returns the low-order (wrapping) bits and the high-order (overflow) bits of the result as two separate values, in that order.
##### Examples
Basic usage:
Please note that this example is shared between integer types. Which explains why `u32` is used here.
```
#![feature(bigint_helper_methods)]
assert_eq!(5u32.widening_mul(2), (10, 0));
assert_eq!(1_000_000_000u32.widening_mul(10), (1410065408, 2));
```
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#908)const: [unstable](https://github.com/rust-lang/rust/issues/85532 "Tracking issue for bigint_helper_methods") · #### pub fn carrying\_mul(self, rhs: usize, carry: usize) -> (usize, usize)
🔬This is a nightly-only experimental API. (`bigint_helper_methods` [#85532](https://github.com/rust-lang/rust/issues/85532))
Calculates the “full multiplication” `self * rhs + carry` without the possibility to overflow.
This returns the low-order (wrapping) bits and the high-order (overflow) bits of the result as two separate values, in that order.
Performs “long multiplication” which takes in an extra amount to add, and may return an additional amount of overflow. This allows for chaining together multiple multiplications to create “big integers” which represent larger values.
##### Examples
Basic usage:
Please note that this example is shared between integer types. Which explains why `u32` is used here.
```
#![feature(bigint_helper_methods)]
assert_eq!(5u32.carrying_mul(2, 0), (10, 0));
assert_eq!(5u32.carrying_mul(2, 10), (20, 0));
assert_eq!(1_000_000_000u32.carrying_mul(10, 0), (1410065408, 2));
assert_eq!(1_000_000_000u32.carrying_mul(10, 10), (1410065418, 2));
assert_eq!(usize::MAX.carrying_mul(usize::MAX, usize::MAX), (0, usize::MAX));
```
If `carry` is zero, this is similar to [`overflowing_mul`](primitive.usize#method.overflowing_mul), except that it gives the value of the overflow instead of just whether one happened:
```
#![feature(bigint_helper_methods)]
let r = u8::carrying_mul(7, 13, 0);
assert_eq!((r.0, r.1 != 0), u8::overflowing_mul(7, 13));
let r = u8::carrying_mul(13, 42, 0);
assert_eq!((r.0, r.1 != 0), u8::overflowing_mul(13, 42));
```
The value of the first field in the returned tuple matches what you’d get by combining the [`wrapping_mul`](primitive.usize#method.wrapping_mul) and [`wrapping_add`](primitive.usize#method.wrapping_add) methods:
```
#![feature(bigint_helper_methods)]
assert_eq!(
789_u16.carrying_mul(456, 123).0,
789_u16.wrapping_mul(456).wrapping_add(123),
);
```
Trait Implementations
---------------------
[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
The resulting type after applying the `+` operator.
[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") · #### fn add(self, other: &usize) -> <usize as Add<usize>>::Output
Performs the `+` operation. [Read more](ops/trait.add#tymethod.add)
[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
The resulting type after applying the `+` operator.
[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") · #### fn add(self, other: &usize) -> <usize as Add<usize>>::Output
Performs the `+` operation. [Read more](ops/trait.add#tymethod.add)
[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
The resulting type after applying the `+` operator.
[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") · #### fn add(self, other: usize) -> <usize as Add<usize>>::Output
Performs the `+` operation. [Read more](ops/trait.add#tymethod.add)
[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
The resulting type after applying the `+` operator.
[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") · #### fn add(self, other: usize) -> 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<&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/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/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/ops/arith.rs.html#786)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/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/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/ops/arith.rs.html#786)1.8.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/ops/arith.rs.html#786)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/fmt/num.rs.html#174)### impl Binary for usize
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#174)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error>
Formats the value using the given formatter.
[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
The resulting type after applying the `&` operator.
[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") · #### fn bitand(self, other: &usize) -> <usize as BitAnd<usize>>::Output
Performs the `&` operation. [Read more](ops/trait.bitand#tymethod.bitand)
[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
The resulting type after applying the `&` operator.
[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") · #### fn bitand(self, other: &usize) -> <usize as BitAnd<usize>>::Output
Performs the `&` operation. [Read more](ops/trait.bitand#tymethod.bitand)
[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
The resulting type after applying the `&` operator.
[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") · #### fn bitand(self, other: usize) -> <usize as BitAnd<usize>>::Output
Performs the `&` operation. [Read more](ops/trait.bitand#tymethod.bitand)
[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
The resulting type after applying the `&` operator.
[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") · #### fn bitand(self, rhs: usize) -> 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<&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/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/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/ops/bit.rs.html#734)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/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/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/ops/bit.rs.html#734)1.8.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/ops/bit.rs.html#734)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/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
The resulting type after applying the `|` operator.
[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") · #### fn bitor(self, other: &usize) -> <usize as BitOr<usize>>::Output
Performs the `|` operation. [Read more](ops/trait.bitor#tymethod.bitor)
[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
The resulting type after applying the `|` operator.
[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") · #### fn bitor(self, other: &usize) -> <usize 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 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/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
The resulting type after applying the `|` operator.
[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") · #### fn bitor(self, other: usize) -> <usize 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 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/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
The resulting type after applying the `|` operator.
[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") · #### fn bitor(self, rhs: usize) -> 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<&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/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/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/ops/bit.rs.html#806)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/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/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/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/ops/bit.rs.html#806)1.8.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/ops/bit.rs.html#806)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/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
The resulting type after applying the `^` operator.
[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") · #### fn bitxor(self, other: &usize) -> <usize as BitXor<usize>>::Output
Performs the `^` operation. [Read more](ops/trait.bitxor#tymethod.bitxor)
[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
The resulting type after applying the `^` operator.
[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") · #### fn bitxor(self, other: &usize) -> <usize as BitXor<usize>>::Output
Performs the `^` operation. [Read more](ops/trait.bitxor#tymethod.bitxor)
[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
The resulting type after applying the `^` operator.
[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") · #### fn bitxor(self, other: usize) -> <usize as BitXor<usize>>::Output
Performs the `^` operation. [Read more](ops/trait.bitxor#tymethod.bitxor)
[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
The resulting type after applying the `^` operator.
[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") · #### fn bitxor(self, other: usize) -> 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<&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/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/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/ops/bit.rs.html#878)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/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/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/ops/bit.rs.html#878)1.8.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/ops/bit.rs.html#878)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/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/clone.rs.html#197-202)const: [unstable](https://github.com/rust-lang/rust/issues/91805 "Tracking issue for const_clone") · #### fn clone(&self) -> usize
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/num.rs.html#197-200)### impl Debug for usize
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#197-200)#### 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/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/core/default.rs.html#207)const: [unstable](https://github.com/rust-lang/rust/issues/87864 "Tracking issue for const_default_impls") · #### fn default() -> usize
Returns the default value of `0`
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#461-464)### impl Display for usize
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#461-464)#### 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/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
The resulting type after applying the `/` operator.
[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") · #### fn div(self, other: &usize) -> <usize as Div<usize>>::Output
Performs the `/` operation. [Read more](ops/trait.div#tymethod.div)
[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
The resulting type after applying the `/` operator.
[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") · #### fn div(self, other: &usize) -> <usize as Div<usize>>::Output
Performs the `/` operation. [Read more](ops/trait.div#tymethod.div)
[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/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
The resulting type after applying the `/` operator.
[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") · #### fn div(self, other: usize) -> <usize as Div<usize>>::Output
Performs the `/` operation. [Read more](ops/trait.div#tymethod.div)
[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
The resulting type after applying the `/` operator.
[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") · #### fn div(self, other: usize) -> 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<&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/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/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/ops/arith.rs.html#968)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/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/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/ops/arith.rs.html#968)1.8.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/ops/arith.rs.html#968)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/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/convert/num.rs.html#91)1.28.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<bool> for usize
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#91)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: bool) -> usize
Converts a `bool` to a `usize`. The resulting value is `0` for `false` and `1` for `true` values.
##### Examples
```
assert_eq!(usize::from(true), 1);
assert_eq!(usize::from(false), 0);
```
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#140)1.26.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<u16> for usize
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#140)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: u16) -> usize
Converts `u16` to `usize` losslessly.
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#104)1.5.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<u8> for usize
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#104)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: u8) -> usize
Converts `u8` to `usize` losslessly.
[source](https://doc.rust-lang.org/src/core/sync/atomic.rs.html#2922-2926)1.23.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<usize> for AtomicUsize
[source](https://doc.rust-lang.org/src/core/sync/atomic.rs.html#2922-2926)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(v: usize) -> AtomicUsize
Converts an `usize` into an `AtomicUsize`.
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#1018)### impl FromStr for usize
#### type Err = ParseIntError
The associated error which can be returned from parsing.
[source](https://doc.rust-lang.org/src/core/num/mod.rs.html#1018)#### fn from\_str(src: &str) -> Result<usize, ParseIntError>
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/hash/mod.rs.html#829-842)### impl Hash for usize
[source](https://doc.rust-lang.org/src/core/hash/mod.rs.html#829-842)#### 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#829-842)#### fn hash\_slice<H>(data: &[usize], 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/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
The returned type after indexing.
[source](https://doc.rust-lang.org/src/alloc/collections/vec_deque/mod.rs.html#2932)#### fn index(&self, index: usize) -> &T
Performs the indexing (`container[index]`) operation. [Read more](ops/trait.index#tymethod.index)
[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/alloc/collections/vec_deque/mod.rs.html#2940)#### fn index\_mut(&mut self, index: usize) -> &mut T
Performs the mutable indexing (`container[index]`) operation. [Read more](ops/trait.indexmut#tymethod.index_mut)
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#465-468)1.42.0 · ### impl LowerExp for usize
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#465-468)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error>
Formats the value using the given formatter.
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#174)### impl LowerHex for usize
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#174)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error>
Formats the value using the given formatter.
[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
The resulting type after applying the `*` operator.
[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") · #### fn mul(self, other: &usize) -> <usize as Mul<usize>>::Output
Performs the `*` operation. [Read more](ops/trait.mul#tymethod.mul)
[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
The resulting type after applying the `*` operator.
[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") · #### fn mul(self, other: &usize) -> <usize as Mul<usize>>::Output
Performs the `*` operation. [Read more](ops/trait.mul#tymethod.mul)
[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
The resulting type after applying the `*` operator.
[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") · #### fn mul(self, other: usize) -> <usize as Mul<usize>>::Output
Performs the `*` operation. [Read more](ops/trait.mul#tymethod.mul)
[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
The resulting type after applying the `*` operator.
[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") · #### fn mul(self, other: usize) -> 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<&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/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/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/ops/arith.rs.html#911)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/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/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/ops/arith.rs.html#911)1.8.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/ops/arith.rs.html#911)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/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
The resulting type after applying the `!` operator.
[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") · #### fn not(self) -> <usize as Not>::Output
Performs the unary `!` operation. [Read more](ops/trait.not#tymethod.not)
[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
The resulting type after applying the `!` operator.
[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") · #### fn not(self) -> usize
Performs the unary `!` operation. [Read more](ops/trait.not#tymethod.not)
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#174)### impl Octal for usize
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#174)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error>
Formats the value using the given formatter.
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1486)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · ### impl Ord for usize
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1486)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · #### fn cmp(&self, other: &usize) -> 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/cmp.rs.html#1366-1368)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · ### impl PartialEq<usize> for usize
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1366-1368)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · #### fn eq(&self, other: &usize) -> 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#1366-1368)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · #### fn ne(&self, other: &usize) -> 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/cmp.rs.html#1486)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · ### impl PartialOrd<usize> for usize
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1486)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · #### fn partial\_cmp(&self, other: &usize) -> 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#1486)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · #### fn lt(&self, other: &usize) -> 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#1486)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · #### fn le(&self, other: &usize) -> 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#1486)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · #### fn ge(&self, other: &usize) -> 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/cmp.rs.html#1486)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · #### fn gt(&self, other: &usize) -> 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/iter/traits/accum.rs.html#141)1.12.0 · ### impl<'a> Product<&'a usize> for usize
[source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)#### fn product<I>(iter: I) -> usizewhere I: [Iterator](iter/trait.iterator "trait std::iter::Iterator")<Item = &'a [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.12.0 · ### impl Product<usize> for usize
[source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)#### fn product<I>(iter: I) -> usizewhere I: [Iterator](iter/trait.iterator "trait std::iter::Iterator")<Item = [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/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
The resulting type after applying the `%` operator.
[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") · #### fn rem(self, other: &usize) -> <usize as Rem<usize>>::Output
Performs the `%` operation. [Read more](ops/trait.rem#tymethod.rem)
[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
The resulting type after applying the `%` operator.
[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") · #### fn rem(self, other: &usize) -> <usize as Rem<usize>>::Output
Performs the `%` operation. [Read more](ops/trait.rem#tymethod.rem)
[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/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
The resulting type after applying the `%` operator.
[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") · #### fn rem(self, other: usize) -> <usize as Rem<usize>>::Output
Performs the `%` operation. [Read more](ops/trait.rem#tymethod.rem)
[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
The resulting type after applying the `%` operator.
[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") · #### fn rem(self, other: usize) -> 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<&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/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/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/ops/arith.rs.html#1029)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/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/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/ops/arith.rs.html#1029)1.8.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/ops/arith.rs.html#1029)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/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i128) -> <usize as Shl<i128>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i128) -> <usize as Shl<i128>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i16) -> <usize as Shl<i16>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i16) -> <usize as Shl<i16>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i32) -> <usize as Shl<i32>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i32) -> <usize as Shl<i32>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i64) -> <usize as Shl<i64>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i64) -> <usize as Shl<i64>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i8) -> <usize as Shl<i8>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &i8) -> <usize as Shl<i8>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &isize) -> <usize as Shl<isize>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &isize) -> <usize as Shl<isize>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u128) -> <usize as Shl<u128>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u128) -> <usize as Shl<u128>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u16) -> <usize as Shl<u16>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u16) -> <usize as Shl<u16>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u32) -> <usize as Shl<u32>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u32) -> <usize as Shl<u32>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u64) -> <usize as Shl<u64>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u64) -> <usize as Shl<u64>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u8) -> <usize as Shl<u8>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &u8) -> <usize as Shl<u8>>::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/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/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &usize) -> <i128 as Shl<usize>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &usize) -> <i16 as Shl<usize>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &usize) -> <i32 as Shl<usize>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &usize) -> <i64 as Shl<usize>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &usize) -> <i8 as Shl<usize>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &usize) -> <isize as Shl<usize>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &usize) -> <u128 as Shl<usize>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &usize) -> <u16 as Shl<usize>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &usize) -> <u32 as Shl<usize>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &usize) -> <u64 as Shl<usize>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &usize) -> <u8 as Shl<usize>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &usize) -> <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/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/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &usize) -> <i128 as Shl<usize>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &usize) -> <i16 as Shl<usize>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &usize) -> <i32 as Shl<usize>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &usize) -> <i64 as Shl<usize>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &usize) -> <i8 as Shl<usize>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &usize) -> <isize as Shl<usize>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &usize) -> <u128 as Shl<usize>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &usize) -> <u16 as Shl<usize>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &usize) -> <u32 as Shl<usize>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &usize) -> <u64 as Shl<usize>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &usize) -> <u8 as Shl<usize>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: &usize) -> <usize as Shl<usize>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i128) -> <usize as Shl<i128>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i128) -> usize
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i16) -> <usize as Shl<i16>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i16) -> usize
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i32) -> <usize as Shl<i32>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i32) -> usize
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i64) -> <usize as Shl<i64>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i64) -> usize
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i8) -> <usize as Shl<i8>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: i8) -> usize
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: isize) -> <usize as Shl<isize>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: isize) -> usize
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u128) -> <usize as Shl<u128>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u128) -> usize
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u16) -> <usize as Shl<u16>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u16) -> usize
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u32) -> <usize as Shl<u32>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u32) -> usize
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u64) -> <usize as Shl<u64>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u64) -> usize
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u8) -> <usize as Shl<u8>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: u8) -> usize
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/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/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: usize) -> <i128 as Shl<usize>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: usize) -> <i16 as Shl<usize>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: usize) -> <i32 as Shl<usize>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: usize) -> <i64 as Shl<usize>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: usize) -> <i8 as Shl<usize>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: usize) -> <isize as Shl<usize>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: usize) -> <u128 as Shl<usize>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: usize) -> <u16 as Shl<usize>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: usize) -> <u32 as Shl<usize>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: usize) -> <u64 as Shl<usize>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: usize) -> <u8 as Shl<usize>>::Output
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: usize) -> <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/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/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: usize) -> i128
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: usize) -> i16
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: usize) -> i32
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: usize) -> i64
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: usize) -> i8
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: usize) -> isize
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: usize) -> u128
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: usize) -> u16
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: usize) -> u32
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: usize) -> u64
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: usize) -> u8
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `<<` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#502)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl(self, other: usize) -> usize
Performs the `<<` operation. [Read more](ops/trait.shl#tymethod.shl)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &i128)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &i16)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &i32)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &i64)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &i8)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &isize)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &u128)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &u16)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &u32)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &u64)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: &u8)
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<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/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/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)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/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)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/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)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/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)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/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)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/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)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/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)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/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)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/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)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/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)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/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)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/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/ops/bit.rs.html#961)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/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: i128)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: i16)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: i32)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: i64)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: i8)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: isize)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: u128)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: u16)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: u32)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: u64)
Performs the `<<=` operation. [Read more](ops/trait.shlassign#tymethod.shl_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#961)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shl\_assign(&mut self, other: u8)
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/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/ops/bit.rs.html#961)1.8.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)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/ops/bit.rs.html#961)1.8.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)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/ops/bit.rs.html#961)1.8.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)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/ops/bit.rs.html#961)1.8.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)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/ops/bit.rs.html#961)1.8.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)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/ops/bit.rs.html#961)1.8.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)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/ops/bit.rs.html#961)1.8.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)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/ops/bit.rs.html#961)1.8.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)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/ops/bit.rs.html#961)1.8.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)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/ops/bit.rs.html#961)1.8.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)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/ops/bit.rs.html#961)1.8.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)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/ops/bit.rs.html#961)1.8.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/ops/bit.rs.html#961)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/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i128) -> <usize as Shr<i128>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i128) -> <usize as Shr<i128>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i16) -> <usize as Shr<i16>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i16) -> <usize as Shr<i16>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i32) -> <usize as Shr<i32>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i32) -> <usize as Shr<i32>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i64) -> <usize as Shr<i64>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i64) -> <usize as Shr<i64>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i8) -> <usize as Shr<i8>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &i8) -> <usize as Shr<i8>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &isize) -> <usize as Shr<isize>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &isize) -> <usize as Shr<isize>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u128) -> <usize as Shr<u128>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u128) -> <usize as Shr<u128>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u16) -> <usize as Shr<u16>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u16) -> <usize as Shr<u16>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u32) -> <usize as Shr<u32>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u32) -> <usize as Shr<u32>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u64) -> <usize as Shr<u64>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u64) -> <usize as Shr<u64>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u8) -> <usize as Shr<u8>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &u8) -> <usize as Shr<u8>>::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/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/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &usize) -> <i128 as Shr<usize>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &usize) -> <i16 as Shr<usize>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &usize) -> <i32 as Shr<usize>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &usize) -> <i64 as Shr<usize>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &usize) -> <i8 as Shr<usize>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &usize) -> <isize as Shr<usize>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &usize) -> <u128 as Shr<usize>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &usize) -> <u16 as Shr<usize>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &usize) -> <u32 as Shr<usize>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &usize) -> <u64 as Shr<usize>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &usize) -> <u8 as Shr<usize>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &usize) -> <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/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/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &usize) -> <i128 as Shr<usize>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &usize) -> <i16 as Shr<usize>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &usize) -> <i32 as Shr<usize>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &usize) -> <i64 as Shr<usize>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &usize) -> <i8 as Shr<usize>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &usize) -> <isize as Shr<usize>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &usize) -> <u128 as Shr<usize>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &usize) -> <u16 as Shr<usize>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &usize) -> <u32 as Shr<usize>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &usize) -> <u64 as Shr<usize>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &usize) -> <u8 as Shr<usize>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: &usize) -> <usize as Shr<usize>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i128) -> <usize as Shr<i128>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i128) -> usize
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i16) -> <usize as Shr<i16>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i16) -> usize
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i32) -> <usize as Shr<i32>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i32) -> usize
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i64) -> <usize as Shr<i64>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i64) -> usize
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i8) -> <usize as Shr<i8>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: i8) -> usize
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: isize) -> <usize as Shr<isize>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: isize) -> usize
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u128) -> <usize as Shr<u128>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u128) -> usize
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u16) -> <usize as Shr<u16>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u16) -> usize
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u32) -> <usize as Shr<u32>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u32) -> usize
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u64) -> <usize as Shr<u64>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u64) -> usize
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u8) -> <usize as Shr<u8>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: u8) -> usize
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/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/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: usize) -> <i128 as Shr<usize>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: usize) -> <i16 as Shr<usize>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: usize) -> <i32 as Shr<usize>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: usize) -> <i64 as Shr<usize>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: usize) -> <i8 as Shr<usize>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: usize) -> <isize as Shr<usize>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: usize) -> <u128 as Shr<usize>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: usize) -> <u16 as Shr<usize>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: usize) -> <u32 as Shr<usize>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: usize) -> <u64 as Shr<usize>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: usize) -> <u8 as Shr<usize>>::Output
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: usize) -> <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/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/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: usize) -> i128
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: usize) -> i16
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: usize) -> i32
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: usize) -> i64
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: usize) -> i8
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: usize) -> isize
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: usize) -> u128
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: usize) -> u16
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: usize) -> u32
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: usize) -> u64
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: usize) -> u8
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[source](https://doc.rust-lang.org/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
The resulting type after applying the `>>` operator.
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#621)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr(self, other: usize) -> usize
Performs the `>>` operation. [Read more](ops/trait.shr#tymethod.shr)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &i128)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &i16)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &i32)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &i64)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &i8)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &isize)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &u128)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &u16)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &u32)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &u64)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: &u8)
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<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/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/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)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/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)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/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)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/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)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/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)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/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)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/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)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/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)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/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)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/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)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/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)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/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/ops/bit.rs.html#1044)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/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: i128)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: i16)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: i32)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: i64)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: i8)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: isize)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: u128)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: u16)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: u32)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: u64)
Performs the `>>=` operation. [Read more](ops/trait.shrassign#tymethod.shr_assign)
[source](https://doc.rust-lang.org/src/core/ops/bit.rs.html#1044)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn shr\_assign(&mut self, other: u8)
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/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/ops/bit.rs.html#1044)1.8.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)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/ops/bit.rs.html#1044)1.8.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)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/ops/bit.rs.html#1044)1.8.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)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/ops/bit.rs.html#1044)1.8.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)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/ops/bit.rs.html#1044)1.8.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)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/ops/bit.rs.html#1044)1.8.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)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/ops/bit.rs.html#1044)1.8.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)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/ops/bit.rs.html#1044)1.8.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)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/ops/bit.rs.html#1044)1.8.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)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/ops/bit.rs.html#1044)1.8.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)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/ops/bit.rs.html#1044)1.8.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)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/ops/bit.rs.html#1044)1.8.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/ops/bit.rs.html#1044)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/up/up/portable-simd/crates/core_simd/src/vector.rs.html#691)### impl SimdElement for usize
#### type Mask = isize
🔬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.
[source](https://doc.rust-lang.org/src/core/slice/index.rs.html#209)1.15.0 (const: unstable) · ### impl<T> SliceIndex<[T]> for usize
#### type Output = T
The output type returned by methods.
[source](https://doc.rust-lang.org/src/core/slice/index.rs.html#213)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#219)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#225)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#238)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#248)const: unstable · #### fn index(self, slice: &[T]) -> &T
🔬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#254)const: unstable · #### fn index\_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, panicking if out of bounds. [Read more](slice/trait.sliceindex#tymethod.index_mut)
[source](https://doc.rust-lang.org/src/core/iter/range.rs.html#391-394)### impl Step for usize
[source](https://doc.rust-lang.org/src/core/iter/range.rs.html#391-394)#### unsafe fn forward\_unchecked(start: usize, n: usize) -> usize
🔬This is a nightly-only experimental API. (`step_trait` [#42168](https://github.com/rust-lang/rust/issues/42168))
Returns the value that would be obtained by taking the *successor* of `self` `count` times. [Read more](iter/trait.step#method.forward_unchecked)
[source](https://doc.rust-lang.org/src/core/iter/range.rs.html#391-394)#### unsafe fn backward\_unchecked(start: usize, n: usize) -> usize
🔬This is a nightly-only experimental API. (`step_trait` [#42168](https://github.com/rust-lang/rust/issues/42168))
Returns the value that would be obtained by taking the *predecessor* of `self` `count` times. [Read more](iter/trait.step#method.backward_unchecked)
[source](https://doc.rust-lang.org/src/core/iter/range.rs.html#391-394)#### fn forward(start: usize, n: usize) -> usize
🔬This is a nightly-only experimental API. (`step_trait` [#42168](https://github.com/rust-lang/rust/issues/42168))
Returns the value that would be obtained by taking the *successor* of `self` `count` times. [Read more](iter/trait.step#method.forward)
[source](https://doc.rust-lang.org/src/core/iter/range.rs.html#391-394)#### fn backward(start: usize, n: usize) -> usize
🔬This is a nightly-only experimental API. (`step_trait` [#42168](https://github.com/rust-lang/rust/issues/42168))
Returns the value that would be obtained by taking the *predecessor* of `self` `count` times. [Read more](iter/trait.step#method.backward)
[source](https://doc.rust-lang.org/src/core/iter/range.rs.html#391-394)#### fn steps\_between(start: &usize, end: &usize) -> Option<usize>
🔬This is a nightly-only experimental API. (`step_trait` [#42168](https://github.com/rust-lang/rust/issues/42168))
Returns the number of *successor* steps required to get from `start` to `end`. [Read more](iter/trait.step#tymethod.steps_between)
[source](https://doc.rust-lang.org/src/core/iter/range.rs.html#391-394)#### fn forward\_checked(start: usize, n: usize) -> Option<usize>
🔬This is a nightly-only experimental API. (`step_trait` [#42168](https://github.com/rust-lang/rust/issues/42168))
Returns the value that would be obtained by taking the *successor* of `self` `count` times. [Read more](iter/trait.step#tymethod.forward_checked)
[source](https://doc.rust-lang.org/src/core/iter/range.rs.html#391-394)#### fn backward\_checked(start: usize, n: usize) -> Option<usize>
🔬This is a nightly-only experimental API. (`step_trait` [#42168](https://github.com/rust-lang/rust/issues/42168))
Returns the value that would be obtained by taking the *predecessor* of `self` `count` times. [Read more](iter/trait.step#tymethod.backward_checked)
[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
The resulting type after applying the `-` operator.
[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") · #### fn sub(self, other: &usize) -> <usize as Sub<usize>>::Output
Performs the `-` operation. [Read more](ops/trait.sub#tymethod.sub)
[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
The resulting type after applying the `-` operator.
[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") · #### fn sub(self, other: &usize) -> <usize as Sub<usize>>::Output
Performs the `-` operation. [Read more](ops/trait.sub#tymethod.sub)
[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
The resulting type after applying the `-` operator.
[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") · #### fn sub(self, other: usize) -> <usize as Sub<usize>>::Output
Performs the `-` operation. [Read more](ops/trait.sub#tymethod.sub)
[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
The resulting type after applying the `-` operator.
[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") · #### fn sub(self, other: usize) -> 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<&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/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/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/ops/arith.rs.html#853)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/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/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/ops/arith.rs.html#853)1.8.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/ops/arith.rs.html#853)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.12.0 · ### impl<'a> Sum<&'a usize> for usize
[source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)#### fn sum<I>(iter: I) -> usizewhere I: [Iterator](iter/trait.iterator "trait std::iter::Iterator")<Item = &'a [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.12.0 · ### impl Sum<usize> for usize
[source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)#### fn sum<I>(iter: I) -> usizewhere I: [Iterator](iter/trait.iterator "trait std::iter::Iterator")<Item = [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/convert/num.rs.html#367)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<i128> for usize
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#367)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: i128) -> Result<usize, <usize as TryFrom<i128>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#366)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<i16> for usize
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#366)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: i16) -> Result<usize, <usize as TryFrom<i16>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#366)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<i32> for usize
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#366)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: i32) -> Result<usize, <usize as TryFrom<i32>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#366)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<i64> for usize
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#366)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: i64) -> Result<usize, <usize as TryFrom<i64>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#366)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<i8> for usize
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#366)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: i8) -> Result<usize, <usize as TryFrom<i8>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#298)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<isize> for usize
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#298)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: isize) -> Result<usize, <usize as TryFrom<isize>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#365)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<u128> for usize
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#365)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: u128) -> Result<usize, <usize as TryFrom<u128>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#364)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<u32> for usize
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#364)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(value: u32) -> Result<usize, <usize as TryFrom<u32>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#364)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<u64> for usize
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#364)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(value: u64) -> Result<usize, <usize as TryFrom<u64>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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/convert/num.rs.html#357)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<usize> for i128
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#357)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(value: usize) -> Result<i128, <i128 as TryFrom<usize>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#356)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<usize> for i16
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#356)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: usize) -> Result<i16, <i16 as TryFrom<usize>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#356)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<usize> for i32
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#356)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: usize) -> Result<i32, <i32 as TryFrom<usize>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#356)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<usize> for i64
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#356)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: usize) -> Result<i64, <i64 as TryFrom<usize>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#356)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<usize> for i8
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#356)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: usize) -> Result<i8, <i8 as TryFrom<usize>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#297)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<usize> for isize
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#297)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: usize) -> Result<isize, <isize as TryFrom<usize>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#355)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<usize> for u128
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#355)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(value: usize) -> Result<u128, <u128 as TryFrom<usize>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#354)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<usize> for u16
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#354)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: usize) -> Result<u16, <u16 as TryFrom<usize>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#354)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<usize> for u32
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#354)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: usize) -> Result<u32, <u32 as TryFrom<usize>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#355)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<usize> for u64
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#355)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(value: usize) -> Result<u64, <u64 as TryFrom<usize>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### 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#354)1.34.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl TryFrom<usize> for u8
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#354)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn try\_from(u: usize) -> Result<u8, <u8 as TryFrom<usize>>::Error>
Try to create the target number type from a source number type. This returns an error if the source value is outside of the range of the target type.
#### type Error = TryFromIntError
The type returned in the event of a conversion error.
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#465-468)1.42.0 · ### impl UpperExp for usize
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#465-468)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error>
Formats the value using the given formatter.
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#174)### impl UpperHex for usize
[source](https://doc.rust-lang.org/src/core/fmt/num.rs.html#174)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error>
Formats the value using the given formatter.
[source](https://doc.rust-lang.org/src/core/marker.rs.html#830-835)### impl Copy for usize
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1377)### impl Eq for usize
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#38)### impl FloatToInt<usize> for f32
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#39)### impl FloatToInt<usize> for f64
[source](https://doc.rust-lang.org/src/core/iter/range.rs.html#17)### impl TrustedStep for usize
Auto Trait Implementations
--------------------------
### impl RefUnwindSafe for usize
### impl Send for usize
### impl Sync for usize
### impl Unpin for usize
### impl UnwindSafe for usize
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 Keyword static Keyword static
==============
A static item is a value which is valid for the entire duration of your program (a `'static` lifetime).
On the surface, `static` items seem very similar to [`const`](keyword.const)s: both contain a value, both require type annotations and both can only be initialized with constant functions and values. However, `static`s are notably different in that they represent a location in memory. That means that you can have references to `static` items and potentially even modify them, making them essentially global variables.
Static items do not call [`drop`](mem/fn.drop "drop") at the end of the program.
There are two types of `static` items: those declared in association with the [`mut`](keyword.mut) keyword and those without.
Static items cannot be moved:
ⓘ
```
static VEC: Vec<u32> = vec![];
fn move_vec(v: Vec<u32>) -> Vec<u32> {
v
}
// This line causes an error
move_vec(VEC);
```
Simple `static`s
----------------
Accessing non-[`mut`](keyword.mut) `static` items is considered safe, but some restrictions apply. Most notably, the type of a `static` value needs to implement the [`Sync`](marker/trait.sync "Sync") trait, ruling out interior mutability containers like [`RefCell`](cell/struct.refcell). See the [Reference](../reference/items/static-items) for more information.
```
static FOO: [i32; 5] = [1, 2, 3, 4, 5];
let r1 = &FOO as *const _;
let r2 = &FOO as *const _;
// With a strictly read-only static, references will have the same address
assert_eq!(r1, r2);
// A static item can be used just like a variable in many cases
println!("{FOO:?}");
```
Mutable `static`s
-----------------
If a `static` item is declared with the [`mut`](keyword.mut) keyword, then it is allowed to be modified by the program. However, accessing mutable `static`s can cause undefined behavior in a number of ways, for example due to data races in a multithreaded context. As such, all accesses to mutable `static`s require an [`unsafe`](keyword.unsafe) block.
Despite their unsafety, mutable `static`s are necessary in many contexts: they can be used to represent global state shared by the whole program or in [`extern`](keyword.extern) blocks to bind to variables from C libraries.
In an [`extern`](keyword.extern) block:
```
extern "C" {
static mut ERROR_MESSAGE: *mut std::os::raw::c_char;
}
```
Mutable `static`s, just like simple `static`s, have some restrictions that apply to them. See the [Reference](../reference/items/static-items) for more information.
rust Primitive Type f64 Primitive Type f64
==================
A 64-bit floating point type (specifically, the “binary64” type defined in IEEE 754-2008).
This type is very similar to [`f32`](primitive.f32), but has increased precision by using twice as many bits. Please see [the documentation for `f32`](primitive.f32) or [Wikipedia on double precision values](https://en.wikipedia.org/wiki/Double-precision_floating-point_format) for more information.
*[See also the `std::f64::consts` module](f64/consts/index).*
Implementations
---------------
[source](https://doc.rust-lang.org/src/std/f64.rs.html#31-949)### impl f64
[source](https://doc.rust-lang.org/src/std/f64.rs.html#49-51)#### pub fn floor(self) -> f64
Returns the largest integer less than or equal to `self`.
##### Examples
```
let f = 3.7_f64;
let g = 3.0_f64;
let h = -3.7_f64;
assert_eq!(f.floor(), 3.0);
assert_eq!(g.floor(), 3.0);
assert_eq!(h.floor(), -4.0);
```
[source](https://doc.rust-lang.org/src/std/f64.rs.html#68-70)#### pub fn ceil(self) -> f64
Returns the smallest integer greater than or equal to `self`.
##### Examples
```
let f = 3.01_f64;
let g = 4.0_f64;
assert_eq!(f.ceil(), 4.0);
assert_eq!(g.ceil(), 4.0);
```
[source](https://doc.rust-lang.org/src/std/f64.rs.html#88-90)#### pub fn round(self) -> f64
Returns the nearest integer to `self`. Round half-way cases away from `0.0`.
##### Examples
```
let f = 3.3_f64;
let g = -3.3_f64;
assert_eq!(f.round(), 3.0);
assert_eq!(g.round(), -3.0);
```
[source](https://doc.rust-lang.org/src/std/f64.rs.html#110-112)#### pub fn trunc(self) -> f64
Returns the integer part of `self`. This means that non-integer numbers are always truncated towards zero.
##### Examples
```
let f = 3.7_f64;
let g = 3.0_f64;
let h = -3.7_f64;
assert_eq!(f.trunc(), 3.0);
assert_eq!(g.trunc(), 3.0);
assert_eq!(h.trunc(), -3.0);
```
[source](https://doc.rust-lang.org/src/std/f64.rs.html#131-133)#### pub fn fract(self) -> f64
Returns the fractional part of `self`.
##### Examples
```
let x = 3.6_f64;
let y = -3.6_f64;
let abs_difference_x = (x.fract() - 0.6).abs();
let abs_difference_y = (y.fract() - (-0.6)).abs();
assert!(abs_difference_x < 1e-10);
assert!(abs_difference_y < 1e-10);
```
[source](https://doc.rust-lang.org/src/std/f64.rs.html#155-157)#### pub fn abs(self) -> f64
Computes the absolute value of `self`.
##### Examples
```
let x = 3.5_f64;
let y = -3.5_f64;
let abs_difference_x = (x.abs() - x).abs();
let abs_difference_y = (y.abs() - (-y)).abs();
assert!(abs_difference_x < 1e-10);
assert!(abs_difference_y < 1e-10);
assert!(f64::NAN.abs().is_nan());
```
[source](https://doc.rust-lang.org/src/std/f64.rs.html#179-181)#### pub fn signum(self) -> f64
Returns a number that represents the sign of `self`.
* `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
##### Examples
```
let f = 3.5_f64;
assert_eq!(f.signum(), 1.0);
assert_eq!(f64::NEG_INFINITY.signum(), -1.0);
assert!(f64::NAN.signum().is_nan());
```
[source](https://doc.rust-lang.org/src/std/f64.rs.html#208-210)1.35.0 · #### pub fn copysign(self, sign: f64) -> f64
Returns a number composed of the magnitude of `self` and the sign of `sign`.
Equal to `self` if the sign of `self` and `sign` are the same, otherwise equal to `-self`. If `self` is a NaN, then a NaN with the sign bit of `sign` is returned. Note, however, that conserving the sign bit on NaN across arithmetical operations is not generally guaranteed. See [explanation of NaN as a special value](primitive.f32) for more info.
##### Examples
```
let f = 3.5_f64;
assert_eq!(f.copysign(0.42), 3.5_f64);
assert_eq!(f.copysign(-0.42), -3.5_f64);
assert_eq!((-f).copysign(0.42), 3.5_f64);
assert_eq!((-f).copysign(-0.42), -3.5_f64);
assert!(f64::NAN.copysign(1.0).is_nan());
```
[source](https://doc.rust-lang.org/src/std/f64.rs.html#236-238)#### pub fn mul\_add(self, a: f64, b: f64) -> f64
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 dependant on designing algorithms with specific target hardware in mind.
##### Examples
```
let m = 10.0_f64;
let x = 4.0_f64;
let b = 60.0_f64;
// 100.0
let abs_difference = (m.mul_add(x, b) - ((m * x) + b)).abs();
assert!(abs_difference < 1e-10);
```
[source](https://doc.rust-lang.org/src/std/f64.rs.html#261-267)1.38.0 · #### pub fn div\_euclid(self, rhs: f64) -> f64
Calculates Euclidean division, the matching method for `rem_euclid`.
This computes the integer `n` such that `self = n * rhs + self.rem_euclid(rhs)`. In other words, the result is `self / rhs` rounded to the integer `n` such that `self >= n * rhs`.
##### Examples
```
let a: f64 = 7.0;
let b = 4.0;
assert_eq!(a.div_euclid(b), 1.0); // 7.0 > 4.0 * 1.0
assert_eq!((-a).div_euclid(b), -2.0); // -7.0 >= 4.0 * -2.0
assert_eq!(a.div_euclid(-b), -1.0); // 7.0 >= -4.0 * -1.0
assert_eq!((-a).div_euclid(-b), 2.0); // -7.0 >= -4.0 * 2.0
```
[source](https://doc.rust-lang.org/src/std/f64.rs.html#296-299)1.38.0 · #### pub fn rem\_euclid(self, rhs: f64) -> f64
Calculates the least nonnegative remainder of `self (mod rhs)`.
In particular, the return value `r` satisfies `0.0 <= r < rhs.abs()` in most cases. However, due to a floating point round-off error it can result in `r == rhs.abs()`, violating the mathematical definition, if `self` is much smaller than `rhs.abs()` in magnitude and `self < 0.0`. This result is not an element of the function’s codomain, but it is the closest floating point number in the real numbers and thus fulfills the property `self == self.div_euclid(rhs) * rhs + self.rem_euclid(rhs)` approximatively.
##### Examples
```
let a: f64 = 7.0;
let b = 4.0;
assert_eq!(a.rem_euclid(b), 3.0);
assert_eq!((-a).rem_euclid(b), 1.0);
assert_eq!(a.rem_euclid(-b), 3.0);
assert_eq!((-a).rem_euclid(-b), 1.0);
// limitation due to round-off error
assert!((-f64::EPSILON).rem_euclid(3.0) != 0.0);
```
[source](https://doc.rust-lang.org/src/std/f64.rs.html#319-321)#### pub fn powi(self, n: i32) -> f64
Raises a number to an integer power.
Using this function is generally faster than using `powf`. It might have a different sequence of rounding operations than `powf`, so the results are not guaranteed to agree.
##### Examples
```
let x = 2.0_f64;
let abs_difference = (x.powi(2) - (x * x)).abs();
assert!(abs_difference < 1e-10);
```
[source](https://doc.rust-lang.org/src/std/f64.rs.html#337-339)#### pub fn powf(self, n: f64) -> f64
Raises a number to a floating point power.
##### Examples
```
let x = 2.0_f64;
let abs_difference = (x.powf(2.0) - (x * x)).abs();
assert!(abs_difference < 1e-10);
```
[source](https://doc.rust-lang.org/src/std/f64.rs.html#362-364)#### pub fn sqrt(self) -> f64
Returns the square root of a number.
Returns NaN if `self` is a negative number other than `-0.0`.
##### Examples
```
let positive = 4.0_f64;
let negative = -4.0_f64;
let negative_zero = -0.0_f64;
let abs_difference = (positive.sqrt() - 2.0).abs();
assert!(abs_difference < 1e-10);
assert!(negative.sqrt().is_nan());
assert!(negative_zero.sqrt() == negative_zero);
```
[source](https://doc.rust-lang.org/src/std/f64.rs.html#384-386)#### pub fn exp(self) -> f64
Returns `e^(self)`, (the exponential function).
##### Examples
```
let one = 1.0_f64;
// e^1
let e = one.exp();
// ln(e) - 1 == 0
let abs_difference = (e.ln() - 1.0).abs();
assert!(abs_difference < 1e-10);
```
[source](https://doc.rust-lang.org/src/std/f64.rs.html#404-406)#### pub fn exp2(self) -> f64
Returns `2^(self)`.
##### Examples
```
let f = 2.0_f64;
// 2^2 - 4 == 0
let abs_difference = (f.exp2() - 4.0).abs();
assert!(abs_difference < 1e-10);
```
[source](https://doc.rust-lang.org/src/std/f64.rs.html#426-428)#### pub fn ln(self) -> f64
Returns the natural logarithm of the number.
##### Examples
```
let one = 1.0_f64;
// e^1
let e = one.exp();
// ln(e) - 1 == 0
let abs_difference = (e.ln() - 1.0).abs();
assert!(abs_difference < 1e-10);
```
[source](https://doc.rust-lang.org/src/std/f64.rs.html#450-452)#### pub fn log(self, base: f64) -> f64
Returns the logarithm of the number with respect to an arbitrary base.
The result might not be correctly rounded owing to implementation details; `self.log2()` can produce more accurate results for base 2, and `self.log10()` can produce more accurate results for base 10.
##### Examples
```
let twenty_five = 25.0_f64;
// log5(25) - 2 == 0
let abs_difference = (twenty_five.log(5.0) - 2.0).abs();
assert!(abs_difference < 1e-10);
```
[source](https://doc.rust-lang.org/src/std/f64.rs.html#470-477)#### pub fn log2(self) -> f64
Returns the base 2 logarithm of the number.
##### Examples
```
let four = 4.0_f64;
// log2(4) - 2 == 0
let abs_difference = (four.log2() - 2.0).abs();
assert!(abs_difference < 1e-10);
```
[source](https://doc.rust-lang.org/src/std/f64.rs.html#495-497)#### pub fn log10(self) -> f64
Returns the base 10 logarithm of the number.
##### Examples
```
let hundred = 100.0_f64;
// log10(100) - 2 == 0
let abs_difference = (hundred.log10() - 2.0).abs();
assert!(abs_difference < 1e-10);
```
[source](https://doc.rust-lang.org/src/std/f64.rs.html#530-532)#### pub fn abs\_sub(self, other: f64) -> f64
👎Deprecated since 1.10.0: you probably meant `(self - other).abs()`: this operation is `(self - other).max(0.0)` except that `abs_sub` also propagates NaNs (also known as `fdim` in C). If you truly need the positive difference, consider using that expression or the C function `fdim`, depending on how you wish to handle NaN (please consider filing an issue describing your use-case too).
The positive difference of two numbers.
* If `self <= other`: `0:0`
* Else: `self - other`
##### Examples
```
let x = 3.0_f64;
let y = -3.0_f64;
let abs_difference_x = (x.abs_sub(1.0) - 2.0).abs();
let abs_difference_y = (y.abs_sub(1.0) - 0.0).abs();
assert!(abs_difference_x < 1e-10);
assert!(abs_difference_y < 1e-10);
```
[source](https://doc.rust-lang.org/src/std/f64.rs.html#550-552)#### pub fn cbrt(self) -> f64
Returns the cube root of a number.
##### Examples
```
let x = 8.0_f64;
// x^(1/3) - 2 == 0
let abs_difference = (x.cbrt() - 2.0).abs();
assert!(abs_difference < 1e-10);
```
[source](https://doc.rust-lang.org/src/std/f64.rs.html#572-574)#### pub fn hypot(self, other: f64) -> f64
Calculates the length of the hypotenuse of a right-angle triangle given legs of length `x` and `y`.
##### Examples
```
let x = 2.0_f64;
let y = 3.0_f64;
// sqrt(x^2 + y^2)
let abs_difference = (x.hypot(y) - (x.powi(2) + y.powi(2)).sqrt()).abs();
assert!(abs_difference < 1e-10);
```
[source](https://doc.rust-lang.org/src/std/f64.rs.html#591-593)#### pub fn sin(self) -> f64
Computes the sine of a number (in radians).
##### Examples
```
let x = std::f64::consts::FRAC_PI_2;
let abs_difference = (x.sin() - 1.0).abs();
assert!(abs_difference < 1e-10);
```
[source](https://doc.rust-lang.org/src/std/f64.rs.html#610-612)#### pub fn cos(self) -> f64
Computes the cosine of a number (in radians).
##### Examples
```
let x = 2.0 * std::f64::consts::PI;
let abs_difference = (x.cos() - 1.0).abs();
assert!(abs_difference < 1e-10);
```
[source](https://doc.rust-lang.org/src/std/f64.rs.html#628-630)#### pub fn tan(self) -> f64
Computes the tangent of a number (in radians).
##### Examples
```
let x = std::f64::consts::FRAC_PI_4;
let abs_difference = (x.tan() - 1.0).abs();
assert!(abs_difference < 1e-14);
```
[source](https://doc.rust-lang.org/src/std/f64.rs.html#650-652)#### pub fn asin(self) -> f64
Computes the arcsine of a number. Return value is in radians in the range [-pi/2, pi/2] or NaN if the number is outside the range [-1, 1].
##### Examples
```
let f = std::f64::consts::FRAC_PI_2;
// asin(sin(pi/2))
let abs_difference = (f.sin().asin() - std::f64::consts::FRAC_PI_2).abs();
assert!(abs_difference < 1e-10);
```
[source](https://doc.rust-lang.org/src/std/f64.rs.html#672-674)#### pub fn acos(self) -> f64
Computes the arccosine of a number. Return value is in radians in the range [0, pi] or NaN if the number is outside the range [-1, 1].
##### Examples
```
let f = std::f64::consts::FRAC_PI_4;
// acos(cos(pi/4))
let abs_difference = (f.cos().acos() - std::f64::consts::FRAC_PI_4).abs();
assert!(abs_difference < 1e-10);
```
[source](https://doc.rust-lang.org/src/std/f64.rs.html#693-695)#### pub fn atan(self) -> f64
Computes the arctangent of a number. Return value is in radians in the range [-pi/2, pi/2];
##### Examples
```
let f = 1.0_f64;
// atan(tan(1))
let abs_difference = (f.tan().atan() - 1.0).abs();
assert!(abs_difference < 1e-10);
```
[source](https://doc.rust-lang.org/src/std/f64.rs.html#727-729)#### pub fn atan2(self, other: f64) -> f64
Computes the four quadrant arctangent of `self` (`y`) and `other` (`x`) in radians.
* `x = 0`, `y = 0`: `0`
* `x >= 0`: `arctan(y/x)` -> `[-pi/2, pi/2]`
* `y >= 0`: `arctan(y/x) + pi` -> `(pi/2, pi]`
* `y < 0`: `arctan(y/x) - pi` -> `(-pi, -pi/2)`
##### Examples
```
// Positive angles measured counter-clockwise
// from positive x axis
// -pi/4 radians (45 deg clockwise)
let x1 = 3.0_f64;
let y1 = -3.0_f64;
// 3pi/4 radians (135 deg counter-clockwise)
let x2 = -3.0_f64;
let y2 = 3.0_f64;
let abs_difference_1 = (y1.atan2(x1) - (-std::f64::consts::FRAC_PI_4)).abs();
let abs_difference_2 = (y2.atan2(x2) - (3.0 * std::f64::consts::FRAC_PI_4)).abs();
assert!(abs_difference_1 < 1e-10);
assert!(abs_difference_2 < 1e-10);
```
[source](https://doc.rust-lang.org/src/std/f64.rs.html#749-751)#### pub fn sin\_cos(self) -> (f64, f64)
Simultaneously computes the sine and cosine of the number, `x`. Returns `(sin(x), cos(x))`.
##### Examples
```
let x = std::f64::consts::FRAC_PI_4;
let f = x.sin_cos();
let abs_difference_0 = (f.0 - x.sin()).abs();
let abs_difference_1 = (f.1 - x.cos()).abs();
assert!(abs_difference_0 < 1e-10);
assert!(abs_difference_1 < 1e-10);
```
[source](https://doc.rust-lang.org/src/std/f64.rs.html#771-773)#### pub fn exp\_m1(self) -> f64
Returns `e^(self) - 1` in a way that is accurate even if the number is close to zero.
##### Examples
```
let x = 1e-16_f64;
// for very small x, e^x is approximately 1 + x + x^2 / 2
let approx = x + x * x / 2.0;
let abs_difference = (x.exp_m1() - approx).abs();
assert!(abs_difference < 1e-20);
```
[source](https://doc.rust-lang.org/src/std/f64.rs.html#793-795)#### pub fn ln\_1p(self) -> f64
Returns `ln(1+n)` (natural logarithm) more accurately than if the operations were performed separately.
##### Examples
```
let x = 1e-16_f64;
// for very small x, ln(1 + x) is approximately x - x^2 / 2
let approx = x - x * x / 2.0;
let abs_difference = (x.ln_1p() - approx).abs();
assert!(abs_difference < 1e-20);
```
[source](https://doc.rust-lang.org/src/std/f64.rs.html#816-818)#### pub fn sinh(self) -> f64
Hyperbolic sine function.
##### Examples
```
let e = std::f64::consts::E;
let x = 1.0_f64;
let f = x.sinh();
// Solving sinh() at 1 gives `(e^2-1)/(2e)`
let g = ((e * e) - 1.0) / (2.0 * e);
let abs_difference = (f - g).abs();
assert!(abs_difference < 1e-10);
```
[source](https://doc.rust-lang.org/src/std/f64.rs.html#839-841)#### pub fn cosh(self) -> f64
Hyperbolic cosine function.
##### Examples
```
let e = std::f64::consts::E;
let x = 1.0_f64;
let f = x.cosh();
// Solving cosh() at 1 gives this result
let g = ((e * e) + 1.0) / (2.0 * e);
let abs_difference = (f - g).abs();
// Same result
assert!(abs_difference < 1.0e-10);
```
[source](https://doc.rust-lang.org/src/std/f64.rs.html#862-864)#### pub fn tanh(self) -> f64
Hyperbolic tangent function.
##### Examples
```
let e = std::f64::consts::E;
let x = 1.0_f64;
let f = x.tanh();
// Solving tanh() at 1 gives `(1 - e^(-2))/(1 + e^(-2))`
let g = (1.0 - e.powi(-2)) / (1.0 + e.powi(-2));
let abs_difference = (f - g).abs();
assert!(abs_difference < 1.0e-10);
```
[source](https://doc.rust-lang.org/src/std/f64.rs.html#882-884)#### pub fn asinh(self) -> f64
Inverse hyperbolic sine function.
##### Examples
```
let x = 1.0_f64;
let f = x.sinh().asinh();
let abs_difference = (f - x).abs();
assert!(abs_difference < 1.0e-10);
```
[source](https://doc.rust-lang.org/src/std/f64.rs.html#902-904)#### pub fn acosh(self) -> f64
Inverse hyperbolic cosine function.
##### Examples
```
let x = 1.0_f64;
let f = x.cosh().acosh();
let abs_difference = (f - x).abs();
assert!(abs_difference < 1.0e-10);
```
[source](https://doc.rust-lang.org/src/std/f64.rs.html#922-924)#### pub fn atanh(self) -> f64
Inverse hyperbolic tangent function.
##### Examples
```
let e = std::f64::consts::E;
let f = e.tanh().atanh();
let abs_difference = (f - e).abs();
assert!(abs_difference < 1.0e-10);
```
[source](https://doc.rust-lang.org/src/core/num/f64.rs.html#350)### impl f64
[source](https://doc.rust-lang.org/src/core/num/f64.rs.html#353)1.43.0 · #### pub const RADIX: u32 = 2u32
The radix or base of the internal representation of `f64`.
[source](https://doc.rust-lang.org/src/core/num/f64.rs.html#357)1.43.0 · #### pub const MANTISSA\_DIGITS: u32 = 53u32
Number of significant digits in base 2.
[source](https://doc.rust-lang.org/src/core/num/f64.rs.html#360)1.43.0 · #### pub const DIGITS: u32 = 15u32
Approximate number of significant digits in base 10.
[source](https://doc.rust-lang.org/src/core/num/f64.rs.html#368)1.43.0 · #### pub const EPSILON: f64 = 2.2204460492503131E-16f64
[Machine epsilon](https://en.wikipedia.org/wiki/Machine_epsilon) value for `f64`.
This is the difference between `1.0` and the next larger representable number.
[source](https://doc.rust-lang.org/src/core/num/f64.rs.html#372)1.43.0 · #### pub const MIN: f64 = -1.7976931348623157E+308f64
Smallest finite `f64` value.
[source](https://doc.rust-lang.org/src/core/num/f64.rs.html#375)1.43.0 · #### pub const MIN\_POSITIVE: f64 = 2.2250738585072014E-308f64
Smallest positive normal `f64` value.
[source](https://doc.rust-lang.org/src/core/num/f64.rs.html#378)1.43.0 · #### pub const MAX: f64 = 1.7976931348623157E+308f64
Largest finite `f64` value.
[source](https://doc.rust-lang.org/src/core/num/f64.rs.html#382)1.43.0 · #### pub const MIN\_EXP: i32 = -1\_021i32
One greater than the minimum possible normal power of 2 exponent.
[source](https://doc.rust-lang.org/src/core/num/f64.rs.html#385)1.43.0 · #### pub const MAX\_EXP: i32 = 1\_024i32
Maximum possible power of 2 exponent.
[source](https://doc.rust-lang.org/src/core/num/f64.rs.html#389)1.43.0 · #### pub const MIN\_10\_EXP: i32 = -307i32
Minimum possible normal power of 10 exponent.
[source](https://doc.rust-lang.org/src/core/num/f64.rs.html#392)1.43.0 · #### pub const MAX\_10\_EXP: i32 = 308i32
Maximum possible power of 10 exponent.
[source](https://doc.rust-lang.org/src/core/num/f64.rs.html#405)1.43.0 · #### pub const NAN: f64 = NaNf64
Not a Number (NaN).
Note that IEEE 754 doesn’t define just a single NaN value; a plethora of bit patterns are considered to be NaN. Furthermore, the standard makes a difference between a “signaling” and a “quiet” NaN, and allows inspecting its “payload” (the unspecified bits in the bit pattern). This constant isn’t guaranteed to equal to any specific NaN bitpattern, and the stability of its representation over Rust versions and target platforms isn’t guaranteed.
[source](https://doc.rust-lang.org/src/core/num/f64.rs.html#408)1.43.0 · #### pub const INFINITY: f64 = +Inff64
Infinity (∞).
[source](https://doc.rust-lang.org/src/core/num/f64.rs.html#411)1.43.0 · #### pub const NEG\_INFINITY: f64 = -Inff64
Negative infinity (−∞).
[source](https://doc.rust-lang.org/src/core/num/f64.rs.html#426)const: [unstable](https://github.com/rust-lang/rust/issues/72505 "Tracking issue for const_float_classify") · #### pub fn is\_nan(self) -> bool
Returns `true` if this value is NaN.
```
let nan = f64::NAN;
let f = 7.0_f64;
assert!(nan.is_nan());
assert!(!f.is_nan());
```
[source](https://doc.rust-lang.org/src/core/num/f64.rs.html#461)const: [unstable](https://github.com/rust-lang/rust/issues/72505 "Tracking issue for const_float_classify") · #### pub fn is\_infinite(self) -> bool
Returns `true` if this value is positive infinity or negative infinity, and `false` otherwise.
```
let f = 7.0f64;
let inf = f64::INFINITY;
let neg_inf = f64::NEG_INFINITY;
let nan = f64::NAN;
assert!(!f.is_infinite());
assert!(!nan.is_infinite());
assert!(inf.is_infinite());
assert!(neg_inf.is_infinite());
```
[source](https://doc.rust-lang.org/src/core/num/f64.rs.html#486)const: [unstable](https://github.com/rust-lang/rust/issues/72505 "Tracking issue for const_float_classify") · #### pub fn is\_finite(self) -> bool
Returns `true` if this number is neither infinite nor NaN.
```
let f = 7.0f64;
let inf: f64 = f64::INFINITY;
let neg_inf: f64 = f64::NEG_INFINITY;
let nan: f64 = f64::NAN;
assert!(f.is_finite());
assert!(!nan.is_finite());
assert!(!inf.is_finite());
assert!(!neg_inf.is_finite());
```
[source](https://doc.rust-lang.org/src/core/num/f64.rs.html#514)1.53.0 (const: [unstable](https://github.com/rust-lang/rust/issues/72505 "Tracking issue for const_float_classify")) · #### pub fn is\_subnormal(self) -> bool
Returns `true` if the number is [subnormal](https://en.wikipedia.org/wiki/Denormal_number).
```
let min = f64::MIN_POSITIVE; // 2.2250738585072014e-308_f64
let max = f64::MAX;
let lower_than_min = 1.0e-308_f64;
let zero = 0.0_f64;
assert!(!min.is_subnormal());
assert!(!max.is_subnormal());
assert!(!zero.is_subnormal());
assert!(!f64::NAN.is_subnormal());
assert!(!f64::INFINITY.is_subnormal());
// Values between `0` and `min` are Subnormal.
assert!(lower_than_min.is_subnormal());
```
[source](https://doc.rust-lang.org/src/core/num/f64.rs.html#541)const: [unstable](https://github.com/rust-lang/rust/issues/72505 "Tracking issue for const_float_classify") · #### pub fn is\_normal(self) -> bool
Returns `true` if the number is neither zero, infinite, [subnormal](https://en.wikipedia.org/wiki/Denormal_number), or NaN.
```
let min = f64::MIN_POSITIVE; // 2.2250738585072014e-308f64
let max = f64::MAX;
let lower_than_min = 1.0e-308_f64;
let zero = 0.0f64;
assert!(min.is_normal());
assert!(max.is_normal());
assert!(!zero.is_normal());
assert!(!f64::NAN.is_normal());
assert!(!f64::INFINITY.is_normal());
// Values between `0` and `min` are Subnormal.
assert!(!lower_than_min.is_normal());
```
[source](https://doc.rust-lang.org/src/core/num/f64.rs.html#560)const: [unstable](https://github.com/rust-lang/rust/issues/72505 "Tracking issue for const_float_classify") · #### pub fn classify(self) -> FpCategory
Returns the floating point category of the number. If only one property is going to be tested, it is generally faster to use the specific predicate instead.
```
use std::num::FpCategory;
let num = 12.4_f64;
let inf = f64::INFINITY;
assert_eq!(num.classify(), FpCategory::Normal);
assert_eq!(inf.classify(), FpCategory::Infinite);
```
[source](https://doc.rust-lang.org/src/core/num/f64.rs.html#644)const: [unstable](https://github.com/rust-lang/rust/issues/72505 "Tracking issue for const_float_classify") · #### pub fn is\_sign\_positive(self) -> bool
Returns `true` if `self` has a positive sign, including `+0.0`, NaNs with positive sign bit and positive infinity. Note that IEEE 754 doesn’t assign any meaning to the sign bit in case of a NaN, and as Rust doesn’t guarantee that the bit pattern of NaNs are conserved over arithmetic operations, the result of `is_sign_positive` on a NaN might produce an unexpected result in some cases. See [explanation of NaN as a special value](primitive.f32) for more info.
```
let f = 7.0_f64;
let g = -7.0_f64;
assert!(f.is_sign_positive());
assert!(!g.is_sign_positive());
```
[source](https://doc.rust-lang.org/src/core/num/f64.rs.html#675)const: [unstable](https://github.com/rust-lang/rust/issues/72505 "Tracking issue for const_float_classify") · #### pub fn is\_sign\_negative(self) -> bool
Returns `true` if `self` has a negative sign, including `-0.0`, NaNs with negative sign bit and negative infinity. Note that IEEE 754 doesn’t assign any meaning to the sign bit in case of a NaN, and as Rust doesn’t guarantee that the bit pattern of NaNs are conserved over arithmetic operations, the result of `is_sign_negative` on a NaN might produce an unexpected result in some cases. See [explanation of NaN as a special value](primitive.f32) for more info.
```
let f = 7.0_f64;
let g = -7.0_f64;
assert!(!f.is_sign_negative());
assert!(g.is_sign_negative());
```
[source](https://doc.rust-lang.org/src/core/num/f64.rs.html#719)const: [unstable](https://github.com/rust-lang/rust/issues/91399 "Tracking issue for float_next_up_down") · #### pub fn next\_up(self) -> f64
🔬This is a nightly-only experimental API. (`float_next_up_down` [#91399](https://github.com/rust-lang/rust/issues/91399))
Returns the least number greater than `self`.
Let `TINY` be the smallest representable positive `f64`. Then,
* if `self.is_nan()`, this returns `self`;
* if `self` is [`NEG_INFINITY`](primitive.f64#associatedconstant.NEG_INFINITY), this returns [`MIN`](primitive.f64#associatedconstant.MIN);
* if `self` is `-TINY`, this returns -0.0;
* if `self` is -0.0 or +0.0, this returns `TINY`;
* if `self` is [`MAX`](primitive.f64#associatedconstant.MAX) or [`INFINITY`](primitive.f64#associatedconstant.INFINITY), this returns [`INFINITY`](primitive.f64#associatedconstant.INFINITY);
* otherwise the unique least value greater than `self` is returned.
The identity `x.next_up() == -(-x).next_down()` holds for all non-NaN `x`. When `x` is finite `x == x.next_up().next_down()` also holds.
```
#![feature(float_next_up_down)]
// f64::EPSILON is the difference between 1.0 and the next number up.
assert_eq!(1.0f64.next_up(), 1.0 + f64::EPSILON);
// But not for most numbers.
assert!(0.1f64.next_up() < 0.1 + f64::EPSILON);
assert_eq!(9007199254740992f64.next_up(), 9007199254740994.0);
```
[source](https://doc.rust-lang.org/src/core/num/f64.rs.html#769)const: [unstable](https://github.com/rust-lang/rust/issues/91399 "Tracking issue for float_next_up_down") · #### pub fn next\_down(self) -> f64
🔬This is a nightly-only experimental API. (`float_next_up_down` [#91399](https://github.com/rust-lang/rust/issues/91399))
Returns the greatest number less than `self`.
Let `TINY` be the smallest representable positive `f64`. Then,
* if `self.is_nan()`, this returns `self`;
* if `self` is [`INFINITY`](primitive.f64#associatedconstant.INFINITY), this returns [`MAX`](primitive.f64#associatedconstant.MAX);
* if `self` is `TINY`, this returns 0.0;
* if `self` is -0.0 or +0.0, this returns `-TINY`;
* if `self` is [`MIN`](primitive.f64#associatedconstant.MIN) or [`NEG_INFINITY`](primitive.f64#associatedconstant.NEG_INFINITY), this returns [`NEG_INFINITY`](primitive.f64#associatedconstant.NEG_INFINITY);
* otherwise the unique greatest value less than `self` is returned.
The identity `x.next_down() == -(-x).next_up()` holds for all non-NaN `x`. When `x` is finite `x == x.next_down().next_up()` also holds.
```
#![feature(float_next_up_down)]
let x = 1.0f64;
// Clamp value into range [0, 1).
let clamped = x.clamp(0.0, 1.0f64.next_down());
assert!(clamped < 1.0);
assert_eq!(clamped.next_up(), 1.0);
```
[source](https://doc.rust-lang.org/src/core/num/f64.rs.html#802)#### pub fn recip(self) -> f64
Takes the reciprocal (inverse) of a number, `1/x`.
```
let x = 2.0_f64;
let abs_difference = (x.recip() - (1.0 / x)).abs();
assert!(abs_difference < 1e-10);
```
[source](https://doc.rust-lang.org/src/core/num/f64.rs.html#819)#### pub fn to\_degrees(self) -> f64
Converts radians to degrees.
```
let angle = std::f64::consts::PI;
let abs_difference = (angle.to_degrees() - 180.0).abs();
assert!(abs_difference < 1e-10);
```
[source](https://doc.rust-lang.org/src/core/num/f64.rs.html#839)#### pub fn to\_radians(self) -> f64
Converts degrees to radians.
```
let angle = 180.0_f64;
let abs_difference = (angle.to_radians() - std::f64::consts::PI).abs();
assert!(abs_difference < 1e-10);
```
[source](https://doc.rust-lang.org/src/core/num/f64.rs.html#860)#### pub fn max(self, other: f64) -> f64
Returns the maximum of the two numbers, ignoring NaN.
If one of the arguments is NaN, then the other argument is returned. This follows the IEEE 754-2008 semantics for maxNum, except for handling of signaling NaNs; this function handles all NaNs the same way and avoids maxNum’s problems with associativity. This also matches the behavior of libm’s fmax.
```
let x = 1.0_f64;
let y = 2.0_f64;
assert_eq!(x.max(y), y);
```
[source](https://doc.rust-lang.org/src/core/num/f64.rs.html#880)#### pub fn min(self, other: f64) -> f64
Returns the minimum of the two numbers, ignoring NaN.
If one of the arguments is NaN, then the other argument is returned. This follows the IEEE 754-2008 semantics for minNum, except for handling of signaling NaNs; this function handles all NaNs the same way and avoids minNum’s problems with associativity. This also matches the behavior of libm’s fmin.
```
let x = 1.0_f64;
let y = 2.0_f64;
assert_eq!(x.min(y), x);
```
[source](https://doc.rust-lang.org/src/core/num/f64.rs.html#907)#### pub fn maximum(self, other: f64) -> f64
🔬This is a nightly-only experimental API. (`float_minimum_maximum` [#91079](https://github.com/rust-lang/rust/issues/91079))
Returns the maximum of the two numbers, propagating NaN.
This returns NaN when *either* argument is NaN, as opposed to [`f64::max`](primitive.f64#method.max "f64::max") which only returns NaN when *both* arguments are NaN.
```
#![feature(float_minimum_maximum)]
let x = 1.0_f64;
let y = 2.0_f64;
assert_eq!(x.maximum(y), y);
assert!(x.maximum(f64::NAN).is_nan());
```
If one of the arguments is NaN, then NaN is returned. Otherwise this returns the greater of the two numbers. For this operation, -0.0 is considered to be less than +0.0. Note that this follows the semantics specified in IEEE 754-2019.
Also note that “propagation” of NaNs here doesn’t necessarily mean that the bitpattern of a NaN operand is conserved; see [explanation of NaN as a special value](primitive.f32) for more info.
[source](https://doc.rust-lang.org/src/core/num/f64.rs.html#942)#### pub fn minimum(self, other: f64) -> f64
🔬This is a nightly-only experimental API. (`float_minimum_maximum` [#91079](https://github.com/rust-lang/rust/issues/91079))
Returns the minimum of the two numbers, propagating NaN.
This returns NaN when *either* argument is NaN, as opposed to [`f64::min`](primitive.f64#method.min "f64::min") which only returns NaN when *both* arguments are NaN.
```
#![feature(float_minimum_maximum)]
let x = 1.0_f64;
let y = 2.0_f64;
assert_eq!(x.minimum(y), x);
assert!(x.minimum(f64::NAN).is_nan());
```
If one of the arguments is NaN, then NaN is returned. Otherwise this returns the lesser of the two numbers. For this operation, -0.0 is considered to be less than +0.0. Note that this follows the semantics specified in IEEE 754-2019.
Also note that “propagation” of NaNs here doesn’t necessarily mean that the bitpattern of a NaN operand is conserved; see [explanation of NaN as a special value](primitive.f32) for more info.
[source](https://doc.rust-lang.org/src/core/num/f64.rs.html#978-980)1.44.0 · #### pub unsafe fn to\_int\_unchecked<Int>(self) -> Intwhere [f64](primitive.f64): [FloatToInt](convert/trait.floattoint "trait std::convert::FloatToInt")<Int>,
Rounds toward zero and converts to any primitive integer type, assuming that the value is finite and fits in that type.
```
let value = 4.6_f64;
let rounded = unsafe { value.to_int_unchecked::<u16>() };
assert_eq!(rounded, 4);
let value = -128.9_f64;
let rounded = unsafe { value.to_int_unchecked::<i8>() };
assert_eq!(rounded, i8::MIN);
```
##### Safety
The value must:
* Not be `NaN`
* Not be infinite
* Be representable in the return type `Int`, after truncating off its fractional part
[source](https://doc.rust-lang.org/src/core/num/f64.rs.html#1009)1.20.0 (const: [unstable](https://github.com/rust-lang/rust/issues/72447 "Tracking issue for const_float_bits_conv")) · #### pub fn to\_bits(self) -> u64
Raw transmutation to `u64`.
This is currently identical to `transmute::<f64, u64>(self)` on all platforms.
See [`from_bits`](primitive.f64#method.from_bits) for some discussion of the portability of this operation (there are almost no issues).
Note that this function is distinct from `as` casting, which attempts to preserve the *numeric* value, and not the bitwise value.
##### Examples
```
assert!((1f64).to_bits() != 1f64 as u64); // to_bits() is not casting!
assert_eq!((12.5f64).to_bits(), 0x4029000000000000);
```
[source](https://doc.rust-lang.org/src/core/num/f64.rs.html#1081)1.20.0 (const: [unstable](https://github.com/rust-lang/rust/issues/72447 "Tracking issue for const_float_bits_conv")) · #### pub fn from\_bits(v: u64) -> f64
Raw transmutation from `u64`.
This is currently identical to `transmute::<u64, f64>(v)` on all platforms. It turns out this is incredibly portable, for two reasons:
* Floats and Ints have the same endianness on all supported platforms.
* IEEE 754 very precisely specifies the bit layout of floats.
However there is one caveat: prior to the 2008 version of IEEE 754, how to interpret the NaN signaling bit wasn’t actually specified. Most platforms (notably x86 and ARM) picked the interpretation that was ultimately standardized in 2008, but some didn’t (notably MIPS). As a result, all signaling NaNs on MIPS are quiet NaNs on x86, and vice-versa.
Rather than trying to preserve signaling-ness cross-platform, this implementation favors preserving the exact bits. This means that any payloads encoded in NaNs will be preserved even if the result of this method is sent over the network from an x86 machine to a MIPS one.
If the results of this method are only manipulated by the same architecture that produced them, then there is no portability concern.
If the input isn’t NaN, then there is no portability concern.
If you don’t care about signaling-ness (very likely), then there is no portability concern.
Note that this function is distinct from `as` casting, which attempts to preserve the *numeric* value, and not the bitwise value.
##### Examples
```
let v = f64::from_bits(0x4029000000000000);
assert_eq!(v, 12.5);
```
[source](https://doc.rust-lang.org/src/core/num/f64.rs.html#1155)1.40.0 (const: [unstable](https://github.com/rust-lang/rust/issues/72447 "Tracking issue for const_float_bits_conv")) · #### pub fn to\_be\_bytes(self) -> [u8; 8]
Return the memory representation of this floating point number as a byte array in big-endian (network) byte order.
See [`from_bits`](primitive.f64#method.from_bits) for some discussion of the portability of this operation (there are almost no issues).
##### Examples
```
let bytes = 12.5f64.to_be_bytes();
assert_eq!(bytes, [0x40, 0x29, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]);
```
[source](https://doc.rust-lang.org/src/core/num/f64.rs.html#1176)1.40.0 (const: [unstable](https://github.com/rust-lang/rust/issues/72447 "Tracking issue for const_float_bits_conv")) · #### pub fn to\_le\_bytes(self) -> [u8; 8]
Return the memory representation of this floating point number as a byte array in little-endian byte order.
See [`from_bits`](primitive.f64#method.from_bits) for some discussion of the portability of this operation (there are almost no issues).
##### Examples
```
let bytes = 12.5f64.to_le_bytes();
assert_eq!(bytes, [0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x29, 0x40]);
```
[source](https://doc.rust-lang.org/src/core/num/f64.rs.html#1210)1.40.0 (const: [unstable](https://github.com/rust-lang/rust/issues/72447 "Tracking issue for const_float_bits_conv")) · #### pub fn to\_ne\_bytes(self) -> [u8; 8]
Return the memory representation of this floating point number as a byte array in native byte order.
As the target platform’s native endianness is used, portable code should use [`to_be_bytes`](primitive.f64#method.to_be_bytes) or [`to_le_bytes`](primitive.f64#method.to_le_bytes), as appropriate, instead.
See [`from_bits`](primitive.f64#method.from_bits) for some discussion of the portability of this operation (there are almost no issues).
##### Examples
```
let bytes = 12.5f64.to_ne_bytes();
assert_eq!(
bytes,
if cfg!(target_endian = "big") {
[0x40, 0x29, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]
} else {
[0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x29, 0x40]
}
);
```
[source](https://doc.rust-lang.org/src/core/num/f64.rs.html#1229)1.40.0 (const: [unstable](https://github.com/rust-lang/rust/issues/72447 "Tracking issue for const_float_bits_conv")) · #### pub fn from\_be\_bytes(bytes: [u8; 8]) -> f64
Create a floating point value from its representation as a byte array in big endian.
See [`from_bits`](primitive.f64#method.from_bits) for some discussion of the portability of this operation (there are almost no issues).
##### Examples
```
let value = f64::from_be_bytes([0x40, 0x29, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]);
assert_eq!(value, 12.5);
```
[source](https://doc.rust-lang.org/src/core/num/f64.rs.html#1248)1.40.0 (const: [unstable](https://github.com/rust-lang/rust/issues/72447 "Tracking issue for const_float_bits_conv")) · #### pub fn from\_le\_bytes(bytes: [u8; 8]) -> f64
Create a floating point value from its representation as a byte array in little endian.
See [`from_bits`](primitive.f64#method.from_bits) for some discussion of the portability of this operation (there are almost no issues).
##### Examples
```
let value = f64::from_le_bytes([0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x29, 0x40]);
assert_eq!(value, 12.5);
```
[source](https://doc.rust-lang.org/src/core/num/f64.rs.html#1278)1.40.0 (const: [unstable](https://github.com/rust-lang/rust/issues/72447 "Tracking issue for const_float_bits_conv")) · #### pub fn from\_ne\_bytes(bytes: [u8; 8]) -> f64
Create a floating point value from its representation as a byte array in native endian.
As the target platform’s native endianness is used, portable code likely wants to use [`from_be_bytes`](primitive.f64#method.from_be_bytes) or [`from_le_bytes`](primitive.f64#method.from_le_bytes), as appropriate instead.
See [`from_bits`](primitive.f64#method.from_bits) for some discussion of the portability of this operation (there are almost no issues).
##### Examples
```
let value = f64::from_ne_bytes(if cfg!(target_endian = "big") {
[0x40, 0x29, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]
} else {
[0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x29, 0x40]
});
assert_eq!(value, 12.5);
```
[source](https://doc.rust-lang.org/src/core/num/f64.rs.html#1336)1.62.0 · #### pub fn total\_cmp(&self, other: &f64) -> Ordering
Return the ordering between `self` and `other`.
Unlike the standard partial comparison between floating point numbers, this comparison always produces an ordering in accordance to the `totalOrder` predicate as defined in the IEEE 754 (2008 revision) floating point standard. The values are ordered in the following sequence:
* negative quiet NaN
* negative signaling NaN
* negative infinity
* negative numbers
* negative subnormal numbers
* negative zero
* positive zero
* positive subnormal numbers
* positive numbers
* positive infinity
* positive signaling NaN
* positive quiet NaN.
The ordering established by this function does not always agree with the [`PartialOrd`](cmp/trait.partialord "PartialOrd") and [`PartialEq`](cmp/trait.partialeq "PartialEq") implementations of `f64`. For example, they consider negative and positive zero equal, while `total_cmp` doesn’t.
The interpretation of the signaling NaN bit follows the definition in the IEEE 754 standard, which may not match the interpretation by some of the older, non-conformant (e.g. MIPS) hardware implementations.
##### Example
```
struct GoodBoy {
name: String,
weight: f64,
}
let mut bois = vec![
GoodBoy { name: "Pucci".to_owned(), weight: 0.1 },
GoodBoy { name: "Woofer".to_owned(), weight: 99.0 },
GoodBoy { name: "Yapper".to_owned(), weight: 10.0 },
GoodBoy { name: "Chonk".to_owned(), weight: f64::INFINITY },
GoodBoy { name: "Abs. Unit".to_owned(), weight: f64::NAN },
GoodBoy { name: "Floaty".to_owned(), weight: -5.0 },
];
bois.sort_by(|a, b| a.weight.total_cmp(&b.weight));
```
[source](https://doc.rust-lang.org/src/core/num/f64.rs.html#1391)1.50.0 · #### pub fn clamp(self, min: f64, max: f64) -> f64
Restrict a value to a certain interval unless it is NaN.
Returns `max` if `self` is greater than `max`, and `min` if `self` is less than `min`. Otherwise this returns `self`.
Note that this function returns NaN if the initial value was NaN as well.
##### Panics
Panics if `min > max`, `min` is NaN, or `max` is NaN.
##### Examples
```
assert!((-3.0f64).clamp(-2.0, 1.0) == -2.0);
assert!((0.0f64).clamp(-2.0, 1.0) == 0.0);
assert!((2.0f64).clamp(-2.0, 1.0) == 1.0);
assert!((f64::NAN).clamp(-2.0, 1.0).is_nan());
```
Trait Implementations
---------------------
[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
The resulting type after applying the `+` operator.
[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") · #### fn add(self, other: &f64) -> <f64 as Add<f64>>::Output
Performs the `+` operation. [Read more](ops/trait.add#tymethod.add)
[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
The resulting type after applying the `+` operator.
[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") · #### fn add(self, other: &f64) -> <f64 as Add<f64>>::Output
Performs the `+` operation. [Read more](ops/trait.add#tymethod.add)
[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
The resulting type after applying the `+` operator.
[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") · #### fn add(self, other: f64) -> <f64 as Add<f64>>::Output
Performs the `+` operation. [Read more](ops/trait.add#tymethod.add)
[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
The resulting type after applying the `+` operator.
[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") · #### fn add(self, other: f64) -> f64
Performs the `+` operation. [Read more](ops/trait.add#tymethod.add)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn add\_assign(&mut self, other: &f64)
Performs the `+=` operation. [Read more](ops/trait.addassign#tymethod.add_assign)
[source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#786)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn add\_assign(&mut self, other: f64)
Performs the `+=` operation. [Read more](ops/trait.addassign#tymethod.add_assign)
[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") · #### fn clone(&self) -> f64
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/float.rs.html#226)### impl Debug for f64
[source](https://doc.rust-lang.org/src/core/fmt/float.rs.html#226)#### 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/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#222)const: [unstable](https://github.com/rust-lang/rust/issues/87864 "Tracking issue for const_default_impls") · #### fn default() -> f64
Returns the default value of `0.0`
[source](https://doc.rust-lang.org/src/core/fmt/float.rs.html#226)### impl Display for f64
[source](https://doc.rust-lang.org/src/core/fmt/float.rs.html#226)#### 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/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
The resulting type after applying the `/` operator.
[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") · #### fn div(self, other: &f64) -> <f64 as Div<f64>>::Output
Performs the `/` operation. [Read more](ops/trait.div#tymethod.div)
[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
The resulting type after applying the `/` operator.
[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") · #### fn div(self, other: &f64) -> <f64 as Div<f64>>::Output
Performs the `/` operation. [Read more](ops/trait.div#tymethod.div)
[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
The resulting type after applying the `/` operator.
[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") · #### fn div(self, other: f64) -> <f64 as Div<f64>>::Output
Performs the `/` operation. [Read more](ops/trait.div#tymethod.div)
[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
The resulting type after applying the `/` operator.
[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") · #### fn div(self, other: f64) -> f64
Performs the `/` operation. [Read more](ops/trait.div#tymethod.div)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn div\_assign(&mut self, other: &f64)
Performs the `/=` operation. [Read more](ops/trait.divassign#tymethod.div_assign)
[source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#968)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn div\_assign(&mut self, other: f64)
Performs the `/=` operation. [Read more](ops/trait.divassign#tymethod.div_assign)
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#169)1.6.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<f32> for f64
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#169)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: f32) -> f64
Converts `f32` to `f64` losslessly.
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#158)1.6.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<i16> for f64
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#158)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: i16) -> f64
Converts `i16` to `f64` losslessly.
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#159)1.6.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<i32> for f64
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#159)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: i32) -> f64
Converts `i32` to `f64` losslessly.
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#156)1.6.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<i8> for f64
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#156)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: i8) -> f64
Converts `i8` to `f64` losslessly.
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#165)1.6.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<u16> for f64
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#165)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: u16) -> f64
Converts `u16` to `f64` losslessly.
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#166)1.6.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<u32> for f64
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#166)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: u32) -> f64
Converts `u32` to `f64` losslessly.
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#163)1.6.0 (const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num")) · ### impl From<u8> for f64
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#163)const: [unstable](https://github.com/rust-lang/rust/issues/87852 "Tracking issue for const_num_from_num") · #### fn from(small: u8) -> f64
Converts `u8` to `f64` losslessly.
[source](https://doc.rust-lang.org/src/core/num/dec2flt/mod.rs.html#157)### impl FromStr for f64
[source](https://doc.rust-lang.org/src/core/num/dec2flt/mod.rs.html#157)#### fn from\_str(src: &str) -> Result<f64, ParseFloatError>
Converts a string in base 10 to a float. Accepts an optional decimal exponent.
This function accepts strings such as
* ‘3.14’
* ‘-3.14’
* ‘2.5E10’, or equivalently, ‘2.5e10’
* ‘2.5E-10’
* ‘5.’
* ‘.5’, or, equivalently, ‘0.5’
* ‘inf’, ‘-inf’, ‘+infinity’, ‘NaN’
Note that alphabetical characters are not case-sensitive.
Leading and trailing whitespace represent an error.
##### Grammar
All strings that adhere to the following [EBNF](https://www.w3.org/TR/REC-xml/#sec-notation) grammar when lowercased will result in an [`Ok`](result/enum.result#variant.Ok "Ok") being returned:
```
Float ::= Sign? ( 'inf' | 'infinity' | 'nan' | Number )
Number ::= ( Digit+ |
Digit+ '.' Digit* |
Digit* '.' Digit+ ) Exp?
Exp ::= 'e' Sign? Digit+
Sign ::= [+-]
Digit ::= [0-9]
```
##### Arguments
* src - A string
##### Return value
`Err(ParseFloatError)` if the string did not represent a valid number. Otherwise, `Ok(n)` where `n` is the closest representable floating-point number to the number represented by `src` (following the same rules for rounding as for the results of primitive operations).
#### type Err = ParseFloatError
The associated error which can be returned from parsing.
[source](https://doc.rust-lang.org/src/core/fmt/float.rs.html#226)### impl LowerExp for f64
[source](https://doc.rust-lang.org/src/core/fmt/float.rs.html#226)#### fn fmt(&self, fmt: &mut Formatter<'\_>) -> Result<(), Error>
Formats the value using the given formatter.
[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
The resulting type after applying the `*` operator.
[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") · #### fn mul(self, other: &f64) -> <f64 as Mul<f64>>::Output
Performs the `*` operation. [Read more](ops/trait.mul#tymethod.mul)
[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
The resulting type after applying the `*` operator.
[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") · #### fn mul(self, other: &f64) -> <f64 as Mul<f64>>::Output
Performs the `*` operation. [Read more](ops/trait.mul#tymethod.mul)
[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
The resulting type after applying the `*` operator.
[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") · #### fn mul(self, other: f64) -> <f64 as Mul<f64>>::Output
Performs the `*` operation. [Read more](ops/trait.mul#tymethod.mul)
[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
The resulting type after applying the `*` operator.
[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") · #### fn mul(self, other: f64) -> f64
Performs the `*` operation. [Read more](ops/trait.mul#tymethod.mul)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn mul\_assign(&mut self, other: &f64)
Performs the `*=` operation. [Read more](ops/trait.mulassign#tymethod.mul_assign)
[source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#911)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn mul\_assign(&mut self, other: f64)
Performs the `*=` operation. [Read more](ops/trait.mulassign#tymethod.mul_assign)
[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
The resulting type after applying the `-` operator.
[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") · #### fn neg(self) -> <f64 as Neg>::Output
Performs the unary `-` operation. [Read more](ops/trait.neg#tymethod.neg)
[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
The resulting type after applying the `-` operator.
[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") · #### fn neg(self) -> f64
Performs the unary `-` operation. [Read more](ops/trait.neg#tymethod.neg)
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1366-1368)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · ### impl PartialEq<f64> for f64
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1366-1368)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · #### fn eq(&self, other: &f64) -> 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#1366-1368)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · #### fn ne(&self, other: &f64) -> 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/cmp.rs.html#1423)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · ### impl PartialOrd<f64> for f64
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1423)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · #### fn partial\_cmp(&self, other: &f64) -> 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#1423)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · #### fn lt(&self, other: &f64) -> 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#1423)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · #### fn le(&self, other: &f64) -> 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#1423)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · #### fn ge(&self, other: &f64) -> 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/cmp.rs.html#1423)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · #### fn gt(&self, other: &f64) -> 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/iter/traits/accum.rs.html#142)1.12.0 · ### impl<'a> Product<&'a f64> for f64
[source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#142)#### fn product<I>(iter: I) -> f64where I: [Iterator](iter/trait.iterator "trait std::iter::Iterator")<Item = &'a [f64](primitive.f64)>,
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#142)1.12.0 · ### impl Product<f64> for f64
[source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#142)#### fn product<I>(iter: I) -> f64where I: [Iterator](iter/trait.iterator "trait std::iter::Iterator")<Item = [f64](primitive.f64)>,
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/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
The resulting type after applying the `%` operator.
[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") · #### fn rem(self, other: &f64) -> <f64 as Rem<f64>>::Output
Performs the `%` operation. [Read more](ops/trait.rem#tymethod.rem)
[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
The resulting type after applying the `%` operator.
[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") · #### fn rem(self, other: &f64) -> <f64 as Rem<f64>>::Output
Performs the `%` operation. [Read more](ops/trait.rem#tymethod.rem)
[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
The resulting type after applying the `%` operator.
[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") · #### fn rem(self, other: f64) -> <f64 as Rem<f64>>::Output
Performs the `%` operation. [Read more](ops/trait.rem#tymethod.rem)
[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
The resulting type after applying the `%` operator.
[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") · #### fn rem(self, other: f64) -> f64
Performs the `%` operation. [Read more](ops/trait.rem#tymethod.rem)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn rem\_assign(&mut self, other: &f64)
Performs the `%=` operation. [Read more](ops/trait.remassign#tymethod.rem_assign)
[source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#1029)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn rem\_assign(&mut self, other: f64)
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/vector.rs.html#740)### impl SimdElement for f64
#### type Mask = i64
🔬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.
[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
The resulting type after applying the `-` operator.
[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") · #### fn sub(self, other: &f64) -> <f64 as Sub<f64>>::Output
Performs the `-` operation. [Read more](ops/trait.sub#tymethod.sub)
[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
The resulting type after applying the `-` operator.
[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") · #### fn sub(self, other: &f64) -> <f64 as Sub<f64>>::Output
Performs the `-` operation. [Read more](ops/trait.sub#tymethod.sub)
[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
The resulting type after applying the `-` operator.
[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") · #### fn sub(self, other: f64) -> <f64 as Sub<f64>>::Output
Performs the `-` operation. [Read more](ops/trait.sub#tymethod.sub)
[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
The resulting type after applying the `-` operator.
[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") · #### fn sub(self, other: f64) -> f64
Performs the `-` operation. [Read more](ops/trait.sub#tymethod.sub)
[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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn sub\_assign(&mut self, other: &f64)
Performs the `-=` operation. [Read more](ops/trait.subassign#tymethod.sub_assign)
[source](https://doc.rust-lang.org/src/core/ops/arith.rs.html#853)1.8.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)const: [unstable](https://github.com/rust-lang/rust/issues/90080 "Tracking issue for const_ops") · #### fn sub\_assign(&mut self, other: f64)
Performs the `-=` operation. [Read more](ops/trait.subassign#tymethod.sub_assign)
[source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#142)1.12.0 · ### impl<'a> Sum<&'a f64> for f64
[source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#142)#### fn sum<I>(iter: I) -> f64where I: [Iterator](iter/trait.iterator "trait std::iter::Iterator")<Item = &'a [f64](primitive.f64)>,
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#142)1.12.0 · ### impl Sum<f64> for f64
[source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#142)#### fn sum<I>(iter: I) -> f64where I: [Iterator](iter/trait.iterator "trait std::iter::Iterator")<Item = [f64](primitive.f64)>,
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/fmt/float.rs.html#226)### impl UpperExp for f64
[source](https://doc.rust-lang.org/src/core/fmt/float.rs.html#226)#### fn fmt(&self, fmt: &mut Formatter<'\_>) -> Result<(), Error>
Formats the value using the given formatter.
[source](https://doc.rust-lang.org/src/core/marker.rs.html#830-835)### impl Copy for f64
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#39)### impl FloatToInt<i128> for f64
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#39)### impl FloatToInt<i16> for f64
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#39)### impl FloatToInt<i32> for f64
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#39)### impl FloatToInt<i64> for f64
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#39)### impl FloatToInt<i8> for f64
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#39)### impl FloatToInt<isize> for f64
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#39)### impl FloatToInt<u128> for f64
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#39)### impl FloatToInt<u16> for f64
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#39)### impl FloatToInt<u32> for f64
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#39)### impl FloatToInt<u64> for f64
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#39)### impl FloatToInt<u8> for f64
[source](https://doc.rust-lang.org/src/core/convert/num.rs.html#39)### impl FloatToInt<usize> for f64
Auto Trait Implementations
--------------------------
### impl RefUnwindSafe for f64
### impl Send for f64
### impl Sync for f64
### impl Unpin for f64
### impl UnwindSafe for f64
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 Primitive Type char Primitive Type char
===================
A character type.
The `char` type represents a single character. More specifically, since ‘character’ isn’t a well-defined concept in Unicode, `char` is a ‘[Unicode scalar value](https://www.unicode.org/glossary/#unicode_scalar_value)’.
This documentation describes a number of methods and trait implementations on the `char` type. For technical reasons, there is additional, separate documentation in [the `std::char` module](char/index) as well.
Validity
--------
A `char` is a ‘[Unicode scalar value](https://www.unicode.org/glossary/#unicode_scalar_value)’, which is any ‘[Unicode code point](https://www.unicode.org/glossary/#code_point)’ other than a [surrogate code point](https://www.unicode.org/glossary/#surrogate_code_point). This has a fixed numerical definition: code points are in the range 0 to 0x10FFFF, inclusive. Surrogate code points, used by UTF-16, are in the range 0xD800 to 0xDFFF.
No `char` may be constructed, whether as a literal or at runtime, that is not a Unicode scalar value:
ⓘ
```
// Each of these is a compiler error
['\u{D800}', '\u{DFFF}', '\u{110000}'];
```
ⓘ
```
// Panics; from_u32 returns None.
char::from_u32(0xDE01).unwrap();
```
```
// Undefined behaviour
unsafe { char::from_u32_unchecked(0x110000) };
```
USVs are also the exact set of values that may be encoded in UTF-8. Because `char` values are USVs and `str` values are valid UTF-8, it is safe to store any `char` in a `str` or read any character from a `str` as a `char`.
The gap in valid `char` values is understood by the compiler, so in the below example the two ranges are understood to cover the whole range of possible `char` values and there is no error for a [non-exhaustive match](../book/ch06-02-match#matches-are-exhaustive).
```
let c: char = 'a';
match c {
'\0' ..= '\u{D7FF}' => false,
'\u{E000}' ..= '\u{10FFFF}' => true,
};
```
All USVs are valid `char` values, but not all of them represent a real character. Many USVs are not currently assigned to a character, but may be in the future (“reserved”); some will never be a character (“noncharacters”); and some may be given different meanings by different users (“private use”).
Representation
--------------
`char` is always four bytes in size. This is a different representation than a given character would have as part of a [`String`](string/struct.string). For example:
```
let v = vec!['h', 'e', 'l', 'l', 'o'];
// five elements times four bytes for each element
assert_eq!(20, v.len() * std::mem::size_of::<char>());
let s = String::from("hello");
// five elements times one byte per element
assert_eq!(5, s.len() * std::mem::size_of::<u8>());
```
As always, remember that a human intuition for ‘character’ might not map to Unicode’s definitions. For example, despite looking similar, the ‘é’ character is one Unicode code point while ‘é’ is two Unicode code points:
```
let mut chars = "é".chars();
// U+00e9: 'latin small letter e with acute'
assert_eq!(Some('\u{00e9}'), chars.next());
assert_eq!(None, chars.next());
let mut chars = "é".chars();
// U+0065: 'latin small letter e'
assert_eq!(Some('\u{0065}'), chars.next());
// U+0301: 'combining acute accent'
assert_eq!(Some('\u{0301}'), chars.next());
assert_eq!(None, chars.next());
```
This means that the contents of the first string above *will* fit into a `char` while the contents of the second string *will not*. Trying to create a `char` literal with the contents of the second string gives an error:
```
error: character literal may only contain one codepoint: 'é'
let c = 'é';
^^^
```
Another implication of the 4-byte fixed size of a `char` is that per-`char` processing can end up using a lot more memory:
```
let s = String::from("love: ❤️");
let v: Vec<char> = s.chars().collect();
assert_eq!(12, std::mem::size_of_val(&s[..]));
assert_eq!(32, std::mem::size_of_val(&v[..]));
```
Implementations
---------------
[source](https://doc.rust-lang.org/src/core/char/methods.rs.html#10)### impl char
[source](https://doc.rust-lang.org/src/core/char/methods.rs.html#25)1.52.0 · #### pub const MAX: char = '\u{10ffff}'
The highest valid code point a `char` can have, `'\u{10FFFF}'`.
##### Examples
```
let c: char = something_which_returns_char();
assert!(c <= char::MAX);
let value_at_max = char::MAX as u32;
assert_eq!(char::from_u32(value_at_max), Some('\u{10FFFF}'));
assert_eq!(char::from_u32(value_at_max + 1), None);
```
[source](https://doc.rust-lang.org/src/core/char/methods.rs.html#33)1.52.0 · #### pub const REPLACEMENT\_CHARACTER: char = '�'
`U+FFFD REPLACEMENT CHARACTER` (�) is used in Unicode to represent a decoding error.
It can occur, for example, when giving ill-formed UTF-8 bytes to [`String::from_utf8_lossy`](string/struct.string#method.from_utf8_lossy).
[source](https://doc.rust-lang.org/src/core/char/methods.rs.html#46)1.52.0 · #### pub const UNICODE\_VERSION: (u8, u8, u8) = crate::unicode::UNICODE\_VERSION
The version of [Unicode](https://www.unicode.org/) that the Unicode parts of `char` and `str` methods are based on.
New versions of Unicode are released regularly and subsequently all methods in the standard library depending on Unicode are updated. Therefore the behavior of some `char` and `str` methods and the value of this constant changes over time. This is *not* considered to be a breaking change.
The version numbering scheme is explained in [Unicode 11.0 or later, Section 3.1 Versions of the Unicode Standard](https://www.unicode.org/versions/Unicode11.0.0/ch03.pdf#page=4).
[source](https://doc.rust-lang.org/src/core/char/methods.rs.html#96)1.52.0 · #### pub fn decode\_utf16<I>(iter: I) -> DecodeUtf16<<I as IntoIterator>::IntoIter>where I: [IntoIterator](iter/trait.intoiterator "trait std::iter::IntoIterator")<Item = [u16](primitive.u16)>,
Notable traits for [DecodeUtf16](char/struct.decodeutf16 "struct std::char::DecodeUtf16")<I>
```
impl<I> Iterator for DecodeUtf16<I>where
I: Iterator<Item = u16>,
type Item = Result<char, DecodeUtf16Error>;
```
Creates an iterator over the UTF-16 encoded code points in `iter`, returning unpaired surrogates as `Err`s.
##### Examples
Basic usage:
```
use std::char::decode_utf16;
// 𝄞mus<invalid>ic<invalid>
let v = [
0xD834, 0xDD1E, 0x006d, 0x0075, 0x0073, 0xDD1E, 0x0069, 0x0063, 0xD834,
];
assert_eq!(
decode_utf16(v)
.map(|r| r.map_err(|e| e.unpaired_surrogate()))
.collect::<Vec<_>>(),
vec![
Ok('𝄞'),
Ok('m'), Ok('u'), Ok('s'),
Err(0xDD1E),
Ok('i'), Ok('c'),
Err(0xD834)
]
);
```
A lossy decoder can be obtained by replacing `Err` results with the replacement character:
```
use std::char::{decode_utf16, REPLACEMENT_CHARACTER};
// 𝄞mus<invalid>ic<invalid>
let v = [
0xD834, 0xDD1E, 0x006d, 0x0075, 0x0073, 0xDD1E, 0x0069, 0x0063, 0xD834,
];
assert_eq!(
decode_utf16(v)
.map(|r| r.unwrap_or(REPLACEMENT_CHARACTER))
.collect::<String>(),
"𝄞mus�ic�"
);
```
[source](https://doc.rust-lang.org/src/core/char/methods.rs.html#146)1.52.0 (const: [unstable](https://github.com/rust-lang/rust/issues/89259 "Tracking issue for const_char_convert")) · #### pub fn from\_u32(i: u32) -> Option<char>
Converts a `u32` to a `char`.
Note that all `char`s are valid [`u32`](primitive.u32 "u32")s, and can be cast to one with [`as`](keyword.as):
```
let c = '💯';
let i = c as u32;
assert_eq!(128175, i);
```
However, the reverse is not true: not all valid [`u32`](primitive.u32 "u32")s are valid `char`s. `from_u32()` will return `None` if the input is not a valid value for a `char`.
For an unsafe version of this function which ignores these checks, see [`from_u32_unchecked`](#method.from_u32_unchecked).
##### Examples
Basic usage:
```
use std::char;
let c = char::from_u32(0x2764);
assert_eq!(Some('❤'), c);
```
Returning `None` when the input is not a valid `char`:
```
use std::char;
let c = char::from_u32(0x110000);
assert_eq!(None, c);
```
[source](https://doc.rust-lang.org/src/core/char/methods.rs.html#189)1.52.0 (const: [unstable](https://github.com/rust-lang/rust/issues/89259 "Tracking issue for const_char_convert")) · #### pub unsafe fn from\_u32\_unchecked(i: u32) -> char
Converts a `u32` to a `char`, ignoring validity.
Note that all `char`s are valid [`u32`](primitive.u32 "u32")s, and can be cast to one with `as`:
```
let c = '💯';
let i = c as u32;
assert_eq!(128175, i);
```
However, the reverse is not true: not all valid [`u32`](primitive.u32 "u32")s are valid `char`s. `from_u32_unchecked()` will ignore this, and blindly cast to `char`, possibly creating an invalid one.
##### Safety
This function is unsafe, as it may construct invalid `char` values.
For a safe version of this function, see the [`from_u32`](#method.from_u32) function.
##### Examples
Basic usage:
```
use std::char;
let c = unsafe { char::from_u32_unchecked(0x2764) };
assert_eq!('❤', c);
```
[source](https://doc.rust-lang.org/src/core/char/methods.rs.html#247)1.52.0 (const: [unstable](https://github.com/rust-lang/rust/issues/89259 "Tracking issue for const_char_convert")) · #### pub fn from\_digit(num: u32, radix: u32) -> Option<char>
Converts a digit in the given radix to a `char`.
A ‘radix’ here is sometimes also called a ‘base’. A radix of two indicates a binary number, a radix of ten, decimal, and a radix of sixteen, hexadecimal, to give some common values. Arbitrary radices are supported.
`from_digit()` will return `None` if the input is not a digit in the given radix.
##### Panics
Panics if given a radix larger than 36.
##### Examples
Basic usage:
```
use std::char;
let c = char::from_digit(4, 10);
assert_eq!(Some('4'), c);
// Decimal 11 is a single digit in base 16
let c = char::from_digit(11, 16);
assert_eq!(Some('b'), c);
```
Returning `None` when the input is not a digit:
```
use std::char;
let c = char::from_digit(20, 10);
assert_eq!(None, c);
```
Passing a large radix, causing a panic:
ⓘ
```
use std::char;
// this panics
let _c = char::from_digit(1, 37);
```
[source](https://doc.rust-lang.org/src/core/char/methods.rs.html#293)#### pub fn is\_digit(self, radix: u32) -> bool
Checks if a `char` is a digit in the given radix.
A ‘radix’ here is sometimes also called a ‘base’. A radix of two indicates a binary number, a radix of ten, decimal, and a radix of sixteen, hexadecimal, to give some common values. Arbitrary radices are supported.
Compared to [`is_numeric()`](#method.is_numeric), this function only recognizes the characters `0-9`, `a-z` and `A-Z`.
‘Digit’ is defined to be only the following characters:
* `0-9`
* `a-z`
* `A-Z`
For a more comprehensive understanding of ‘digit’, see [`is_numeric()`](#method.is_numeric).
##### Panics
Panics if given a radix larger than 36.
##### Examples
Basic usage:
```
assert!('1'.is_digit(10));
assert!('f'.is_digit(16));
assert!(!'f'.is_digit(10));
```
Passing a large radix, causing a panic:
ⓘ
```
// this panics
'1'.is_digit(37);
```
[source](https://doc.rust-lang.org/src/core/char/methods.rs.html#345)const: [unstable](https://github.com/rust-lang/rust/issues/89259 "Tracking issue for const_char_convert") · #### pub fn to\_digit(self, radix: u32) -> Option<u32>
Converts a `char` to a digit in the given radix.
A ‘radix’ here is sometimes also called a ‘base’. A radix of two indicates a binary number, a radix of ten, decimal, and a radix of sixteen, hexadecimal, to give some common values. Arbitrary radices are supported.
‘Digit’ is defined to be only the following characters:
* `0-9`
* `a-z`
* `A-Z`
##### Errors
Returns `None` if the `char` does not refer to a digit in the given radix.
##### Panics
Panics if given a radix larger than 36.
##### Examples
Basic usage:
```
assert_eq!('1'.to_digit(10), Some(1));
assert_eq!('f'.to_digit(16), Some(15));
```
Passing a non-digit results in failure:
```
assert_eq!('f'.to_digit(10), None);
assert_eq!('z'.to_digit(16), None);
```
Passing a large radix, causing a panic:
ⓘ
```
// this panics
let _ = '1'.to_digit(37);
```
[source](https://doc.rust-lang.org/src/core/char/methods.rs.html#398)#### pub fn escape\_unicode(self) -> EscapeUnicode
Notable traits for [EscapeUnicode](char/struct.escapeunicode "struct std::char::EscapeUnicode")
```
impl Iterator for EscapeUnicode
type Item = char;
```
Returns an iterator that yields the hexadecimal Unicode escape of a character as `char`s.
This will escape characters with the Rust syntax of the form `\u{NNNNNN}` where `NNNNNN` is a hexadecimal representation.
##### Examples
As an iterator:
```
for c in '❤'.escape_unicode() {
print!("{c}");
}
println!();
```
Using `println!` directly:
```
println!("{}", '❤'.escape_unicode());
```
Both are equivalent to:
```
println!("\\u{{2764}}");
```
Using [`to_string`](string/trait.tostring#tymethod.to_string):
```
assert_eq!('❤'.escape_unicode().to_string(), "\\u{2764}");
```
[source](https://doc.rust-lang.org/src/core/char/methods.rs.html#477)1.20.0 · #### pub fn escape\_debug(self) -> EscapeDebug
Notable traits for [EscapeDebug](char/struct.escapedebug "struct std::char::EscapeDebug")
```
impl Iterator for EscapeDebug
type Item = char;
```
Returns an iterator that yields the literal escape code of a character as `char`s.
This will escape the characters similar to the [`Debug`](fmt/trait.debug) implementations of `str` or `char`.
##### Examples
As an iterator:
```
for c in '\n'.escape_debug() {
print!("{c}");
}
println!();
```
Using `println!` directly:
```
println!("{}", '\n'.escape_debug());
```
Both are equivalent to:
```
println!("\\n");
```
Using [`to_string`](string/trait.tostring#tymethod.to_string):
```
assert_eq!('\n'.escape_debug().to_string(), "\\n");
```
[source](https://doc.rust-lang.org/src/core/char/methods.rs.html#533)#### pub fn escape\_default(self) -> EscapeDefault
Notable traits for [EscapeDefault](char/struct.escapedefault "struct std::char::EscapeDefault")
```
impl Iterator for EscapeDefault
type Item = char;
```
Returns an iterator that yields the literal escape code of a character as `char`s.
The default is chosen with a bias toward producing literals that are legal in a variety of languages, including C++11 and similar C-family languages. The exact rules are:
* Tab is escaped as `\t`.
* Carriage return is escaped as `\r`.
* Line feed is escaped as `\n`.
* Single quote is escaped as `\'`.
* Double quote is escaped as `\"`.
* Backslash is escaped as `\\`.
* Any character in the ‘printable ASCII’ range `0x20` .. `0x7e` inclusive is not escaped.
* All other characters are given hexadecimal Unicode escapes; see [`escape_unicode`](#method.escape_unicode).
##### Examples
As an iterator:
```
for c in '"'.escape_default() {
print!("{c}");
}
println!();
```
Using `println!` directly:
```
println!("{}", '"'.escape_default());
```
Both are equivalent to:
```
println!("\\\"");
```
Using [`to_string`](string/trait.tostring#tymethod.to_string):
```
assert_eq!('"'.escape_default().to_string(), "\\\"");
```
[source](https://doc.rust-lang.org/src/core/char/methods.rs.html#593)const: 1.52.0 · #### pub const fn len\_utf8(self) -> usize
Returns the number of bytes this `char` would need if encoded in UTF-8.
That number of bytes is always between 1 and 4, inclusive.
##### Examples
Basic usage:
```
let len = 'A'.len_utf8();
assert_eq!(len, 1);
let len = 'ß'.len_utf8();
assert_eq!(len, 2);
let len = 'ℝ'.len_utf8();
assert_eq!(len, 3);
let len = '💣'.len_utf8();
assert_eq!(len, 4);
```
The `&str` type guarantees that its contents are UTF-8, and so we can compare the length it would take if each code point was represented as a `char` vs in the `&str` itself:
```
// as chars
let eastern = '東';
let capital = '京';
// both can be represented as three bytes
assert_eq!(3, eastern.len_utf8());
assert_eq!(3, capital.len_utf8());
// as a &str, these two are encoded in UTF-8
let tokyo = "東京";
let len = eastern.len_utf8() + capital.len_utf8();
// we can see that they take six bytes total...
assert_eq!(6, tokyo.len());
// ... just like the &str
assert_eq!(len, tokyo.len());
```
[source](https://doc.rust-lang.org/src/core/char/methods.rs.html#619)const: 1.52.0 · #### pub const fn len\_utf16(self) -> usize
Returns the number of 16-bit code units this `char` would need if encoded in UTF-16.
See the documentation for [`len_utf8()`](#method.len_utf8) for more explanation of this concept. This function is a mirror, but for UTF-16 instead of UTF-8.
##### Examples
Basic usage:
```
let n = 'ß'.len_utf16();
assert_eq!(n, 1);
let len = '💣'.len_utf16();
assert_eq!(len, 2);
```
[source](https://doc.rust-lang.org/src/core/char/methods.rs.html#656)1.15.0 · #### pub fn encode\_utf8(self, dst: &mut [u8]) -> &mut str
Encodes this character as UTF-8 into the provided byte buffer, and then returns the subslice of the buffer that contains the encoded character.
##### Panics
Panics if the buffer is not large enough. A buffer of length four is large enough to encode any `char`.
##### Examples
In both of these examples, ‘ß’ takes two bytes to encode.
```
let mut b = [0; 2];
let result = 'ß'.encode_utf8(&mut b);
assert_eq!(result, "ß");
assert_eq!(result.len(), 2);
```
A buffer that’s too small:
ⓘ
```
let mut b = [0; 1];
// this panics
'ß'.encode_utf8(&mut b);
```
[source](https://doc.rust-lang.org/src/core/char/methods.rs.html#691)1.15.0 · #### pub fn encode\_utf16(self, dst: &mut [u16]) -> &mut [u16]
Encodes this character as UTF-16 into the provided `u16` buffer, and then returns the subslice of the buffer that contains the encoded character.
##### Panics
Panics if the buffer is not large enough. A buffer of length 2 is large enough to encode any `char`.
##### Examples
In both of these examples, ‘𝕊’ takes two `u16`s to encode.
```
let mut b = [0; 2];
let result = '𝕊'.encode_utf16(&mut b);
assert_eq!(result.len(), 2);
```
A buffer that’s too small:
ⓘ
```
let mut b = [0; 1];
// this panics
'𝕊'.encode_utf16(&mut b);
```
[source](https://doc.rust-lang.org/src/core/char/methods.rs.html#719)#### pub fn is\_alphabetic(self) -> bool
Returns `true` if this `char` has the `Alphabetic` property.
`Alphabetic` is described in Chapter 4 (Character Properties) of the [Unicode Standard](https://www.unicode.org/versions/latest/) and specified in the [Unicode Character Database](https://www.unicode.org/reports/tr44/) [`DerivedCoreProperties.txt`](https://www.unicode.org/Public/UCD/latest/ucd/DerivedCoreProperties.txt).
##### Examples
Basic usage:
```
assert!('a'.is_alphabetic());
assert!('京'.is_alphabetic());
let c = '💝';
// love is many things, but it is not alphabetic
assert!(!c.is_alphabetic());
```
[source](https://doc.rust-lang.org/src/core/char/methods.rs.html#761)const: [unstable](https://github.com/rust-lang/rust/issues/101400 "Tracking issue for const_unicode_case_lookup") · #### pub fn is\_lowercase(self) -> bool
Returns `true` if this `char` has the `Lowercase` property.
`Lowercase` is described in Chapter 4 (Character Properties) of the [Unicode Standard](https://www.unicode.org/versions/latest/) and specified in the [Unicode Character Database](https://www.unicode.org/reports/tr44/) [`DerivedCoreProperties.txt`](https://www.unicode.org/Public/UCD/latest/ucd/DerivedCoreProperties.txt).
##### Examples
Basic usage:
```
assert!('a'.is_lowercase());
assert!('δ'.is_lowercase());
assert!(!'A'.is_lowercase());
assert!(!'Δ'.is_lowercase());
// The various Chinese scripts and punctuation do not have case, and so:
assert!(!'中'.is_lowercase());
assert!(!' '.is_lowercase());
```
In a const context:
```
#![feature(const_unicode_case_lookup)]
const CAPITAL_DELTA_IS_LOWERCASE: bool = 'Δ'.is_lowercase();
assert!(!CAPITAL_DELTA_IS_LOWERCASE);
```
[source](https://doc.rust-lang.org/src/core/char/methods.rs.html#803)const: [unstable](https://github.com/rust-lang/rust/issues/101400 "Tracking issue for const_unicode_case_lookup") · #### pub fn is\_uppercase(self) -> bool
Returns `true` if this `char` has the `Uppercase` property.
`Uppercase` is described in Chapter 4 (Character Properties) of the [Unicode Standard](https://www.unicode.org/versions/latest/) and specified in the [Unicode Character Database](https://www.unicode.org/reports/tr44/) [`DerivedCoreProperties.txt`](https://www.unicode.org/Public/UCD/latest/ucd/DerivedCoreProperties.txt).
##### Examples
Basic usage:
```
assert!(!'a'.is_uppercase());
assert!(!'δ'.is_uppercase());
assert!('A'.is_uppercase());
assert!('Δ'.is_uppercase());
// The various Chinese scripts and punctuation do not have case, and so:
assert!(!'中'.is_uppercase());
assert!(!' '.is_uppercase());
```
In a const context:
```
#![feature(const_unicode_case_lookup)]
const CAPITAL_DELTA_IS_UPPERCASE: bool = 'Δ'.is_uppercase();
assert!(CAPITAL_DELTA_IS_UPPERCASE);
```
[source](https://doc.rust-lang.org/src/core/char/methods.rs.html#835)#### pub fn is\_whitespace(self) -> bool
Returns `true` if this `char` has the `White_Space` property.
`White_Space` is specified in the [Unicode Character Database](https://www.unicode.org/reports/tr44/) [`PropList.txt`](https://www.unicode.org/Public/UCD/latest/ucd/PropList.txt).
##### Examples
Basic usage:
```
assert!(' '.is_whitespace());
// line break
assert!('\n'.is_whitespace());
// a non-breaking space
assert!('\u{A0}'.is_whitespace());
assert!(!'越'.is_whitespace());
```
[source](https://doc.rust-lang.org/src/core/char/methods.rs.html#864)#### pub fn is\_alphanumeric(self) -> bool
Returns `true` if this `char` satisfies either [`is_alphabetic()`](#method.is_alphabetic) or [`is_numeric()`](#method.is_numeric).
##### Examples
Basic usage:
```
assert!('٣'.is_alphanumeric());
assert!('7'.is_alphanumeric());
assert!('৬'.is_alphanumeric());
assert!('¾'.is_alphanumeric());
assert!('①'.is_alphanumeric());
assert!('K'.is_alphanumeric());
assert!('و'.is_alphanumeric());
assert!('藏'.is_alphanumeric());
```
[source](https://doc.rust-lang.org/src/core/char/methods.rs.html#890)#### pub fn is\_control(self) -> bool
Returns `true` if this `char` has the general category for control codes.
Control codes (code points with the general category of `Cc`) are described in Chapter 4 (Character Properties) of the [Unicode Standard](https://www.unicode.org/versions/latest/) and specified in the [Unicode Character Database](https://www.unicode.org/reports/tr44/) [`UnicodeData.txt`](https://www.unicode.org/Public/UCD/latest/ucd/UnicodeData.txt).
##### Examples
Basic usage:
```
// U+009C, STRING TERMINATOR
assert!(''.is_control());
assert!(!'q'.is_control());
```
[source](https://doc.rust-lang.org/src/core/char/methods.rs.html#945)#### pub fn is\_numeric(self) -> bool
Returns `true` if this `char` has one of the general categories for numbers.
The general categories for numbers (`Nd` for decimal digits, `Nl` for letter-like numeric characters, and `No` for other numeric characters) are specified in the [Unicode Character Database](https://www.unicode.org/reports/tr44/) [`UnicodeData.txt`](https://www.unicode.org/Public/UCD/latest/ucd/UnicodeData.txt).
This method doesn’t cover everything that could be considered a number, e.g. ideographic numbers like ‘三’. If you want everything including characters with overlapping purposes then you might want to use a unicode or language-processing library that exposes the appropriate character properties instead of looking at the unicode categories.
If you want to parse ASCII decimal digits (0-9) or ASCII base-N, use `is_ascii_digit` or `is_digit` instead.
##### Examples
Basic usage:
```
assert!('٣'.is_numeric());
assert!('7'.is_numeric());
assert!('৬'.is_numeric());
assert!('¾'.is_numeric());
assert!('①'.is_numeric());
assert!(!'K'.is_numeric());
assert!(!'و'.is_numeric());
assert!(!'藏'.is_numeric());
assert!(!'三'.is_numeric());
```
[source](https://doc.rust-lang.org/src/core/char/methods.rs.html#1015)#### pub fn to\_lowercase(self) -> ToLowercase
Notable traits for [ToLowercase](char/struct.tolowercase "struct std::char::ToLowercase")
```
impl Iterator for ToLowercase
type Item = char;
```
Returns an iterator that yields the lowercase mapping of this `char` as one or more `char`s.
If this `char` does not have a lowercase mapping, the iterator yields the same `char`.
If this `char` has a one-to-one lowercase mapping given by the [Unicode Character Database](https://www.unicode.org/reports/tr44/) [`UnicodeData.txt`](https://www.unicode.org/Public/UCD/latest/ucd/UnicodeData.txt), the iterator yields that `char`.
If this `char` requires special considerations (e.g. multiple `char`s) the iterator yields the `char`(s) given by [`SpecialCasing.txt`](https://www.unicode.org/Public/UCD/latest/ucd/SpecialCasing.txt).
This operation performs an unconditional mapping without tailoring. That is, the conversion is independent of context and language.
In the [Unicode Standard](https://www.unicode.org/versions/latest/), Chapter 4 (Character Properties) discusses case mapping in general and Chapter 3 (Conformance) discusses the default algorithm for case conversion.
##### Examples
As an iterator:
```
for c in 'İ'.to_lowercase() {
print!("{c}");
}
println!();
```
Using `println!` directly:
```
println!("{}", 'İ'.to_lowercase());
```
Both are equivalent to:
```
println!("i\u{307}");
```
Using [`to_string`](string/trait.tostring#tymethod.to_string):
```
assert_eq!('C'.to_lowercase().to_string(), "c");
// Sometimes the result is more than one character:
assert_eq!('İ'.to_lowercase().to_string(), "i\u{307}");
// Characters that do not have both uppercase and lowercase
// convert into themselves.
assert_eq!('山'.to_lowercase().to_string(), "山");
```
[source](https://doc.rust-lang.org/src/core/char/methods.rs.html#1107)#### pub fn to\_uppercase(self) -> ToUppercase
Notable traits for [ToUppercase](char/struct.touppercase "struct std::char::ToUppercase")
```
impl Iterator for ToUppercase
type Item = char;
```
Returns an iterator that yields the uppercase mapping of this `char` as one or more `char`s.
If this `char` does not have an uppercase mapping, the iterator yields the same `char`.
If this `char` has a one-to-one uppercase mapping given by the [Unicode Character Database](https://www.unicode.org/reports/tr44/) [`UnicodeData.txt`](https://www.unicode.org/Public/UCD/latest/ucd/UnicodeData.txt), the iterator yields that `char`.
If this `char` requires special considerations (e.g. multiple `char`s) the iterator yields the `char`(s) given by [`SpecialCasing.txt`](https://www.unicode.org/Public/UCD/latest/ucd/SpecialCasing.txt).
This operation performs an unconditional mapping without tailoring. That is, the conversion is independent of context and language.
In the [Unicode Standard](https://www.unicode.org/versions/latest/), Chapter 4 (Character Properties) discusses case mapping in general and Chapter 3 (Conformance) discusses the default algorithm for case conversion.
##### Examples
As an iterator:
```
for c in 'ß'.to_uppercase() {
print!("{c}");
}
println!();
```
Using `println!` directly:
```
println!("{}", 'ß'.to_uppercase());
```
Both are equivalent to:
```
println!("SS");
```
Using [`to_string`](string/trait.tostring#tymethod.to_string):
```
assert_eq!('c'.to_uppercase().to_string(), "C");
// Sometimes the result is more than one character:
assert_eq!('ß'.to_uppercase().to_string(), "SS");
// Characters that do not have both uppercase and lowercase
// convert into themselves.
assert_eq!('山'.to_uppercase().to_string(), "山");
```
##### Note on locale
In Turkish, the equivalent of ‘i’ in Latin has five forms instead of two:
* ‘Dotless’: I / ı, sometimes written ï
* ‘Dotted’: İ / i
Note that the lowercase dotted ‘i’ is the same as the Latin. Therefore:
```
let upper_i = 'i'.to_uppercase().to_string();
```
The value of `upper_i` here relies on the language of the text: if we’re in `en-US`, it should be `"I"`, but if we’re in `tr_TR`, it should be `"İ"`. `to_uppercase()` does not take this into account, and so:
```
let upper_i = 'i'.to_uppercase().to_string();
assert_eq!(upper_i, "I");
```
holds across languages.
[source](https://doc.rust-lang.org/src/core/char/methods.rs.html#1126)1.23.0 (const: 1.32.0) · #### pub const fn is\_ascii(&self) -> bool
Checks if the value is within the ASCII range.
##### Examples
```
let ascii = 'a';
let non_ascii = '❤';
assert!(ascii.is_ascii());
assert!(!non_ascii.is_ascii());
```
[source](https://doc.rust-lang.org/src/core/char/methods.rs.html#1156)1.23.0 (const: 1.52.0) · #### pub const fn to\_ascii\_uppercase(&self) -> char
Makes a copy of the value in 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()`](#method.make_ascii_uppercase).
To uppercase ASCII characters in addition to non-ASCII characters, use [`to_uppercase()`](#method.to_uppercase).
##### Examples
```
let ascii = 'a';
let non_ascii = '❤';
assert_eq!('A', ascii.to_ascii_uppercase());
assert_eq!('❤', non_ascii.to_ascii_uppercase());
```
[source](https://doc.rust-lang.org/src/core/char/methods.rs.html#1190)1.23.0 (const: 1.52.0) · #### pub const fn to\_ascii\_lowercase(&self) -> char
Makes a copy of the value in 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()`](#method.make_ascii_lowercase).
To lowercase ASCII characters in addition to non-ASCII characters, use [`to_lowercase()`](#method.to_lowercase).
##### Examples
```
let ascii = 'A';
let non_ascii = '❤';
assert_eq!('a', ascii.to_ascii_lowercase());
assert_eq!('❤', non_ascii.to_ascii_lowercase());
```
[source](https://doc.rust-lang.org/src/core/char/methods.rs.html#1218)1.23.0 (const: 1.52.0) · #### pub const fn eq\_ignore\_ascii\_case(&self, other: &char) -> bool
Checks that two values are an ASCII case-insensitive match.
Equivalent to `[to\_ascii\_lowercase](#method.to_ascii_lowercase)(a) == [to\_ascii\_lowercase](#method.to_ascii_lowercase)(b)`.
##### Examples
```
let upper_a = 'A';
let lower_a = 'a';
let lower_z = 'z';
assert!(upper_a.eq_ignore_ascii_case(&lower_a));
assert!(upper_a.eq_ignore_ascii_case(&upper_a));
assert!(!upper_a.eq_ignore_ascii_case(&lower_z));
```
[source](https://doc.rust-lang.org/src/core/char/methods.rs.html#1243)1.23.0 · #### pub fn make\_ascii\_uppercase(&mut self)
Converts this type 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).
##### Examples
```
let mut ascii = 'a';
ascii.make_ascii_uppercase();
assert_eq!('A', ascii);
```
[source](https://doc.rust-lang.org/src/core/char/methods.rs.html#1268)1.23.0 · #### pub fn make\_ascii\_lowercase(&mut self)
Converts this type 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).
##### Examples
```
let mut ascii = 'A';
ascii.make_ascii_lowercase();
assert_eq!('a', ascii);
```
[source](https://doc.rust-lang.org/src/core/char/methods.rs.html#1304)1.24.0 (const: 1.47.0) · #### pub const fn is\_ascii\_alphabetic(&self) -> bool
Checks if the value is an ASCII alphabetic character:
* U+0041 ‘A’ ..= U+005A ‘Z’, or
* U+0061 ‘a’ ..= U+007A ‘z’.
##### Examples
```
let uppercase_a = 'A';
let uppercase_g = 'G';
let a = 'a';
let g = 'g';
let zero = '0';
let percent = '%';
let space = ' ';
let lf = '\n';
let esc = '\x1b';
assert!(uppercase_a.is_ascii_alphabetic());
assert!(uppercase_g.is_ascii_alphabetic());
assert!(a.is_ascii_alphabetic());
assert!(g.is_ascii_alphabetic());
assert!(!zero.is_ascii_alphabetic());
assert!(!percent.is_ascii_alphabetic());
assert!(!space.is_ascii_alphabetic());
assert!(!lf.is_ascii_alphabetic());
assert!(!esc.is_ascii_alphabetic());
```
[source](https://doc.rust-lang.org/src/core/char/methods.rs.html#1338)1.24.0 (const: 1.47.0) · #### pub const fn is\_ascii\_uppercase(&self) -> bool
Checks if the value is an ASCII uppercase character: U+0041 ‘A’ ..= U+005A ‘Z’.
##### Examples
```
let uppercase_a = 'A';
let uppercase_g = 'G';
let a = 'a';
let g = 'g';
let zero = '0';
let percent = '%';
let space = ' ';
let lf = '\n';
let esc = '\x1b';
assert!(uppercase_a.is_ascii_uppercase());
assert!(uppercase_g.is_ascii_uppercase());
assert!(!a.is_ascii_uppercase());
assert!(!g.is_ascii_uppercase());
assert!(!zero.is_ascii_uppercase());
assert!(!percent.is_ascii_uppercase());
assert!(!space.is_ascii_uppercase());
assert!(!lf.is_ascii_uppercase());
assert!(!esc.is_ascii_uppercase());
```
[source](https://doc.rust-lang.org/src/core/char/methods.rs.html#1372)1.24.0 (const: 1.47.0) · #### pub const fn is\_ascii\_lowercase(&self) -> bool
Checks if the value is an ASCII lowercase character: U+0061 ‘a’ ..= U+007A ‘z’.
##### Examples
```
let uppercase_a = 'A';
let uppercase_g = 'G';
let a = 'a';
let g = 'g';
let zero = '0';
let percent = '%';
let space = ' ';
let lf = '\n';
let esc = '\x1b';
assert!(!uppercase_a.is_ascii_lowercase());
assert!(!uppercase_g.is_ascii_lowercase());
assert!(a.is_ascii_lowercase());
assert!(g.is_ascii_lowercase());
assert!(!zero.is_ascii_lowercase());
assert!(!percent.is_ascii_lowercase());
assert!(!space.is_ascii_lowercase());
assert!(!lf.is_ascii_lowercase());
assert!(!esc.is_ascii_lowercase());
```
[source](https://doc.rust-lang.org/src/core/char/methods.rs.html#1409)1.24.0 (const: 1.47.0) · #### pub const fn is\_ascii\_alphanumeric(&self) -> bool
Checks if the value is an ASCII alphanumeric character:
* U+0041 ‘A’ ..= U+005A ‘Z’, or
* U+0061 ‘a’ ..= U+007A ‘z’, or
* U+0030 ‘0’ ..= U+0039 ‘9’.
##### Examples
```
let uppercase_a = 'A';
let uppercase_g = 'G';
let a = 'a';
let g = 'g';
let zero = '0';
let percent = '%';
let space = ' ';
let lf = '\n';
let esc = '\x1b';
assert!(uppercase_a.is_ascii_alphanumeric());
assert!(uppercase_g.is_ascii_alphanumeric());
assert!(a.is_ascii_alphanumeric());
assert!(g.is_ascii_alphanumeric());
assert!(zero.is_ascii_alphanumeric());
assert!(!percent.is_ascii_alphanumeric());
assert!(!space.is_ascii_alphanumeric());
assert!(!lf.is_ascii_alphanumeric());
assert!(!esc.is_ascii_alphanumeric());
```
[source](https://doc.rust-lang.org/src/core/char/methods.rs.html#1443)1.24.0 (const: 1.47.0) · #### pub const fn is\_ascii\_digit(&self) -> bool
Checks if the value is an ASCII decimal digit: U+0030 ‘0’ ..= U+0039 ‘9’.
##### Examples
```
let uppercase_a = 'A';
let uppercase_g = 'G';
let a = 'a';
let g = 'g';
let zero = '0';
let percent = '%';
let space = ' ';
let lf = '\n';
let esc = '\x1b';
assert!(!uppercase_a.is_ascii_digit());
assert!(!uppercase_g.is_ascii_digit());
assert!(!a.is_ascii_digit());
assert!(!g.is_ascii_digit());
assert!(zero.is_ascii_digit());
assert!(!percent.is_ascii_digit());
assert!(!space.is_ascii_digit());
assert!(!lf.is_ascii_digit());
assert!(!esc.is_ascii_digit());
```
[source](https://doc.rust-lang.org/src/core/char/methods.rs.html#1480)1.24.0 (const: 1.47.0) · #### pub const fn is\_ascii\_hexdigit(&self) -> bool
Checks if the value is an ASCII hexadecimal digit:
* U+0030 ‘0’ ..= U+0039 ‘9’, or
* U+0041 ‘A’ ..= U+0046 ‘F’, or
* U+0061 ‘a’ ..= U+0066 ‘f’.
##### Examples
```
let uppercase_a = 'A';
let uppercase_g = 'G';
let a = 'a';
let g = 'g';
let zero = '0';
let percent = '%';
let space = ' ';
let lf = '\n';
let esc = '\x1b';
assert!(uppercase_a.is_ascii_hexdigit());
assert!(!uppercase_g.is_ascii_hexdigit());
assert!(a.is_ascii_hexdigit());
assert!(!g.is_ascii_hexdigit());
assert!(zero.is_ascii_hexdigit());
assert!(!percent.is_ascii_hexdigit());
assert!(!space.is_ascii_hexdigit());
assert!(!lf.is_ascii_hexdigit());
assert!(!esc.is_ascii_hexdigit());
```
[source](https://doc.rust-lang.org/src/core/char/methods.rs.html#1518)1.24.0 (const: 1.47.0) · #### pub const fn is\_ascii\_punctuation(&self) -> bool
Checks if the value is an ASCII punctuation character:
* U+0021 ..= U+002F `! " # $ % & ' ( ) * + , - . /`, or
* U+003A ..= U+0040 `: ; < = > ? @`, or
* U+005B ..= U+0060 `[ \ ] ^ _ `` , or
* U+007B ..= U+007E `{ | } ~`
##### Examples
```
let uppercase_a = 'A';
let uppercase_g = 'G';
let a = 'a';
let g = 'g';
let zero = '0';
let percent = '%';
let space = ' ';
let lf = '\n';
let esc = '\x1b';
assert!(!uppercase_a.is_ascii_punctuation());
assert!(!uppercase_g.is_ascii_punctuation());
assert!(!a.is_ascii_punctuation());
assert!(!g.is_ascii_punctuation());
assert!(!zero.is_ascii_punctuation());
assert!(percent.is_ascii_punctuation());
assert!(!space.is_ascii_punctuation());
assert!(!lf.is_ascii_punctuation());
assert!(!esc.is_ascii_punctuation());
```
[source](https://doc.rust-lang.org/src/core/char/methods.rs.html#1552)1.24.0 (const: 1.47.0) · #### pub const fn is\_ascii\_graphic(&self) -> bool
Checks if the value is an ASCII graphic character: U+0021 ‘!’ ..= U+007E ‘~’.
##### Examples
```
let uppercase_a = 'A';
let uppercase_g = 'G';
let a = 'a';
let g = 'g';
let zero = '0';
let percent = '%';
let space = ' ';
let lf = '\n';
let esc = '\x1b';
assert!(uppercase_a.is_ascii_graphic());
assert!(uppercase_g.is_ascii_graphic());
assert!(a.is_ascii_graphic());
assert!(g.is_ascii_graphic());
assert!(zero.is_ascii_graphic());
assert!(percent.is_ascii_graphic());
assert!(!space.is_ascii_graphic());
assert!(!lf.is_ascii_graphic());
assert!(!esc.is_ascii_graphic());
```
[source](https://doc.rust-lang.org/src/core/char/methods.rs.html#1603)1.24.0 (const: 1.47.0) · #### pub const fn is\_ascii\_whitespace(&self) -> bool
Checks if the value is an ASCII whitespace character: U+0020 SPACE, U+0009 HORIZONTAL TAB, U+000A LINE FEED, U+000C FORM FEED, or U+000D CARRIAGE RETURN.
Rust uses the WhatWG Infra Standard’s [definition of ASCII whitespace](https://infra.spec.whatwg.org/#ascii-whitespace). There are several other definitions in wide use. For instance, [the POSIX locale](https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap07.html#tag_07_03_01) includes U+000B VERTICAL TAB as well as all the above characters, but—from the very same specification—[the default rule for “field splitting” in the Bourne shell](https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_06_05) considers *only* SPACE, HORIZONTAL TAB, and LINE FEED as whitespace.
If you are writing a program that will process an existing file format, check what that format’s definition of whitespace is before using this function.
##### Examples
```
let uppercase_a = 'A';
let uppercase_g = 'G';
let a = 'a';
let g = 'g';
let zero = '0';
let percent = '%';
let space = ' ';
let lf = '\n';
let esc = '\x1b';
assert!(!uppercase_a.is_ascii_whitespace());
assert!(!uppercase_g.is_ascii_whitespace());
assert!(!a.is_ascii_whitespace());
assert!(!g.is_ascii_whitespace());
assert!(!zero.is_ascii_whitespace());
assert!(!percent.is_ascii_whitespace());
assert!(space.is_ascii_whitespace());
assert!(lf.is_ascii_whitespace());
assert!(!esc.is_ascii_whitespace());
```
[source](https://doc.rust-lang.org/src/core/char/methods.rs.html#1639)1.24.0 (const: 1.47.0) · #### pub const fn is\_ascii\_control(&self) -> bool
Checks if the value is an ASCII control character: U+0000 NUL ..= U+001F UNIT SEPARATOR, or U+007F DELETE. Note that most ASCII whitespace characters are control characters, but SPACE is not.
##### Examples
```
let uppercase_a = 'A';
let uppercase_g = 'G';
let a = 'a';
let g = 'g';
let zero = '0';
let percent = '%';
let space = ' ';
let lf = '\n';
let esc = '\x1b';
assert!(!uppercase_a.is_ascii_control());
assert!(!uppercase_g.is_ascii_control());
assert!(!a.is_ascii_control());
assert!(!g.is_ascii_control());
assert!(!zero.is_ascii_control());
assert!(!percent.is_ascii_control());
assert!(!space.is_ascii_control());
assert!(lf.is_ascii_control());
assert!(esc.is_ascii_control());
```
Trait Implementations
---------------------
[source](https://doc.rust-lang.org/src/std/ascii.rs.html#188-192)### impl AsciiExt for char
#### type Owned = char
👎Deprecated since 1.26.0: use inherent methods instead
Container type for copied ASCII characters.
[source](https://doc.rust-lang.org/src/std/ascii.rs.html#191)#### fn is\_ascii(&self) -> bool
👎Deprecated since 1.26.0: use inherent methods instead
Checks if the value is within the ASCII range. [Read more](ascii/trait.asciiext#tymethod.is_ascii)
[source](https://doc.rust-lang.org/src/std/ascii.rs.html#191)#### fn to\_ascii\_uppercase(&self) -> Self::Owned
👎Deprecated since 1.26.0: use inherent methods instead
Makes a copy of the value in its ASCII upper case equivalent. [Read more](ascii/trait.asciiext#tymethod.to_ascii_uppercase)
[source](https://doc.rust-lang.org/src/std/ascii.rs.html#191)#### fn to\_ascii\_lowercase(&self) -> Self::Owned
👎Deprecated since 1.26.0: use inherent methods instead
Makes a copy of the value in its ASCII lower case equivalent. [Read more](ascii/trait.asciiext#tymethod.to_ascii_lowercase)
[source](https://doc.rust-lang.org/src/std/ascii.rs.html#191)#### fn eq\_ignore\_ascii\_case(&self, o: &Self) -> bool
👎Deprecated since 1.26.0: use inherent methods instead
Checks that two values are an ASCII case-insensitive match. [Read more](ascii/trait.asciiext#tymethod.eq_ignore_ascii_case)
[source](https://doc.rust-lang.org/src/std/ascii.rs.html#191)#### fn make\_ascii\_uppercase(&mut self)
👎Deprecated since 1.26.0: use inherent methods instead
Converts this type to its ASCII upper case equivalent in-place. [Read more](ascii/trait.asciiext#tymethod.make_ascii_uppercase)
[source](https://doc.rust-lang.org/src/std/ascii.rs.html#191)#### fn make\_ascii\_lowercase(&mut self)
👎Deprecated since 1.26.0: use inherent methods instead
Converts this type to its ASCII lower case equivalent in-place. [Read more](ascii/trait.asciiext#tymethod.make_ascii_lowercase)
[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") · #### fn clone(&self) -> char
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#2440)### impl Debug for char
[source](https://doc.rust-lang.org/src/core/fmt/mod.rs.html#2441)#### 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/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#205)const: [unstable](https://github.com/rust-lang/rust/issues/87864 "Tracking issue for const_default_impls") · #### fn default() -> char
Returns the default value of `\x00`
[source](https://doc.rust-lang.org/src/core/fmt/mod.rs.html#2455)### impl Display for char
[source](https://doc.rust-lang.org/src/core/fmt/mod.rs.html#2456)#### 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/string.rs.html#2076)1.2.0 · ### impl<'a> Extend<&'a char> for String
[source](https://doc.rust-lang.org/src/alloc/string.rs.html#2077)#### fn extend<I>(&mut self, iter: I)where I: [IntoIterator](iter/trait.intoiterator "trait std::iter::IntoIterator")<Item = &'a [char](primitive.char)>,
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#2082)#### fn extend\_one(&mut self, &'a char)
🔬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/string.rs.html#2087)#### 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#2055)### impl Extend<char> for String
[source](https://doc.rust-lang.org/src/alloc/string.rs.html#2056)#### fn extend<I>(&mut self, iter: I)where I: [IntoIterator](iter/trait.intoiterator "trait std::iter::IntoIterator")<Item = [char](primitive.char)>,
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#2064)#### fn extend\_one(&mut self, c: char)
🔬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/string.rs.html#2069)#### 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#2959)1.46.0 · ### impl From<char> for String
[source](https://doc.rust-lang.org/src/alloc/string.rs.html#2969)#### fn from(c: char) -> String
Allocates an owned [`String`](string/struct.string "String") from a single character.
##### Example
```
let c: char = 'a';
let s: String = String::from(c);
assert_eq!("a", &s[..]);
```
[source](https://doc.rust-lang.org/src/core/char/convert.rs.html#73)1.51.0 (const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert")) · ### impl From<char> for u128
[source](https://doc.rust-lang.org/src/core/char/convert.rs.html#86)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn from(c: char) -> u128
Converts a [`char`](primitive.char "char") into a [`u128`](primitive.u128 "u128").
##### Examples
```
use std::mem;
let c = '⚙';
let u = u128::from(c);
assert!(16 == mem::size_of_val(&u))
```
[source](https://doc.rust-lang.org/src/core/char/convert.rs.html#31)1.13.0 (const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert")) · ### impl From<char> for u32
[source](https://doc.rust-lang.org/src/core/char/convert.rs.html#44)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn from(c: char) -> u32
Converts a [`char`](primitive.char "char") into a [`u32`](primitive.u32 "u32").
##### Examples
```
use std::mem;
let c = 'c';
let u = u32::from(c);
assert!(4 == mem::size_of_val(&u))
```
[source](https://doc.rust-lang.org/src/core/char/convert.rs.html#51)1.51.0 (const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert")) · ### impl From<char> for u64
[source](https://doc.rust-lang.org/src/core/char/convert.rs.html#64)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn from(c: char) -> u64
Converts a [`char`](primitive.char "char") into a [`u64`](primitive.u64 "u64").
##### Examples
```
use std::mem;
let c = '👤';
let u = u64::from(c);
assert!(8 == mem::size_of_val(&u))
```
[source](https://doc.rust-lang.org/src/core/char/convert.rs.html#127)1.13.0 (const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert")) · ### impl From<u8> for char
Maps a byte in 0x00..=0xFF to a `char` whose code point has the same value, in U+0000..=U+00FF.
Unicode is designed such that this effectively decodes bytes with the character encoding that IANA calls ISO-8859-1. This encoding is compatible with ASCII.
Note that this is different from ISO/IEC 8859-1 a.k.a. ISO 8859-1 (with one less hyphen), which leaves some “blanks”, byte values that are not assigned to any character. ISO-8859-1 (the IANA one) assigns them to the C0 and C1 control codes.
Note that this is *also* different from Windows-1252 a.k.a. code page 1252, which is a superset ISO/IEC 8859-1 that assigns some (not all!) blanks to punctuation and various Latin characters.
To confuse things further, [on the Web](https://encoding.spec.whatwg.org/) `ascii`, `iso-8859-1`, and `windows-1252` are all aliases for a superset of Windows-1252 that fills the remaining blanks with corresponding C0 and C1 control codes.
[source](https://doc.rust-lang.org/src/core/char/convert.rs.html#140)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn from(i: u8) -> char
Converts a [`u8`](primitive.u8 "u8") into a [`char`](primitive.char "char").
##### Examples
```
use std::mem;
let u = 32 as u8;
let c = char::from(u);
assert!(4 == mem::size_of_val(&c))
```
[source](https://doc.rust-lang.org/src/alloc/string.rs.html#1986)1.17.0 · ### impl<'a> FromIterator<&'a char> for String
[source](https://doc.rust-lang.org/src/alloc/string.rs.html#1987)#### fn from\_iter<I>(iter: I) -> Stringwhere I: [IntoIterator](iter/trait.intoiterator "trait std::iter::IntoIterator")<Item = &'a [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/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/string.rs.html#1976)### impl FromIterator<char> for String
[source](https://doc.rust-lang.org/src/alloc/string.rs.html#1977)#### fn from\_iter<I>(iter: I) -> Stringwhere 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/core/char/convert.rs.html#183)1.20.0 · ### impl FromStr for char
#### type Err = ParseCharError
The associated error which can be returned from parsing.
[source](https://doc.rust-lang.org/src/core/char/convert.rs.html#187)#### fn from\_str(s: &str) -> Result<char, <char 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/hash/mod.rs.html#853)### impl Hash for char
[source](https://doc.rust-lang.org/src/core/hash/mod.rs.html#855)#### 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/cmp.rs.html#1486)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · ### impl Ord for char
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1486)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · #### fn cmp(&self, other: &char) -> 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/cmp.rs.html#1366-1368)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · ### impl PartialEq<char> for char
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1366-1368)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · #### fn eq(&self, other: &char) -> 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#1366-1368)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · #### fn ne(&self, other: &char) -> 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/cmp.rs.html#1486)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · ### impl PartialOrd<char> for char
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1486)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · #### fn partial\_cmp(&self, other: &char) -> 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#1486)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · #### fn lt(&self, other: &char) -> 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#1486)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · #### fn le(&self, other: &char) -> 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#1486)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · #### fn ge(&self, other: &char) -> 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/cmp.rs.html#1486)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · #### fn gt(&self, other: &char) -> 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/str/pattern.rs.html#538)### impl<'a> Pattern<'a> for char
Searches for chars that are equal to a given [`char`](primitive.char "char").
#### Examples
```
assert_eq!("Hello world".find('o'), Some(4));
```
#### type Searcher = CharSearcher<'a>
🔬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#542)#### fn into\_searcher(self, haystack: &'a str) -> <char as Pattern<'a>>::Searcher
🔬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#556)#### 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#566)#### 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#571)#### 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#576-578)#### fn is\_suffix\_of(self, haystack: &'a str) -> boolwhere <[char](primitive.char) 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"): [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#584-586)#### fn strip\_suffix\_of(self, haystack: &'a str) -> Option<&'a str>where <[char](primitive.char) 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"): [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/iter/range.rs.html#409)### impl Step for char
[source](https://doc.rust-lang.org/src/core/iter/range.rs.html#411)#### fn steps\_between(&char, &char) -> Option<usize>
🔬This is a nightly-only experimental API. (`step_trait` [#42168](https://github.com/rust-lang/rust/issues/42168))
Returns the number of *successor* steps required to get from `start` to `end`. [Read more](iter/trait.step#tymethod.steps_between)
[source](https://doc.rust-lang.org/src/core/iter/range.rs.html#427)#### fn forward\_checked(start: char, count: usize) -> Option<char>
🔬This is a nightly-only experimental API. (`step_trait` [#42168](https://github.com/rust-lang/rust/issues/42168))
Returns the value that would be obtained by taking the *successor* of `self` `count` times. [Read more](iter/trait.step#tymethod.forward_checked)
[source](https://doc.rust-lang.org/src/core/iter/range.rs.html#443)#### fn backward\_checked(start: char, count: usize) -> Option<char>
🔬This is a nightly-only experimental API. (`step_trait` [#42168](https://github.com/rust-lang/rust/issues/42168))
Returns the value that would be obtained by taking the *predecessor* of `self` `count` times. [Read more](iter/trait.step#tymethod.backward_checked)
[source](https://doc.rust-lang.org/src/core/iter/range.rs.html#455)#### unsafe fn forward\_unchecked(start: char, count: usize) -> char
🔬This is a nightly-only experimental API. (`step_trait` [#42168](https://github.com/rust-lang/rust/issues/42168))
Returns the value that would be obtained by taking the *successor* of `self` `count` times. [Read more](iter/trait.step#method.forward_unchecked)
[source](https://doc.rust-lang.org/src/core/iter/range.rs.html#471)#### unsafe fn backward\_unchecked(start: char, count: usize) -> char
🔬This is a nightly-only experimental API. (`step_trait` [#42168](https://github.com/rust-lang/rust/issues/42168))
Returns the value that would be obtained by taking the *predecessor* of `self` `count` times. [Read more](iter/trait.step#method.backward_unchecked)
[source](https://doc.rust-lang.org/src/core/iter/range.rs.html#87)#### fn forward(start: Self, count: usize) -> Self
🔬This is a nightly-only experimental API. (`step_trait` [#42168](https://github.com/rust-lang/rust/issues/42168))
Returns the value that would be obtained by taking the *successor* of `self` `count` times. [Read more](iter/trait.step#method.forward)
[source](https://doc.rust-lang.org/src/core/iter/range.rs.html#156)#### fn backward(start: Self, count: usize) -> Self
🔬This is a nightly-only experimental API. (`step_trait` [#42168](https://github.com/rust-lang/rust/issues/42168))
Returns the value that would be obtained by taking the *predecessor* of `self` `count` times. [Read more](iter/trait.step#method.backward)
[source](https://doc.rust-lang.org/src/alloc/string.rs.html#2518)1.46.0 · ### impl ToString for char
[source](https://doc.rust-lang.org/src/alloc/string.rs.html#2520)#### 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/char/convert.rs.html#98)1.59.0 · ### impl TryFrom<char> for u8
Map `char` with code point in U+0000..=U+00FF to byte in 0x00..=0xFF with same value, failing if the code point is greater than U+00FF.
See [`impl From<u8> for char`](primitive.char#impl-From%3Cu8%3E-for-char) for details on the encoding.
#### type Error = TryFromCharError
The type returned in the event of a conversion error.
[source](https://doc.rust-lang.org/src/core/char/convert.rs.html#102)#### fn try\_from(c: char) -> Result<u8, <u8 as TryFrom<char>>::Error>
Performs the conversion.
[source](https://doc.rust-lang.org/src/core/char/convert.rs.html#221)1.34.0 · ### impl TryFrom<u32> for char
#### type Error = CharTryFromError
The type returned in the event of a conversion error.
[source](https://doc.rust-lang.org/src/core/char/convert.rs.html#225)#### fn try\_from(i: u32) -> Result<char, <char as TryFrom<u32>>::Error>
Performs the conversion.
[source](https://doc.rust-lang.org/src/core/marker.rs.html#830-835)### impl Copy for char
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1377)### impl Eq for char
[source](https://doc.rust-lang.org/src/core/iter/range.rs.html#17)### impl TrustedStep for char
Auto Trait Implementations
--------------------------
### impl RefUnwindSafe for char
### impl Send for char
### impl Sync for char
### impl Unpin for char
### impl UnwindSafe for char
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 Primitive Type array Primitive Type array
====================
A fixed-size array, denoted `[T; N]`, for the element type, `T`, and the non-negative compile-time constant size, `N`.
There are two syntactic forms for creating an array:
* A list with each element, i.e., `[x, y, z]`.
* A repeat expression `[x; N]`, which produces an array with `N` copies of `x`. The type of `x` must be [`Copy`](marker/trait.copy "Copy").
Note that `[expr; 0]` is allowed, and produces an empty array. This will still evaluate `expr`, however, and immediately drop the resulting value, so be mindful of side effects.
Arrays of *any* size implement the following traits if the element type allows it:
* [`Copy`](marker/trait.copy "Copy")
* [`Clone`](clone/trait.clone "Clone")
* [`Debug`](fmt/trait.debug)
* [`IntoIterator`](iter/trait.intoiterator "IntoIterator") (implemented for `[T; N]`, `&[T; N]` and `&mut [T; N]`)
* [`PartialEq`](cmp/trait.partialeq "PartialEq"), [`PartialOrd`](cmp/trait.partialord "PartialOrd"), [`Eq`](cmp/trait.eq "Eq"), [`Ord`](cmp/trait.ord "Ord")
* [`Hash`](hash/trait.hash)
* [`AsRef`](convert/trait.asref "AsRef"), [`AsMut`](convert/trait.asmut "AsMut")
* [`Borrow`](borrow/trait.borrow), [`BorrowMut`](borrow/trait.borrowmut)
Arrays of sizes from 0 to 32 (inclusive) implement the [`Default`](default/trait.default "Default") trait if the element type allows it. As a stopgap, trait implementations are statically generated up to size 32.
Arrays coerce to [slices (`[T]`)](primitive.slice), so a slice method may be called on an array. Indeed, this provides most of the API for working with arrays. Slices have a dynamic size and do not coerce to arrays.
You can move elements out of an array with a [slice pattern](../reference/patterns#slice-patterns). If you want one element, see [`mem::replace`](mem/fn.replace "mem::replace").
Examples
--------
```
let mut array: [i32; 3] = [0; 3];
array[1] = 1;
array[2] = 2;
assert_eq!([1, 2], &array[1..]);
// This loop prints: 0 1 2
for x in array {
print!("{x} ");
}
```
You can also iterate over reference to the array’s elements:
```
let array: [i32; 3] = [0; 3];
for x in &array { }
```
You can use a [slice pattern](../reference/patterns#slice-patterns) to move elements out of an array:
```
fn move_away(_: String) { /* Do interesting things. */ }
let [john, roa] = ["John".to_string(), "Roa".to_string()];
move_away(john);
move_away(roa);
```
Editions
--------
Prior to Rust 1.53, arrays did not implement [`IntoIterator`](iter/trait.intoiterator "IntoIterator") by value, so the method call `array.into_iter()` auto-referenced into a [slice iterator](primitive.slice#method.iter). Right now, the old behavior is preserved in the 2015 and 2018 editions of Rust for compatibility, ignoring [`IntoIterator`](iter/trait.intoiterator "IntoIterator") by value. In the future, the behavior on the 2015 and 2018 edition might be made consistent to the behavior of later editions.
ⓘ
```
// Rust 2015 and 2018:
let array: [i32; 3] = [0; 3];
// This creates a slice iterator, producing references to each value.
for item in array.into_iter().enumerate() {
let (i, x): (usize, &i32) = item;
println!("array[{i}] = {x}");
}
// The `array_into_iter` lint suggests this change for future compatibility:
for item in array.iter().enumerate() {
let (i, x): (usize, &i32) = item;
println!("array[{i}] = {x}");
}
// You can explicitly iterate an array by value using `IntoIterator::into_iter`
for item in IntoIterator::into_iter(array).enumerate() {
let (i, x): (usize, i32) = item;
println!("array[{i}] = {x}");
}
```
Starting in the 2021 edition, `array.into_iter()` uses `IntoIterator` normally to iterate by value, and `iter()` should be used to iterate by reference like previous editions.
ⓘ
```
// Rust 2021:
let array: [i32; 3] = [0; 3];
// This iterates by reference:
for item in array.iter().enumerate() {
let (i, x): (usize, &i32) = item;
println!("array[{i}] = {x}");
}
// This iterates by value:
for item in array.into_iter().enumerate() {
let (i, x): (usize, i32) = item;
println!("array[{i}] = {x}");
}
```
Future language versions might start treating the `array.into_iter()` syntax on editions 2015 and 2018 the same as on edition 2021. So code using those older editions should still be written with this change in mind, to prevent breakage in the future. The safest way to accomplish this is to avoid the `into_iter` syntax on those editions. If an edition update is not viable/desired, there are multiple alternatives:
* use `iter`, equivalent to the old behavior, creating references
* use [`IntoIterator::into_iter`](iter/trait.intoiterator#tymethod.into_iter "IntoIterator::into_iter"), equivalent to the post-2021 behavior (Rust 1.53+)
* replace `for ... in array.into_iter() {` with `for ... in array {`, equivalent to the post-2021 behavior (Rust 1.53+)
ⓘ
```
// Rust 2015 and 2018:
let array: [i32; 3] = [0; 3];
// This iterates by reference:
for item in array.iter() {
let x: &i32 = item;
println!("{x}");
}
// This iterates by value:
for item in IntoIterator::into_iter(array) {
let x: i32 = item;
println!("{x}");
}
// This iterates by value:
for item in array {
let x: i32 = item;
println!("{x}");
}
// IntoIter can also start a chain.
// This iterates by value:
for item in IntoIterator::into_iter(array).enumerate() {
let (i, x): (usize, i32) = item;
println!("array[{i}] = {x}");
}
```
Implementations
---------------
[source](https://doc.rust-lang.org/src/core/array/mod.rs.html#407)### impl<T, const N: usize> [T; N]
[source](https://doc.rust-lang.org/src/core/array/mod.rs.html#450-452)1.55.0 · #### pub fn map<F, U>(self, f: F) -> [U; N]where F: [FnMut](ops/trait.fnmut "trait std::ops::FnMut")(T) -> U,
Returns an array of the same size as `self`, with function `f` applied to each element in order.
If you don’t necessarily need a new fixed-size array, consider using [`Iterator::map`](iter/trait.iterator#method.map "Iterator::map") instead.
##### Note on performance and stack usage
Unfortunately, usages of this method are currently not always optimized as well as they could be. This mainly concerns large arrays, as mapping over small arrays seem to be optimized just fine. Also note that in debug mode (i.e. without any optimizations), this method can use a lot of stack space (a few times the size of the array or more).
Therefore, in performance-critical code, try to avoid using this method on large arrays or check the emitted code. Also try to avoid chained maps (e.g. `arr.map(...).map(...)`).
In many cases, you can instead use [`Iterator::map`](iter/trait.iterator#method.map "Iterator::map") by calling `.iter()` or `.into_iter()` on your array. `[T; N]::map` is only necessary if you really need a new array of the same size as the result. Rust’s lazy iterators tend to get optimized very well.
##### Examples
```
let x = [1, 2, 3];
let y = x.map(|v| v + 1);
assert_eq!(y, [2, 3, 4]);
let x = [1, 2, 3];
let mut temp = 0;
let y = x.map(|v| { temp += 1; v * temp });
assert_eq!(y, [1, 4, 9]);
let x = ["Ferris", "Bueller's", "Day", "Off"];
let y = x.map(|v| v.len());
assert_eq!(y, [6, 9, 3, 3]);
```
[source](https://doc.rust-lang.org/src/core/array/mod.rs.html#487-491)#### pub fn try\_map<F, R>( self, f: F) -> <<R as Try>::Residual as Residual<[<R as Try>::Output; N]>>::TryTypewhere F: [FnMut](ops/trait.fnmut "trait std::ops::FnMut")(T) -> R, R: [Try](ops/trait.try "trait std::ops::Try"), <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")<[[](primitive.array)<R as [Try](ops/trait.try "trait std::ops::Try")>::[Output](ops/trait.try#associatedtype.Output "type std::ops::Try::Output")[; N]](primitive.array)>,
🔬This is a nightly-only experimental API. (`array_try_map` [#79711](https://github.com/rust-lang/rust/issues/79711))
A fallible function `f` applied to each element on array `self` in order to return an array the same size as `self` or the first error encountered.
The return type of this function depends on the return type of the closure. If you return `Result<T, E>` from the closure, you’ll get a `Result<[T; N]; E>`. If you return `Option<T>` from the closure, you’ll get an `Option<[T; N]>`.
##### Examples
```
#![feature(array_try_map)]
let a = ["1", "2", "3"];
let b = a.try_map(|v| v.parse::<u32>()).unwrap().map(|v| v + 1);
assert_eq!(b, [2, 3, 4]);
let a = ["1", "2a", "3"];
let b = a.try_map(|v| v.parse::<u32>());
assert!(b.is_err());
use std::num::NonZeroU32;
let z = [1, 2, 0, 3, 4];
assert_eq!(z.try_map(NonZeroU32::new), None);
let a = [1, 2, 3];
let b = a.try_map(NonZeroU32::new);
let c = b.map(|x| x.map(NonZeroU32::get));
assert_eq!(c, Some(a));
```
[source](https://doc.rust-lang.org/src/core/array/mod.rs.html#515)#### pub fn zip<U>(self, rhs: [U; N]) -> [(T, U); N]
🔬This is a nightly-only experimental API. (`array_zip` [#80094](https://github.com/rust-lang/rust/issues/80094))
‘Zips up’ two arrays into a single array of pairs.
`zip()` returns a new array where every element is a tuple where the first element comes from the first array, and the second element comes from the second array. In other words, it zips two arrays together, into a single one.
##### Examples
```
#![feature(array_zip)]
let x = [1, 2, 3];
let y = [4, 5, 6];
let z = x.zip(y);
assert_eq!(z, [(1, 4), (2, 5), (3, 6)]);
```
[source](https://doc.rust-lang.org/src/core/array/mod.rs.html#526)1.57.0 (const: 1.57.0) · #### pub const fn as\_slice(&self) -> &[T]
Notable traits for &[[u8](primitive.u8)]
```
impl Read for &[u8]
impl Write for &mut [u8]
```
Returns a slice containing the entire array. Equivalent to `&s[..]`.
[source](https://doc.rust-lang.org/src/core/array/mod.rs.html#533)1.57.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 a mutable slice containing the entire array. Equivalent to `&mut s[..]`.
[source](https://doc.rust-lang.org/src/core/array/mod.rs.html#566)#### pub fn each\_ref(&self) -> [&T; N]
🔬This is a nightly-only experimental API. (`array_methods` [#76118](https://github.com/rust-lang/rust/issues/76118))
Borrows each element and returns an array of references with the same size as `self`.
##### Example
```
#![feature(array_methods)]
let floats = [3.1, 2.7, -1.0];
let float_refs: [&f64; 3] = floats.each_ref();
assert_eq!(float_refs, [&3.1, &2.7, &-1.0]);
```
This method is particularly useful if combined with other methods, like [`map`](#method.map). This way, you can avoid moving the original array if its elements are not [`Copy`](marker/trait.copy "Copy").
```
#![feature(array_methods)]
let strings = ["Ferris".to_string(), "♥".to_string(), "Rust".to_string()];
let is_ascii = strings.each_ref().map(|s| s.is_ascii());
assert_eq!(is_ascii, [true, false, true]);
// We can still access the original array: it has not been moved.
assert_eq!(strings.len(), 3);
```
[source](https://doc.rust-lang.org/src/core/array/mod.rs.html#588)#### pub fn each\_mut(&mut self) -> [&mut T; N]
🔬This is a nightly-only experimental API. (`array_methods` [#76118](https://github.com/rust-lang/rust/issues/76118))
Borrows each element mutably and returns an array of mutable references with the same size as `self`.
##### Example
```
#![feature(array_methods)]
let mut floats = [3.1, 2.7, -1.0];
let float_refs: [&mut f64; 3] = floats.each_mut();
*float_refs[0] = 0.0;
assert_eq!(float_refs, [&mut 0.0, &mut 2.7, &mut -1.0]);
assert_eq!(floats, [0.0, 2.7, -1.0]);
```
[source](https://doc.rust-lang.org/src/core/array/mod.rs.html#635)#### pub fn split\_array\_ref<const M: usize>(&self) -> (&[T; M], &[T])
🔬This is a nightly-only experimental API. (`split_array` [#90091](https://github.com/rust-lang/rust/issues/90091))
Divides one array reference into two at an index.
The first will contain all indices from `[0, M)` (excluding the index `M` itself) and the second will contain all indices from `[M, N)` (excluding the index `N` itself).
##### Panics
Panics if `M > N`.
##### 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/array/mod.rs.html#668)#### pub fn split\_array\_mut<const M: usize>(&mut self) -> (&mut [T; M], &mut [T])
🔬This is a nightly-only experimental API. (`split_array` [#90091](https://github.com/rust-lang/rust/issues/90091))
Divides one mutable array reference into two at an index.
The first will contain all indices from `[0, M)` (excluding the index `M` itself) and the second will contain all indices from `[M, N)` (excluding the index `N` itself).
##### Panics
Panics if `M > N`.
##### Examples
```
#![feature(split_array)]
let mut v = [1, 0, 3, 0, 5, 6];
let (left, right) = v.split_array_mut::<2>();
assert_eq!(left, &mut [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/array/mod.rs.html#713)#### pub fn rsplit\_array\_ref<const M: usize>(&self) -> (&[T], &[T; M])
🔬This is a nightly-only experimental API. (`split_array` [#90091](https://github.com/rust-lang/rust/issues/90091))
Divides one array reference into two at an index from the end.
The first will contain all indices from `[0, N - M)` (excluding the index `N - M` itself) and the second will contain all indices from `[N - M, N)` (excluding the index `N` itself).
##### Panics
Panics if `M > N`.
##### 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/array/mod.rs.html#746)#### pub fn rsplit\_array\_mut<const M: usize>(&mut self) -> (&mut [T], &mut [T; M])
🔬This is a nightly-only experimental API. (`split_array` [#90091](https://github.com/rust-lang/rust/issues/90091))
Divides one mutable array reference into two at an index from the end.
The first will contain all indices from `[0, N - M)` (excluding the index `N - M` itself) and the second will contain all indices from `[N - M, N)` (excluding the index `N` itself).
##### Panics
Panics if `M > N`.
##### Examples
```
#![feature(split_array)]
let mut v = [1, 0, 3, 0, 5, 6];
let (left, right) = v.rsplit_array_mut::<4>();
assert_eq!(left, &mut [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]);
```
Trait Implementations
---------------------
[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](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/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/array/mod.rs.html#164)### impl<T, const N: usize> AsMut<[T]> for [T; N]
[source](https://doc.rust-lang.org/src/core/array/mod.rs.html#166)#### 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](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/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/array/mod.rs.html#156)### impl<T, const N: usize> AsRef<[T]> for [T; N]
[source](https://doc.rust-lang.org/src/core/array/mod.rs.html#158)#### 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/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]
[source](https://doc.rust-lang.org/src/core/array/mod.rs.html#174)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### 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/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]
[source](https://doc.rust-lang.org/src/core/array/mod.rs.html#182)const: [unstable](https://github.com/rust-lang/rust/issues/91522 "Tracking issue for const_borrow") · #### 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/core/array/mod.rs.html#350)1.58.0 · ### impl<T, const N: usize> Clone for [T; N]where T: [Clone](clone/trait.clone "trait std::clone::Clone"),
[source](https://doc.rust-lang.org/src/core/array/mod.rs.html#352)#### fn clone(&self) -> [T; N]
Returns a copy of the value. [Read more](clone/trait.clone#tymethod.clone)
[source](https://doc.rust-lang.org/src/core/array/mod.rs.html#357)#### fn clone\_from(&mut self, other: &[T; N])
Performs copy-assignment from `source`. [Read more](clone/trait.clone#method.clone_from)
[source](https://doc.rust-lang.org/src/core/array/mod.rs.html#261)### impl<T, const N: usize> Debug for [T; N]where T: [Debug](fmt/trait.debug "trait std::fmt::Debug"),
[source](https://doc.rust-lang.org/src/core/array/mod.rs.html#262)#### 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/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)const: [unstable](https://github.com/rust-lang/rust/issues/87864 "Tracking issue for const_default_impls") · #### fn default() -> [T; 0]
Returns the “default value” for a type. [Read more](default/trait.default#tymethod.default)
[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](default/trait.default "trait std::default::Default"),
[source](https://doc.rust-lang.org/src/core/array/mod.rs.html#405)#### fn default() -> [T; 1]
Returns the “default value” for a type. [Read more](default/trait.default#tymethod.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](default/trait.default "trait std::default::Default"),
[source](https://doc.rust-lang.org/src/core/array/mod.rs.html#405)#### fn default() -> [T; 10]
Returns the “default value” for a type. [Read more](default/trait.default#tymethod.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](default/trait.default "trait std::default::Default"),
[source](https://doc.rust-lang.org/src/core/array/mod.rs.html#405)#### fn default() -> [T; 11]
Returns the “default value” for a type. [Read more](default/trait.default#tymethod.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](default/trait.default "trait std::default::Default"),
[source](https://doc.rust-lang.org/src/core/array/mod.rs.html#405)#### fn default() -> [T; 12]
Returns the “default value” for a type. [Read more](default/trait.default#tymethod.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](default/trait.default "trait std::default::Default"),
[source](https://doc.rust-lang.org/src/core/array/mod.rs.html#405)#### fn default() -> [T; 13]
Returns the “default value” for a type. [Read more](default/trait.default#tymethod.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](default/trait.default "trait std::default::Default"),
[source](https://doc.rust-lang.org/src/core/array/mod.rs.html#405)#### fn default() -> [T; 14]
Returns the “default value” for a type. [Read more](default/trait.default#tymethod.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](default/trait.default "trait std::default::Default"),
[source](https://doc.rust-lang.org/src/core/array/mod.rs.html#405)#### fn default() -> [T; 15]
Returns the “default value” for a type. [Read more](default/trait.default#tymethod.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](default/trait.default "trait std::default::Default"),
[source](https://doc.rust-lang.org/src/core/array/mod.rs.html#405)#### fn default() -> [T; 16]
Returns the “default value” for a type. [Read more](default/trait.default#tymethod.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](default/trait.default "trait std::default::Default"),
[source](https://doc.rust-lang.org/src/core/array/mod.rs.html#405)#### fn default() -> [T; 17]
Returns the “default value” for a type. [Read more](default/trait.default#tymethod.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](default/trait.default "trait std::default::Default"),
[source](https://doc.rust-lang.org/src/core/array/mod.rs.html#405)#### fn default() -> [T; 18]
Returns the “default value” for a type. [Read more](default/trait.default#tymethod.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](default/trait.default "trait std::default::Default"),
[source](https://doc.rust-lang.org/src/core/array/mod.rs.html#405)#### fn default() -> [T; 19]
Returns the “default value” for a type. [Read more](default/trait.default#tymethod.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](default/trait.default "trait std::default::Default"),
[source](https://doc.rust-lang.org/src/core/array/mod.rs.html#405)#### fn default() -> [T; 2]
Returns the “default value” for a type. [Read more](default/trait.default#tymethod.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](default/trait.default "trait std::default::Default"),
[source](https://doc.rust-lang.org/src/core/array/mod.rs.html#405)#### fn default() -> [T; 20]
Returns the “default value” for a type. [Read more](default/trait.default#tymethod.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](default/trait.default "trait std::default::Default"),
[source](https://doc.rust-lang.org/src/core/array/mod.rs.html#405)#### fn default() -> [T; 21]
Returns the “default value” for a type. [Read more](default/trait.default#tymethod.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](default/trait.default "trait std::default::Default"),
[source](https://doc.rust-lang.org/src/core/array/mod.rs.html#405)#### fn default() -> [T; 22]
Returns the “default value” for a type. [Read more](default/trait.default#tymethod.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](default/trait.default "trait std::default::Default"),
[source](https://doc.rust-lang.org/src/core/array/mod.rs.html#405)#### fn default() -> [T; 23]
Returns the “default value” for a type. [Read more](default/trait.default#tymethod.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](default/trait.default "trait std::default::Default"),
[source](https://doc.rust-lang.org/src/core/array/mod.rs.html#405)#### fn default() -> [T; 24]
Returns the “default value” for a type. [Read more](default/trait.default#tymethod.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](default/trait.default "trait std::default::Default"),
[source](https://doc.rust-lang.org/src/core/array/mod.rs.html#405)#### fn default() -> [T; 25]
Returns the “default value” for a type. [Read more](default/trait.default#tymethod.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](default/trait.default "trait std::default::Default"),
[source](https://doc.rust-lang.org/src/core/array/mod.rs.html#405)#### fn default() -> [T; 26]
Returns the “default value” for a type. [Read more](default/trait.default#tymethod.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](default/trait.default "trait std::default::Default"),
[source](https://doc.rust-lang.org/src/core/array/mod.rs.html#405)#### fn default() -> [T; 27]
Returns the “default value” for a type. [Read more](default/trait.default#tymethod.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](default/trait.default "trait std::default::Default"),
[source](https://doc.rust-lang.org/src/core/array/mod.rs.html#405)#### fn default() -> [T; 28]
Returns the “default value” for a type. [Read more](default/trait.default#tymethod.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](default/trait.default "trait std::default::Default"),
[source](https://doc.rust-lang.org/src/core/array/mod.rs.html#405)#### fn default() -> [T; 29]
Returns the “default value” for a type. [Read more](default/trait.default#tymethod.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](default/trait.default "trait std::default::Default"),
[source](https://doc.rust-lang.org/src/core/array/mod.rs.html#405)#### fn default() -> [T; 3]
Returns the “default value” for a type. [Read more](default/trait.default#tymethod.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](default/trait.default "trait std::default::Default"),
[source](https://doc.rust-lang.org/src/core/array/mod.rs.html#405)#### fn default() -> [T; 30]
Returns the “default value” for a type. [Read more](default/trait.default#tymethod.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](default/trait.default "trait std::default::Default"),
[source](https://doc.rust-lang.org/src/core/array/mod.rs.html#405)#### fn default() -> [T; 31]
Returns the “default value” for a type. [Read more](default/trait.default#tymethod.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](default/trait.default "trait std::default::Default"),
[source](https://doc.rust-lang.org/src/core/array/mod.rs.html#405)#### fn default() -> [T; 32]
Returns the “default value” for a type. [Read more](default/trait.default#tymethod.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](default/trait.default "trait std::default::Default"),
[source](https://doc.rust-lang.org/src/core/array/mod.rs.html#405)#### fn default() -> [T; 4]
Returns the “default value” for a type. [Read more](default/trait.default#tymethod.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](default/trait.default "trait std::default::Default"),
[source](https://doc.rust-lang.org/src/core/array/mod.rs.html#405)#### fn default() -> [T; 5]
Returns the “default value” for a type. [Read more](default/trait.default#tymethod.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](default/trait.default "trait std::default::Default"),
[source](https://doc.rust-lang.org/src/core/array/mod.rs.html#405)#### fn default() -> [T; 6]
Returns the “default value” for a type. [Read more](default/trait.default#tymethod.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](default/trait.default "trait std::default::Default"),
[source](https://doc.rust-lang.org/src/core/array/mod.rs.html#405)#### fn default() -> [T; 7]
Returns the “default value” for a type. [Read more](default/trait.default#tymethod.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](default/trait.default "trait std::default::Default"),
[source](https://doc.rust-lang.org/src/core/array/mod.rs.html#405)#### fn default() -> [T; 8]
Returns the “default value” for a type. [Read more](default/trait.default#tymethod.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](default/trait.default "trait std::default::Default"),
[source](https://doc.rust-lang.org/src/core/array/mod.rs.html#405)#### fn default() -> [T; 9]
Returns the “default value” for a type. [Read more](default/trait.default#tymethod.default)
[source](https://doc.rust-lang.org/src/alloc/collections/btree/map.rs.html#2224)1.56.0 · ### impl<K, V, const N: usize> From<[(K, V); N]> for BTreeMap<K, V, Global>where K: [Ord](cmp/trait.ord "trait std::cmp::Ord"),
[source](https://doc.rust-lang.org/src/alloc/collections/btree/map.rs.html#2234)#### fn from(arr: [(K, V); N]) -> BTreeMap<K, V, Global>
Converts a `[(K, V); N]` into a `BTreeMap<(K, V)>`.
```
use std::collections::BTreeMap;
let map1 = BTreeMap::from([(1, 2), (3, 4)]);
let map2: BTreeMap<_, _> = [(1, 2), (3, 4)].into();
assert_eq!(map1, map2);
```
[source](https://doc.rust-lang.org/src/std/collections/hash/map.rs.html#1357-1373)1.56.0 · ### impl<K, V, const N: usize> From<[(K, V); N]> for HashMap<K, V, RandomState>where K: [Eq](cmp/trait.eq "trait std::cmp::Eq") + [Hash](hash/trait.hash "trait std::hash::Hash"),
[source](https://doc.rust-lang.org/src/std/collections/hash/map.rs.html#1370-1372)#### fn from(arr: [(K, V); N]) -> Self
##### Examples
```
use std::collections::HashMap;
let map1 = HashMap::from([(1, 2), (3, 4)]);
let map2: HashMap<_, _> = [(1, 2), (3, 4)].into();
assert_eq!(map1, map2);
```
[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](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/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/alloc/collections/btree/set.rs.html#1226)1.56.0 · ### impl<T, const N: usize> From<[T; N]> for BTreeSet<T, Global>where T: [Ord](cmp/trait.ord "trait std::cmp::Ord"),
[source](https://doc.rust-lang.org/src/alloc/collections/btree/set.rs.html#1236)#### fn from(arr: [T; N]) -> BTreeSet<T, Global>
Converts a `[T; N]` into a `BTreeSet<T>`.
```
use std::collections::BTreeSet;
let set1 = BTreeSet::from([1, 2, 3, 4]);
let set2: BTreeSet<_> = [1, 2, 3, 4].into();
assert_eq!(set1, set2);
```
[source](https://doc.rust-lang.org/src/alloc/collections/binary_heap.rs.html#1586)1.56.0 · ### impl<T, const N: usize> From<[T; N]> 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#1596)#### fn from(arr: [T; N]) -> BinaryHeap<T>
```
use std::collections::BinaryHeap;
let mut h1 = BinaryHeap::from([1, 4, 2, 3]);
let mut h2: BinaryHeap<_> = [1, 4, 2, 3].into();
while let Some((a, b)) = h1.pop().zip(h2.pop()) {
assert_eq!(a, b);
}
```
[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](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 `[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/std/collections/hash/set.rs.html#1048-1064)1.56.0 · ### impl<T, const N: usize> From<[T; N]> for HashSet<T, RandomState>where T: [Eq](cmp/trait.eq "trait std::cmp::Eq") + [Hash](hash/trait.hash "trait std::hash::Hash"),
[source](https://doc.rust-lang.org/src/std/collections/hash/set.rs.html#1061-1063)#### fn from(arr: [T; N]) -> Self
##### Examples
```
use std::collections::HashSet;
let set1 = HashSet::from([1, 2, 3, 4]);
let set2: HashSet<_> = [1, 2, 3, 4].into();
assert_eq!(set1, set2);
```
[source](https://doc.rust-lang.org/src/alloc/collections/linked_list.rs.html#1955)1.56.0 · ### impl<T, const N: usize> From<[T; N]> for LinkedList<T>
[source](https://doc.rust-lang.org/src/alloc/collections/linked_list.rs.html#1965)#### fn from(arr: [T; N]) -> LinkedList<T>
Converts a `[T; N]` into a `LinkedList<T>`.
```
use std::collections::LinkedList;
let list1 = LinkedList::from([1, 2, 3, 4]);
let list2: LinkedList<_> = [1, 2, 3, 4].into();
assert_eq!(list1, list2);
```
[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](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/vec_deque/mod.rs.html#3114)1.56.0 · ### impl<T, const N: usize> From<[T; N]> for VecDeque<T, Global>
[source](https://doc.rust-lang.org/src/alloc/collections/vec_deque/mod.rs.html#3124)#### fn from(arr: [T; N]) -> VecDeque<T, Global>
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>
```
Converts a `[T; N]` into a `VecDeque<T>`.
```
use std::collections::VecDeque;
let deq1 = VecDeque::from([1, 2, 3, 4]);
let deq2: VecDeque<_> = [1, 2, 3, 4].into();
assert_eq!(deq1, deq2);
```
[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](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#264)#### fn from(array: [bool; LANES]) -> Mask<T, LANES>
Converts to this type from the input type.
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#2069-2095)1.17.0 · ### impl From<[u16; 8]> for IpAddr
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#2092-2094)#### fn from(segments: [u16; 8]) -> IpAddr
Creates an `IpAddr::V6` from an eight element 16-bit array.
##### Examples
```
use std::net::{IpAddr, Ipv6Addr};
let addr = IpAddr::from([
525u16, 524u16, 523u16, 522u16,
521u16, 520u16, 519u16, 518u16,
]);
assert_eq!(
IpAddr::V6(Ipv6Addr::new(
0x20d, 0x20c,
0x20b, 0x20a,
0x209, 0x208,
0x207, 0x206
)),
addr
);
```
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#2010-2037)1.16.0 · ### impl From<[u16; 8]> for Ipv6Addr
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#2033-2036)#### fn from(segments: [u16; 8]) -> Ipv6Addr
Creates an `Ipv6Addr` from an eight element 16-bit array.
##### Examples
```
use std::net::Ipv6Addr;
let addr = Ipv6Addr::from([
525u16, 524u16, 523u16, 522u16,
521u16, 520u16, 519u16, 518u16,
]);
assert_eq!(
Ipv6Addr::new(
0x20d, 0x20c,
0x20b, 0x20a,
0x209, 0x208,
0x207, 0x206
),
addr
);
```
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#2040-2066)1.17.0 · ### impl From<[u8; 16]> for IpAddr
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#2063-2065)#### fn from(octets: [u8; 16]) -> IpAddr
Creates an `IpAddr::V6` from a sixteen element byte array.
##### Examples
```
use std::net::{IpAddr, Ipv6Addr};
let addr = IpAddr::from([
25u8, 24u8, 23u8, 22u8, 21u8, 20u8, 19u8, 18u8,
17u8, 16u8, 15u8, 14u8, 13u8, 12u8, 11u8, 10u8,
]);
assert_eq!(
IpAddr::V6(Ipv6Addr::new(
0x1918, 0x1716,
0x1514, 0x1312,
0x1110, 0x0f0e,
0x0d0c, 0x0b0a
)),
addr
);
```
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#1981-2007)1.9.0 · ### impl From<[u8; 16]> for Ipv6Addr
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#2004-2006)#### fn from(octets: [u8; 16]) -> Ipv6Addr
Creates an `Ipv6Addr` from a sixteen element byte array.
##### Examples
```
use std::net::Ipv6Addr;
let addr = Ipv6Addr::from([
25u8, 24u8, 23u8, 22u8, 21u8, 20u8, 19u8, 18u8,
17u8, 16u8, 15u8, 14u8, 13u8, 12u8, 11u8, 10u8,
]);
assert_eq!(
Ipv6Addr::new(
0x1918, 0x1716,
0x1514, 0x1312,
0x1110, 0x0f0e,
0x0d0c, 0x0b0a
),
addr
);
```
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#1147-1162)1.17.0 · ### impl From<[u8; 4]> for IpAddr
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#1159-1161)#### fn from(octets: [u8; 4]) -> IpAddr
Creates an `IpAddr::V4` from a four element byte array.
##### Examples
```
use std::net::{IpAddr, Ipv4Addr};
let addr = IpAddr::from([13u8, 12u8, 11u8, 10u8]);
assert_eq!(IpAddr::V4(Ipv4Addr::new(13, 12, 11, 10)), addr);
```
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#1129-1144)1.9.0 · ### impl From<[u8; 4]> for Ipv4Addr
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#1141-1143)#### fn from(octets: [u8; 4]) -> Ipv4Addr
Creates an `Ipv4Addr` from a four element byte array.
##### Examples
```
use std::net::Ipv4Addr;
let addr = Ipv4Addr::from([13u8, 12u8, 11u8, 10u8]);
assert_eq!(Ipv4Addr::new(13, 12, 11, 10), addr);
```
[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](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#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/vector.rs.html#632)### impl<T, const LANES: usize> From<Simd<T, LANES>> for [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/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/array/mod.rs.html#254)### impl<T, const N: usize> Hash for [T; N]where T: [Hash](hash/trait.hash "trait std::hash::Hash"),
The hash of an array is the same as that of the corresponding slice, as required by the `Borrow` implementation.
```
#![feature(build_hasher_simple_hash_one)]
use std::hash::BuildHasher;
let b = std::collections::hash_map::RandomState::new();
let a: [u8; 3] = [0xa8, 0x3c, 0x09];
let s: &[u8] = &[0xa8, 0x3c, 0x09];
assert_eq!(b.hash_one(a), b.hash_one(s));
```
[source](https://doc.rust-lang.org/src/core/array/mod.rs.html#255)#### 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/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](ops/trait.index "trait std::ops::Index")<I>,
#### type Output = <[T] as Index<I>>::Output
The returned type after indexing.
[source](https://doc.rust-lang.org/src/core/array/mod.rs.html#296)const: unstable · #### fn index(&self, index: I) -> &<[T; N] 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/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](ops/trait.indexmut "trait std::ops::IndexMut")<I>,
[source](https://doc.rust-lang.org/src/core/array/mod.rs.html#308)const: unstable · #### fn index\_mut(&mut self, index: I) -> &mut <[T; N] 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/array/mod.rs.html#268)### impl<'a, T, const N: usize> IntoIterator for &'a [T; N]
#### 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/array/mod.rs.html#272)#### 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/core/array/mod.rs.html#278)### impl<'a, T, const N: usize> IntoIterator for &'a mut [T; N]
#### 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/array/mod.rs.html#282)#### 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/core/array/iter.rs.html#41)1.53.0 · ### impl<T, const N: usize> IntoIterator for [T; N]
[source](https://doc.rust-lang.org/src/core/array/iter.rs.html#53)#### fn into\_iter(self) -> <[T; N] as IntoIterator>::IntoIter
Creates a consuming iterator, that is, one that moves each value out of the array (from start to end). The array cannot be used after calling this unless `T` implements `Copy`, so the whole array is copied.
Arrays have special behavior when calling `.into_iter()` prior to the 2021 edition – see the [array](primitive.array) Editions section for more information.
#### type Item = T
The type of the elements being iterated over.
#### type IntoIter = IntoIter<T, N>
Which kind of iterator are we turning this into?
[source](https://doc.rust-lang.org/src/core/array/mod.rs.html#339)### impl<T, const N: usize> Ord for [T; N]where T: [Ord](cmp/trait.ord "trait std::cmp::Ord"),
Implements comparison of arrays [lexicographically](cmp/trait.ord#lexicographical-comparison).
[source](https://doc.rust-lang.org/src/core/array/mod.rs.html#341)#### fn cmp(&self, other: &[T; N]) -> 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/array/equality.rs.html#67)### impl<A, B, const N: usize> PartialEq<&[B]> for [A; N]where A: [PartialEq](cmp/trait.partialeq "trait std::cmp::PartialEq")<B>,
[source](https://doc.rust-lang.org/src/core/array/equality.rs.html#72)#### fn eq(&self, other: &&[B]) -> 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/array/equality.rs.html#76)#### fn ne(&self, other: &&[B]) -> 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#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/collections/vec_deque/mod.rs.html#2895)1.17.0 · ### impl<T, U, A, const N: usize> PartialEq<&[U; N]> 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#2895)#### 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/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/array/equality.rs.html#97)### impl<A, B, const N: usize> PartialEq<&mut [B]> for [A; N]where A: [PartialEq](cmp/trait.partialeq "trait std::cmp::PartialEq")<B>,
[source](https://doc.rust-lang.org/src/core/array/equality.rs.html#102)#### fn eq(&self, other: &&mut [B]) -> 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/array/equality.rs.html#106)#### fn ne(&self, other: &&mut [B]) -> 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#2896)1.17.0 · ### impl<T, U, A, const N: usize> PartialEq<&mut [U; N]> 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#2896)#### fn eq(&self, other: &&mut [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/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/array/equality.rs.html#82)### impl<A, B, const N: usize> PartialEq<[A; N]> for &[B]where B: [PartialEq](cmp/trait.partialeq "trait std::cmp::PartialEq")<A>,
[source](https://doc.rust-lang.org/src/core/array/equality.rs.html#87)#### fn eq(&self, other: &[A; 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/core/array/equality.rs.html#91)#### fn ne(&self, other: &[A; 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/core/array/equality.rs.html#112)### impl<A, B, const N: usize> PartialEq<[A; N]> for &mut [B]where B: [PartialEq](cmp/trait.partialeq "trait std::cmp::PartialEq")<A>,
[source](https://doc.rust-lang.org/src/core/array/equality.rs.html#117)#### fn eq(&self, other: &[A; 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/core/array/equality.rs.html#121)#### fn ne(&self, other: &[A; 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/core/array/equality.rs.html#44)### impl<A, B, const N: usize> PartialEq<[A; N]> for [B]where B: [PartialEq](cmp/trait.partialeq "trait std::cmp::PartialEq")<A>,
[source](https://doc.rust-lang.org/src/core/array/equality.rs.html#49)#### fn eq(&self, other: &[A; 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/core/array/equality.rs.html#57)#### fn ne(&self, other: &[A; 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/core/array/equality.rs.html#6)### impl<A, B, const N: usize> PartialEq<[B; N]> for [A; N]where A: [PartialEq](cmp/trait.partialeq "trait std::cmp::PartialEq")<B>,
[source](https://doc.rust-lang.org/src/core/array/equality.rs.html#11)#### fn eq(&self, other: &[B; 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/core/array/equality.rs.html#15)#### fn ne(&self, other: &[B; 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/core/array/equality.rs.html#21)### impl<A, B, const N: usize> PartialEq<[B]> for [A; N]where A: [PartialEq](cmp/trait.partialeq "trait std::cmp::PartialEq")<B>,
[source](https://doc.rust-lang.org/src/core/array/equality.rs.html#26)#### fn eq(&self, other: &[B]) -> 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/array/equality.rs.html#34)#### fn ne(&self, other: &[B]) -> 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/collections/vec_deque/mod.rs.html#2894)1.17.0 · ### impl<T, U, A, const N: usize> PartialEq<[U; N]> 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#2894)#### 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/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/array/mod.rs.html#314)### impl<T, const N: usize> PartialOrd<[T; N]> for [T; N]where T: [PartialOrd](cmp/trait.partialord "trait std::cmp::PartialOrd")<T>,
[source](https://doc.rust-lang.org/src/core/array/mod.rs.html#316)#### fn partial\_cmp(&self, other: &[T; N]) -> 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/array/mod.rs.html#320)#### fn lt(&self, other: &[T; N]) -> 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/array/mod.rs.html#324)#### fn le(&self, other: &[T; N]) -> 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/array/mod.rs.html#328)#### fn ge(&self, other: &[T; N]) -> 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/array/mod.rs.html#332)#### fn gt(&self, other: &[T; N]) -> 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/str/pattern.rs.html#816)### impl<'a, 'b, const N: usize> Pattern<'a> for &'b [char; N]
Searches for chars that are equal to any of the [`char`](primitive.char "char")s in the array.
#### Examples
```
assert_eq!("Hello world".find(&['l', 'l']), Some(2));
assert_eq!("Hello world".find(&['l', 'l']), Some(2));
```
#### type Searcher = CharArrayRefSearcher<'a, 'b, N>
🔬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#817)#### fn into\_searcher(self, haystack: &'a str) -> CharArrayRefSearcher<'a, 'b, N>
🔬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#817)#### 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#817)#### 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#817)#### 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#817)#### fn is\_suffix\_of(self, haystack: &'a str) -> boolwhere [CharArrayRefSearcher](str/pattern/struct.chararrayrefsearcher "struct std::str::pattern::CharArrayRefSearcher")<'a, 'b, N>: [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#817)#### fn strip\_suffix\_of(self, haystack: &'a str) -> Option<&'a str>where [CharArrayRefSearcher](str/pattern/struct.chararrayrefsearcher "struct std::str::pattern::CharArrayRefSearcher")<'a, 'b, N>: [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/str/pattern.rs.html#796)### impl<'a, const N: usize> Pattern<'a> for [char; N]
Searches for chars that are equal to any of the [`char`](primitive.char "char")s in the array.
#### Examples
```
assert_eq!("Hello world".find(['l', 'l']), Some(2));
assert_eq!("Hello world".find(['l', 'l']), Some(2));
```
#### type Searcher = CharArraySearcher<'a, N>
🔬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#797)#### fn into\_searcher(self, haystack: &'a str) -> CharArraySearcher<'a, N>
🔬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#797)#### 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#797)#### 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#797)#### 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#797)#### fn is\_suffix\_of(self, haystack: &'a str) -> boolwhere [CharArraySearcher](str/pattern/struct.chararraysearcher "struct std::str::pattern::CharArraySearcher")<'a, N>: [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#797)#### fn strip\_suffix\_of(self, haystack: &'a str) -> Option<&'a str>where [CharArraySearcher](str/pattern/struct.chararraysearcher "struct std::str::pattern::CharArraySearcher")<'a, N>: [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/slice/mod.rs.html#4250)1.51.0 · ### impl<T, const N: usize> SlicePattern for [T; N]
#### type Item = T
🔬This is a nightly-only experimental API. (`slice_pattern` [#56345](https://github.com/rust-lang/rust/issues/56345))
The element type of the slice being matched on.
[source](https://doc.rust-lang.org/src/core/slice/mod.rs.html#4254)#### fn as\_slice(&self) -> &[<[T; N] as SlicePattern>::Item]
🔬This is a nightly-only experimental API. (`slice_pattern` [#56345](https://github.com/rust-lang/rust/issues/56345))
Currently, the consumers of `SlicePattern` need a slice.
[source](https://doc.rust-lang.org/src/core/array/mod.rs.html#212)1.34.0 · ### impl<'a, T, const N: usize> TryFrom<&'a [T]> for &'a [T; N]
#### type Error = TryFromSliceError
The type returned in the event of a conversion error.
[source](https://doc.rust-lang.org/src/core/array/mod.rs.html#215)#### fn try\_from(slice: &[T]) -> Result<&[T; N], TryFromSliceError>
Performs the conversion.
[source](https://doc.rust-lang.org/src/core/array/mod.rs.html#227)1.34.0 · ### impl<'a, T, const N: usize> TryFrom<&'a mut [T]> for &'a mut [T; N]
#### type Error = TryFromSliceError
The type returned in the event of a conversion error.
[source](https://doc.rust-lang.org/src/core/array/mod.rs.html#230)#### fn try\_from(slice: &mut [T]) -> Result<&mut [T; N], TryFromSliceError>
Performs the conversion.
[source](https://doc.rust-lang.org/src/core/array/mod.rs.html#188)1.34.0 · ### impl<T, const N: usize> TryFrom<&[T]> for [T; N]where T: [Copy](marker/trait.copy "trait std::marker::Copy"),
#### type Error = TryFromSliceError
The type returned in the event of a conversion error.
[source](https://doc.rust-lang.org/src/core/array/mod.rs.html#194)#### fn try\_from(slice: &[T]) -> Result<[T; N], TryFromSliceError>
Performs the conversion.
[source](https://doc.rust-lang.org/src/core/array/mod.rs.html#200)1.59.0 · ### impl<T, const N: usize> TryFrom<&mut [T]> for [T; N]where T: [Copy](marker/trait.copy "trait std::marker::Copy"),
#### type Error = TryFromSliceError
The type returned in the event of a conversion error.
[source](https://doc.rust-lang.org/src/core/array/mod.rs.html#206)#### fn try\_from(slice: &mut [T]) -> Result<[T; N], TryFromSliceError>
Performs the conversion.
[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/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)`](vec/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/core/array/mod.rs.html#347)1.58.0 · ### impl<T, const N: usize> Copy for [T; N]where T: [Copy](marker/trait.copy "trait std::marker::Copy"),
[source](https://doc.rust-lang.org/src/core/array/equality.rs.html#131)### impl<T, const N: usize> Eq for [T; N]where T: [Eq](cmp/trait.eq "trait std::cmp::Eq"),
Auto Trait Implementations
--------------------------
### impl<T, const N: usize> RefUnwindSafe for [T; N]where T: [RefUnwindSafe](panic/trait.refunwindsafe "trait std::panic::RefUnwindSafe"),
### impl<T, const N: usize> Send for [T; N]where T: [Send](marker/trait.send "trait std::marker::Send"),
### impl<T, const N: usize> Sync for [T; N]where T: [Sync](marker/trait.sync "trait std::marker::Sync"),
### impl<T, const N: usize> Unpin for [T; N]where T: [Unpin](marker/trait.unpin "trait std::marker::Unpin"),
### impl<T, const N: usize> UnwindSafe for [T; N]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 Macro std::assert_ne Macro std::assert\_ne
=====================
```
macro_rules! assert_ne {
($left:expr, $right:expr $(,)?) => { ... };
($left:expr, $right:expr, $($arg:tt)+) => { ... };
}
```
Asserts that two expressions are not equal to each other (using [`PartialEq`](cmp/trait.partialeq "PartialEq")).
On panic, this macro will print the values of the expressions with their debug representations.
Like [`assert!`](macro.assert "assert!"), this macro has a second form, where a custom panic message can be provided.
Examples
--------
```
let a = 3;
let b = 2;
assert_ne!(a, b);
assert_ne!(a, b, "we are testing that the values are not equal");
```
rust Keyword use Keyword use
===========
Import or rename items from other crates or modules.
Usually a `use` keyword is used to shorten the path required to refer to a module item. The keyword may appear in modules, blocks and even functions, usually at the top.
The most basic usage of the keyword is `use path::to::item;`, though a number of convenient shortcuts are supported:
* Simultaneously binding a list of paths with a common prefix, using the glob-like brace syntax `use a::b::{c, d, e::f, g::h::i};`
* Simultaneously binding a list of paths with a common prefix and their common parent module, using the [`self`](keyword.self) keyword, such as `use a::b::{self, c, d::e};`
* Rebinding the target name as a new local name, using the syntax `use p::q::r as x;`. This can also be used with the last two features: `use a::b::{self as ab, c as abc}`.
* Binding all paths matching a given prefix, using the asterisk wildcard syntax `use a::b::*;`.
* Nesting groups of the previous features multiple times, such as `use a::b::{self as ab, c, d::{*, e::f}};`
* Reexporting with visibility modifiers such as `pub use a::b;`
* Importing with `_` to only import the methods of a trait without binding it to a name (to avoid conflict for example): `use ::std::io::Read as _;`.
Using path qualifiers like [`crate`](keyword.crate), [`super`](keyword.super) or [`self`](keyword.self) is supported: `use crate::a::b;`.
Note that when the wildcard `*` is used on a type, it does not import its methods (though for `enum`s it imports the variants, as shown in the example below).
ⓘ
```
enum ExampleEnum {
VariantA,
VariantB,
}
impl ExampleEnum {
fn new() -> Self {
Self::VariantA
}
}
use ExampleEnum::*;
// Compiles.
let _ = VariantA;
// Does not compile !
let n = new();
```
For more information on `use` and paths in general, see the [Reference](../reference/items/use-declarations).
The differences about paths and the `use` keyword between the 2015 and 2018 editions can also be found in the [Reference](../reference/items/use-declarations).
rust Module std::hint Module std::hint
================
Hints to compiler that affects how code should be emitted or optimized. Hints may be compile time or runtime.
Functions
---------
[black\_box](fn.black_box "std::hint::black_box fn")Experimental
An identity function that ***hints*** to the compiler to be maximally pessimistic about what `black_box` could do.
[must\_use](fn.must_use "std::hint::must_use fn")Experimental
An identity function that causes an `unused_must_use` warning to be triggered if the given value is not used (returned, stored in a variable, etc) by the caller.
[spin\_loop](fn.spin_loop "std::hint::spin_loop fn")
Emits a machine instruction to signal the processor that it is running in a busy-wait spin-loop (“spin lock”).
[unreachable\_unchecked](fn.unreachable_unchecked "std::hint::unreachable_unchecked fn")[⚠](# "unsafe function")
Informs the compiler that the site which is calling this function is not reachable, possibly enabling further optimizations.
rust Function std::hint::black_box Function std::hint::black\_box
==============================
```
pub fn black_box<T>(dummy: T) -> T
```
🔬This is a nightly-only experimental API. (`bench_black_box` [#64102](https://github.com/rust-lang/rust/issues/64102))
An identity function that ***hints*** to the compiler to be maximally pessimistic about what `black_box` could do.
Unlike [`std::convert::identity`](../convert/fn.identity), a Rust compiler is encouraged to assume that `black_box` can use `dummy` in any possible valid way that Rust code is allowed to without introducing undefined behavior in the calling code. This property makes `black_box` useful for writing code in which certain optimizations are not desired, such as benchmarks.
Note however, that `black_box` is only (and can only be) provided on a “best-effort” basis. The extent to which it can block optimisations may vary depending upon the platform and code-gen backend used. Programs cannot rely on `black_box` for *correctness* in any way.
rust Function std::hint::unreachable_unchecked Function std::hint::unreachable\_unchecked
==========================================
```
pub const unsafe fn unreachable_unchecked() -> !
```
Informs the compiler that the site which is calling this function is not reachable, possibly enabling further optimizations.
Safety
------
Reaching this function is *Undefined Behavior*.
As the compiler assumes that all forms of Undefined Behavior can never happen, it will eliminate all branches in the surrounding code that it can determine will invariably lead to a call to `unreachable_unchecked()`.
If the assumptions embedded in using this function turn out to be wrong - that is, if the site which is calling `unreachable_unchecked()` is actually reachable at runtime - the compiler may have generated nonsensical machine instructions for this situation, including in seemingly unrelated code, causing difficult-to-debug problems.
Use this function sparingly. Consider using the [`unreachable!`](../macro.unreachable "unreachable!") macro, which may prevent some optimizations but will safely panic in case it is actually reached at runtime. Benchmark your code to find out if using `unreachable_unchecked()` comes with a performance benefit.
Examples
--------
`unreachable_unchecked()` can be used in situations where the compiler can’t prove invariants that were previously established. Such situations have a higher chance of occurring if those invariants are upheld by external code that the compiler can’t analyze.
```
fn prepare_inputs(divisors: &mut Vec<u32>) {
// Note to future-self when making changes: The invariant established
// here is NOT checked in `do_computation()`; if this changes, you HAVE
// to change `do_computation()`.
divisors.retain(|divisor| *divisor != 0)
}
/// # Safety
/// All elements of `divisor` must be non-zero.
unsafe fn do_computation(i: u32, divisors: &[u32]) -> u32 {
divisors.iter().fold(i, |acc, divisor| {
// Convince the compiler that a division by zero can't happen here
// and a check is not needed below.
if *divisor == 0 {
// Safety: `divisor` can't be zero because of `prepare_inputs`,
// but the compiler does not know about this. We *promise*
// that we always call `prepare_inputs`.
std::hint::unreachable_unchecked()
}
// The compiler would normally introduce a check here that prevents
// a division by zero. However, if `divisor` was zero, the branch
// above would reach what we explicitly marked as unreachable.
// The compiler concludes that `divisor` can't be zero at this point
// and removes the - now proven useless - check.
acc / divisor
})
}
let mut divisors = vec![2, 0, 4];
prepare_inputs(&mut divisors);
let result = unsafe {
// Safety: prepare_inputs() guarantees that divisors is non-zero
do_computation(100, &divisors)
};
assert_eq!(result, 12);
```
While using `unreachable_unchecked()` is perfectly sound in the following example, the compiler is able to prove that a division by zero is not possible. Benchmarking reveals that `unreachable_unchecked()` provides no benefit over using [`unreachable!`](../macro.unreachable "unreachable!"), while the latter does not introduce the possibility of Undefined Behavior.
```
fn div_1(a: u32, b: u32) -> u32 {
use std::hint::unreachable_unchecked;
// `b.saturating_add(1)` is always positive (not zero),
// hence `checked_div` will never return `None`.
// Therefore, the else branch is unreachable.
a.checked_div(b.saturating_add(1))
.unwrap_or_else(|| unsafe { unreachable_unchecked() })
}
assert_eq!(div_1(7, 0), 7);
assert_eq!(div_1(9, 1), 4);
assert_eq!(div_1(11, u32::MAX), 0);
```
rust Function std::hint::must_use Function std::hint::must\_use
=============================
```
pub fn must_use<T>(value: T) -> T
```
🔬This is a nightly-only experimental API. (`hint_must_use` [#94745](https://github.com/rust-lang/rust/issues/94745))
An identity function that causes an `unused_must_use` warning to be triggered if the given value is not used (returned, stored in a variable, etc) by the caller.
This is primarily intended for use in macro-generated code, in which a [`#[must_use]` attribute](../../reference/attributes/diagnostics#the-must_use-attribute) either on a type or a function would not be convenient.
Example
-------
```
#![feature(hint_must_use)]
use core::fmt;
pub struct Error(/* ... */);
#[macro_export]
macro_rules! make_error {
($($args:expr),*) => {
core::hint::must_use({
let error = $crate::make_error(core::format_args!($($args),*));
error
})
};
}
// Implementation detail of make_error! macro.
#[doc(hidden)]
pub fn make_error(args: fmt::Arguments<'_>) -> Error {
Error(/* ... */)
}
fn demo() -> Option<Error> {
if true {
// Oops, meant to write `return Some(make_error!("..."));`
Some(make_error!("..."));
}
None
}
```
In the above example, we’d like an `unused_must_use` lint to apply to the value created by `make_error!`. However, neither `#[must_use]` on a struct nor `#[must_use]` on a function is appropriate here, so the macro expands using `core::hint::must_use` instead.
* We wouldn’t want `#[must_use]` on the `struct Error` because that would make the following unproblematic code trigger a warning:
```
fn f(arg: &str) -> Result<(), Error>
#[test]
fn t() {
// Assert that `f` returns error if passed an empty string.
// A value of type `Error` is unused here but that's not a problem.
f("").unwrap_err();
}
```
* Using `#[must_use]` on `fn make_error` can’t help because the return value *is* used, as the right-hand side of a `let` statement. The `let` statement looks useless but is in fact necessary for ensuring that temporaries within the `format_args` expansion are not kept alive past the creation of the `Error`, as keeping them alive past that point can cause autotrait issues in async code:
```
async fn f() {
// Using `let` inside the make_error expansion causes temporaries like
// `unsync()` to drop at the semicolon of that `let` statement, which
// is prior to the await point. They would otherwise stay around until
// the semicolon on *this* statement, which is after the await point,
// and the enclosing Future would not implement Send.
log(make_error!("look: {:p}", unsync())).await;
}
async fn log(error: Error) {/* ... */}
// Returns something without a Sync impl.
fn unsync() -> *const () {
0 as *const ()
}
```
rust Function std::hint::spin_loop Function std::hint::spin\_loop
==============================
```
pub fn spin_loop()
```
Emits a machine instruction to signal the processor that it is running in a busy-wait spin-loop (“spin lock”).
Upon receiving the spin-loop signal the processor can optimize its behavior by, for example, saving power or switching hyper-threads.
This function is different from [`thread::yield_now`](../thread/fn.yield_now) which directly yields to the system’s scheduler, whereas `spin_loop` does not interact with the operating system.
A common use case for `spin_loop` is implementing bounded optimistic spinning in a CAS loop in synchronization primitives. To avoid problems like priority inversion, it is strongly recommended that the spin loop is terminated after a finite amount of iterations and an appropriate blocking syscall is made.
**Note**: On platforms that do not support receiving spin-loop hints this function does not do anything at all.
Examples
--------
```
use std::sync::atomic::{AtomicBool, Ordering};
use std::sync::Arc;
use std::{hint, thread};
// A shared atomic value that threads will use to coordinate
let live = Arc::new(AtomicBool::new(false));
// In a background thread we'll eventually set the value
let bg_work = {
let live = live.clone();
thread::spawn(move || {
// Do some work, then make the value live
do_some_work();
live.store(true, Ordering::Release);
})
};
// Back on our current thread, we wait for the value to be set
while !live.load(Ordering::Acquire) {
// The spin loop is a hint to the CPU that we're waiting, but probably
// not for very long
hint::spin_loop();
}
// The value is now set
do_some_work();
bg_work.join()?;
```
rust Macro std::assert_matches::debug_assert_matches Macro std::assert\_matches::debug\_assert\_matches
==================================================
```
pub macro debug_assert_matches($($arg:tt)*) {
...
}
```
🔬This is a nightly-only experimental API. (`assert_matches` [#82775](https://github.com/rust-lang/rust/issues/82775))
Asserts that an expression matches any of the given patterns.
Like in a `match` expression, the pattern can be optionally followed by `if` and a guard expression that has access to names bound by the pattern.
On panic, this macro will print the value of the expression with its debug representation.
Unlike [`assert_matches!`](macro.assert_matches "assert_matches!"), `debug_assert_matches!` statements are only enabled in non optimized builds by default. An optimized build will not execute `debug_assert_matches!` statements unless `-C debug-assertions` is passed to the compiler. This makes `debug_assert_matches!` useful for checks that are too expensive to be present in a release build but may be helpful during development. The result of expanding `debug_assert_matches!` is always type checked.
Examples
--------
```
#![feature(assert_matches)]
use std::assert_matches::debug_assert_matches;
let a = 1u32.checked_add(2);
let b = 1u32.checked_sub(2);
debug_assert_matches!(a, Some(_));
debug_assert_matches!(b, None);
let c = Ok("abc".to_string());
debug_assert_matches!(c, Ok(x) | Err(x) if x.len() < 100);
```
rust Module std::assert_matches Module std::assert\_matches
===========================
🔬This is a nightly-only experimental API. (`assert_matches` [#82775](https://github.com/rust-lang/rust/issues/82775))
Unstable module containing the unstable `assert_matches` macro.
Macros
------
[assert\_matches](macro.assert_matches "std::assert_matches::assert_matches macro")Experimental
Asserts that an expression matches any of the given patterns.
[debug\_assert\_matches](macro.debug_assert_matches "std::assert_matches::debug_assert_matches macro")Experimental
Asserts that an expression matches any of the given patterns.
rust Macro std::assert_matches::assert_matches Macro std::assert\_matches::assert\_matches
===========================================
```
pub macro assert_matches {
($left:expr, $(|)? $($pattern:pat_param)|+ $(if $guard:expr)? $(,)?) => { ... },
($left:expr, $(|)? $($pattern:pat_param)|+ $(if $guard:expr)?, $($arg:tt)+) => { ... },
}
```
🔬This is a nightly-only experimental API. (`assert_matches` [#82775](https://github.com/rust-lang/rust/issues/82775))
Asserts that an expression matches any of the given patterns.
Like in a `match` expression, the pattern can be optionally followed by `if` and a guard expression that has access to names bound by the pattern.
On panic, this macro will print the value of the expression with its debug representation.
Like [`assert!`](../macro.assert "assert!"), this macro has a second form, where a custom panic message can be provided.
Examples
--------
```
#![feature(assert_matches)]
use std::assert_matches::assert_matches;
let a = 1u32.checked_add(2);
let b = 1u32.checked_sub(2);
assert_matches!(a, Some(_));
assert_matches!(b, None);
let c = Ok("abc".to_string());
assert_matches!(c, Ok(x) | Err(x) if x.len() < 100);
```
rust Module std::ascii Module std::ascii
=================
Operations on ASCII strings and characters.
Most string operations in Rust act on UTF-8 strings. However, at times it makes more sense to only consider the ASCII character set for a specific operation.
The [`AsciiExt`](trait.asciiext "AsciiExt") trait provides methods that allow for character operations that only act on the ASCII subset and leave non-ASCII characters alone.
The [`escape_default`](fn.escape_default "escape_default") function provides an iterator over the bytes of an escaped version of the character given.
Structs
-------
[EscapeDefault](struct.escapedefault "std::ascii::EscapeDefault struct")
An iterator over the escaped version of a byte.
Traits
------
[AsciiExt](trait.asciiext "std::ascii::AsciiExt trait")Deprecated
Extension methods for ASCII-subset only operations.
Functions
---------
[escape\_default](fn.escape_default "std::ascii::escape_default fn")
Returns an iterator that produces an escaped version of a `u8`.
rust Trait std::ascii::AsciiExt Trait std::ascii::AsciiExt
==========================
```
pub trait AsciiExt {
type Owned;
fn is_ascii(&self) -> bool;
fn to_ascii_uppercase(&self) -> Self::Owned;
fn to_ascii_lowercase(&self) -> Self::Owned;
fn eq_ignore_ascii_case(&self, other: &Self) -> bool;
fn make_ascii_uppercase(&mut self);
fn make_ascii_lowercase(&mut self);
}
```
👎Deprecated since 1.26.0: use inherent methods instead
Extension methods for ASCII-subset only operations.
Be aware that operations on seemingly non-ASCII characters can sometimes have unexpected results. Consider this example:
```
use std::ascii::AsciiExt;
assert_eq!(AsciiExt::to_ascii_uppercase("café"), "CAFÉ");
assert_eq!(AsciiExt::to_ascii_uppercase("café"), "CAFé");
```
In the first example, the lowercased string is represented `"cafe\u{301}"` (the last character is an acute accent [combining character](https://en.wikipedia.org/wiki/Combining_character)). Unlike the other characters in the string, the combining character will not get mapped to an uppercase variant, resulting in `"CAFE\u{301}"`. In the second example, the lowercased string is represented `"caf\u{e9}"` (the last character is a single Unicode character representing an ‘e’ with an acute accent). Since the last character is defined outside the scope of ASCII, it will not get mapped to an uppercase variant, resulting in `"CAF\u{e9}"`.
Required Associated Types
-------------------------
[source](https://doc.rust-lang.org/src/std/ascii.rs.html#46)#### type Owned
👎Deprecated since 1.26.0: use inherent methods instead
Container type for copied ASCII characters.
Required Methods
----------------
[source](https://doc.rust-lang.org/src/std/ascii.rs.html#55)#### fn is\_ascii(&self) -> bool
👎Deprecated since 1.26.0: use inherent methods instead
Checks if the value is within the ASCII range.
##### Note
This method is deprecated in favor of the identically-named inherent methods on `u8`, `char`, `[u8]` and `str`.
[source](https://doc.rust-lang.org/src/std/ascii.rs.html#75)#### fn to\_ascii\_uppercase(&self) -> Self::Owned
👎Deprecated since 1.26.0: use inherent methods instead
Makes a copy of the value in 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`](trait.asciiext#tymethod.make_ascii_uppercase).
To uppercase ASCII characters in addition to non-ASCII characters, use [`str::to_uppercase`](../primitive.str#method.to_uppercase "str::to_uppercase").
##### Note
This method is deprecated in favor of the identically-named inherent methods on `u8`, `char`, `[u8]` and `str`.
[source](https://doc.rust-lang.org/src/std/ascii.rs.html#95)#### fn to\_ascii\_lowercase(&self) -> Self::Owned
👎Deprecated since 1.26.0: use inherent methods instead
Makes a copy of the value in 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`](trait.asciiext#tymethod.make_ascii_lowercase).
To lowercase ASCII characters in addition to non-ASCII characters, use [`str::to_lowercase`](../primitive.str#method.to_lowercase "str::to_lowercase").
##### Note
This method is deprecated in favor of the identically-named inherent methods on `u8`, `char`, `[u8]` and `str`.
[source](https://doc.rust-lang.org/src/std/ascii.rs.html#107)#### fn eq\_ignore\_ascii\_case(&self, other: &Self) -> bool
👎Deprecated since 1.26.0: use inherent methods instead
Checks that two values are an ASCII case-insensitive match.
Same as `to_ascii_lowercase(a) == to_ascii_lowercase(b)`, but without allocating and copying temporaries.
##### Note
This method is deprecated in favor of the identically-named inherent methods on `u8`, `char`, `[u8]` and `str`.
[source](https://doc.rust-lang.org/src/std/ascii.rs.html#124)1.9.0 · #### fn make\_ascii\_uppercase(&mut self)
👎Deprecated since 1.26.0: use inherent methods instead
Converts this type 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`](trait.asciiext#tymethod.to_ascii_uppercase).
##### Note
This method is deprecated in favor of the identically-named inherent methods on `u8`, `char`, `[u8]` and `str`.
[source](https://doc.rust-lang.org/src/std/ascii.rs.html#141)1.9.0 · #### fn make\_ascii\_lowercase(&mut self)
👎Deprecated since 1.26.0: use inherent methods instead
Converts this type 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`](trait.asciiext#tymethod.to_ascii_lowercase).
##### Note
This method is deprecated in favor of the identically-named inherent methods on `u8`, `char`, `[u8]` and `str`.
Implementors
------------
[source](https://doc.rust-lang.org/src/std/ascii.rs.html#188-192)### impl AsciiExt for char
#### type Owned = char
[source](https://doc.rust-lang.org/src/std/ascii.rs.html#204-208)### impl AsciiExt for str
#### type Owned = String
[source](https://doc.rust-lang.org/src/std/ascii.rs.html#180-184)### impl AsciiExt for u8
#### type Owned = u8
[source](https://doc.rust-lang.org/src/std/ascii.rs.html#196-200)### impl AsciiExt for [u8]
#### type Owned = Vec<u8, Global>
| programming_docs |
rust Struct std::ascii::EscapeDefault Struct std::ascii::EscapeDefault
================================
```
pub struct EscapeDefault { /* private fields */ }
```
An iterator over the escaped version of a byte.
This `struct` is created by the [`escape_default`](fn.escape_default "escape_default") function. See its documentation for more.
Trait Implementations
---------------------
[source](https://doc.rust-lang.org/src/core/ascii.rs.html#23)### impl Clone for EscapeDefault
[source](https://doc.rust-lang.org/src/core/ascii.rs.html#23)#### fn clone(&self) -> EscapeDefault
Notable traits for [EscapeDefault](struct.escapedefault "struct std::ascii::EscapeDefault")
```
impl Iterator for EscapeDefault
type Item = u8;
```
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/ascii.rs.html#147)1.16.0 · ### impl Debug for EscapeDefault
[source](https://doc.rust-lang.org/src/core/ascii.rs.html#148)#### 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/ascii.rs.html#137)1.39.0 · ### impl Display for EscapeDefault
[source](https://doc.rust-lang.org/src/core/ascii.rs.html#138)#### 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/ascii.rs.html#126)### impl DoubleEndedIterator for EscapeDefault
[source](https://doc.rust-lang.org/src/core/ascii.rs.html#127)#### fn next\_back(&mut self) -> Option<u8>
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/ascii.rs.html#132)### impl ExactSizeIterator for EscapeDefault
[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/ascii.rs.html#111)### impl Iterator for EscapeDefault
#### type Item = u8
The type of the elements being iterated over.
[source](https://doc.rust-lang.org/src/core/ascii.rs.html#115)#### fn next(&mut self) -> Option<u8>
Advances the iterator and returns the next value. [Read more](../iter/trait.iterator#tymethod.next)
[source](https://doc.rust-lang.org/src/core/ascii.rs.html#118)#### 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/ascii.rs.html#121)#### fn last(self) -> Option<u8>
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#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#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](../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/core/ascii.rs.html#134)1.26.0 · ### impl FusedIterator for EscapeDefault
Auto Trait Implementations
--------------------------
### impl RefUnwindSafe for EscapeDefault
### impl Send for EscapeDefault
### impl Sync for EscapeDefault
### impl Unpin for EscapeDefault
### impl UnwindSafe for EscapeDefault
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/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::ascii::escape_default Function std::ascii::escape\_default
====================================
```
pub fn escape_default(c: u8) -> EscapeDefaultⓘNotable traits for EscapeDefaultimpl Iterator for EscapeDefault type Item = u8;
```
Returns an iterator that produces an escaped version of a `u8`.
The default is chosen with a bias toward producing literals that are legal in a variety of languages, including C++11 and similar C-family languages. The exact rules are:
* Tab is escaped as `\t`.
* Carriage return is escaped as `\r`.
* Line feed is escaped as `\n`.
* Single quote is escaped as `\'`.
* Double quote is escaped as `\"`.
* Backslash is escaped as `\\`.
* Any character in the ‘printable ASCII’ range `0x20` .. `0x7e` inclusive is not escaped.
* Any other chars are given hex escapes of the form ‘\xNN’.
* Unicode escapes are never generated by this function.
Examples
--------
```
use std::ascii;
let escaped = ascii::escape_default(b'0').next().unwrap();
assert_eq!(b'0', escaped);
let mut escaped = ascii::escape_default(b'\t');
assert_eq!(b'\\', escaped.next().unwrap());
assert_eq!(b't', escaped.next().unwrap());
let mut escaped = ascii::escape_default(b'\r');
assert_eq!(b'\\', escaped.next().unwrap());
assert_eq!(b'r', escaped.next().unwrap());
let mut escaped = ascii::escape_default(b'\n');
assert_eq!(b'\\', escaped.next().unwrap());
assert_eq!(b'n', escaped.next().unwrap());
let mut escaped = ascii::escape_default(b'\'');
assert_eq!(b'\\', escaped.next().unwrap());
assert_eq!(b'\'', escaped.next().unwrap());
let mut escaped = ascii::escape_default(b'"');
assert_eq!(b'\\', escaped.next().unwrap());
assert_eq!(b'"', escaped.next().unwrap());
let mut escaped = ascii::escape_default(b'\\');
assert_eq!(b'\\', escaped.next().unwrap());
assert_eq!(b'\\', escaped.next().unwrap());
let mut escaped = ascii::escape_default(b'\x9d');
assert_eq!(b'\\', escaped.next().unwrap());
assert_eq!(b'x', escaped.next().unwrap());
assert_eq!(b'9', escaped.next().unwrap());
assert_eq!(b'd', escaped.next().unwrap());
```
rust Module std::u64 Module std::u64
===============
👎Deprecating in a future Rust version: all constants in this module replaced by associated constants on `u64`
Constants for the 64-bit unsigned integer type.
*[See also the `u64` primitive type](../primitive.u64 "u64").*
New code should use the associated constants directly on the primitive type.
Constants
---------
[MAX](constant.max "std::u64::MAX constant")Deprecation planned
The largest value that can be represented by this integer type. Use [`u64::MAX`](../primitive.u64#associatedconstant.MAX "u64::MAX") instead.
[MIN](constant.min "std::u64::MIN constant")Deprecation planned
The smallest value that can be represented by this integer type. Use [`u64::MIN`](../primitive.u64#associatedconstant.MIN "u64::MIN") instead.
rust Constant std::u64::MAX Constant std::u64::MAX
======================
```
pub const MAX: u64 = u64::MAX; // 18_446_744_073_709_551_615u64
```
👎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 [`u64::MAX`](../primitive.u64#associatedconstant.MAX "u64::MAX") instead.
Examples
--------
```
// deprecated way
let max = std::u64::MAX;
// intended way
let max = u64::MAX;
```
rust Constant std::u64::MIN Constant std::u64::MIN
======================
```
pub const MIN: u64 = u64::MIN; // 0u64
```
👎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 [`u64::MIN`](../primitive.u64#associatedconstant.MIN "u64::MIN") instead.
Examples
--------
```
// deprecated way
let min = std::u64::MIN;
// intended way
let min = u64::MIN;
```
rust Macro std::cmp::Ord Macro std::cmp::Ord
===================
```
pub macro Ord($item:item) {
...
}
```
Derive macro generating an impl of the trait `Ord`.
rust Macro std::cmp::Eq Macro std::cmp::Eq
==================
```
pub macro Eq($item:item) {
...
}
```
Derive macro generating an impl of the trait `Eq`.
rust Macro std::cmp::PartialEq Macro std::cmp::PartialEq
=========================
```
pub macro PartialEq($item:item) {
...
}
```
Derive macro generating an impl of the trait `PartialEq`.
rust Macro std::cmp::PartialOrd Macro std::cmp::PartialOrd
==========================
```
pub macro PartialOrd($item:item) {
...
}
```
Derive macro generating an impl of the trait `PartialOrd`.
rust Module std::cmp Module std::cmp
===============
Utilities for comparing and ordering values.
This module contains various tools for comparing and ordering values. In summary:
* [`Eq`](trait.eq "Eq") and [`PartialEq`](trait.partialeq "PartialEq") are traits that allow you to define total and partial equality between values, respectively. Implementing them overloads the `==` and `!=` operators.
* [`Ord`](trait.ord "Ord") and [`PartialOrd`](trait.partialord "PartialOrd") are traits that allow you to define total and partial orderings between values, respectively. Implementing them overloads the `<`, `<=`, `>`, and `>=` operators.
* [`Ordering`](enum.ordering "Ordering") is an enum returned by the main functions of [`Ord`](trait.ord "Ord") and [`PartialOrd`](trait.partialord "PartialOrd"), and describes an ordering.
* [`Reverse`](struct.reverse "Reverse") is a struct that allows you to easily reverse an ordering.
* [`max`](trait.ord#method.max) and [`min`](trait.ord#method.min) are functions that build off of [`Ord`](trait.ord "Ord") and allow you to find the maximum or minimum of two values.
For more details, see the respective documentation of each item in the list.
Macros
------
[Eq](macro.eq "std::cmp::Eq macro")
Derive macro generating an impl of the trait `Eq`.
[Ord](macro.ord "std::cmp::Ord macro")
Derive macro generating an impl of the trait `Ord`.
[PartialEq](macro.partialeq "std::cmp::PartialEq macro")
Derive macro generating an impl of the trait `PartialEq`.
[PartialOrd](macro.partialord "std::cmp::PartialOrd macro")
Derive macro generating an impl of the trait `PartialOrd`.
Structs
-------
[Reverse](struct.reverse "std::cmp::Reverse struct")
A helper struct for reverse ordering.
Enums
-----
[Ordering](enum.ordering "std::cmp::Ordering enum")
An `Ordering` is the result of a comparison between two values.
Traits
------
[Eq](trait.eq "std::cmp::Eq trait")
Trait for equality comparisons which are [equivalence relations](https://en.wikipedia.org/wiki/Equivalence_relation).
[Ord](trait.ord "std::cmp::Ord trait")
Trait for types that form a [total order](https://en.wikipedia.org/wiki/Total_order).
[PartialEq](trait.partialeq "std::cmp::PartialEq trait")
Trait for equality comparisons which are [partial equivalence relations](https://en.wikipedia.org/wiki/Partial_equivalence_relation).
[PartialOrd](trait.partialord "std::cmp::PartialOrd trait")
Trait for types that form a [partial order](https://en.wikipedia.org/wiki/Partial_order).
Functions
---------
[max](fn.max "std::cmp::max fn")
Compares and returns the maximum of two values.
[max\_by](fn.max_by "std::cmp::max_by fn")
Returns the maximum of two values with respect to the specified comparison function.
[max\_by\_key](fn.max_by_key "std::cmp::max_by_key fn")
Returns the element that gives the maximum value from the specified function.
[min](fn.min "std::cmp::min fn")
Compares and returns the minimum of two values.
[min\_by](fn.min_by "std::cmp::min_by fn")
Returns the minimum of two values with respect to the specified comparison function.
[min\_by\_key](fn.min_by_key "std::cmp::min_by_key fn")
Returns the element that gives the minimum value from the specified function.
rust Function std::cmp::max_by Function std::cmp::max\_by
==========================
```
pub fn max_by<T, F>(v1: T, v2: T, compare: F) -> Twhere F: FnOnce(&T, &T) -> Ordering,
```
Returns the maximum of two values with respect to the specified comparison function.
Returns the second argument if the comparison determines them to be equal.
Examples
--------
```
use std::cmp;
assert_eq!(cmp::max_by(-2, 1, |x: &i32, y: &i32| x.abs().cmp(&y.abs())), -2);
assert_eq!(cmp::max_by(-2, 2, |x: &i32, y: &i32| x.abs().cmp(&y.abs())), 2);
```
rust Trait std::cmp::Ord Trait std::cmp::Ord
===================
```
pub trait Ord: Eq + PartialOrd<Self> {
fn cmp(&self, other: &Self) -> Ordering;
fn max(self, other: Self) -> Self { ... }
fn min(self, other: Self) -> Self { ... }
fn clamp(self, min: Self, max: Self) -> Self where Self: PartialOrd<Self>,
{ ... }
}
```
Trait for types that form a [total order](https://en.wikipedia.org/wiki/Total_order).
Implementations must be consistent with the [`PartialOrd`](trait.partialord "PartialOrd") implementation, and ensure `max`, `min`, and `clamp` are consistent with `cmp`:
* `partial_cmp(a, b) == Some(cmp(a, b))`.
* `max(a, b) == max_by(a, b, cmp)` (ensured by the default implementation).
* `min(a, b) == min_by(a, b, cmp)` (ensured by the default implementation).
* For `a.clamp(min, max)`, see the [method docs](#method.clamp) (ensured by the default implementation).
It’s easy to accidentally make `cmp` and `partial_cmp` disagree by deriving some of the traits and manually implementing others.
### Corollaries
From the above and the requirements of `PartialOrd`, it follows that `<` defines a strict total order. This means that for all `a`, `b` and `c`:
* exactly one of `a < b`, `a == b` or `a > b` is true; and
* `<` is transitive: `a < b` and `b < c` implies `a < c`. The same must hold for both `==` and `>`.
### Derivable
This trait can be used with `#[derive]`.
When `derive`d on structs, it will produce a [lexicographic](https://en.wikipedia.org/wiki/Lexicographic_order) ordering based on the top-to-bottom declaration order of the struct’s members.
When `derive`d on enums, variants are ordered by their discriminants. By default, the discriminant is smallest for variants at the top, and largest for variants at the bottom. Here’s an example:
```
#[derive(PartialEq, Eq, PartialOrd, Ord)]
enum E {
Top,
Bottom,
}
assert!(E::Top < E::Bottom);
```
However, manually setting the discriminants can override this default behavior:
```
#[derive(PartialEq, Eq, PartialOrd, Ord)]
enum E {
Top = 2,
Bottom = 1,
}
assert!(E::Bottom < E::Top);
```
### Lexicographical comparison
Lexicographical comparison is an operation with the following properties:
* Two sequences are compared element by element.
* The first mismatching element defines which sequence is lexicographically less or greater than the other.
* If one sequence is a prefix of another, the shorter sequence is lexicographically less than the other.
* If two sequence have equivalent elements and are of the same length, then the sequences are lexicographically equal.
* An empty sequence is lexicographically less than any non-empty sequence.
* Two empty sequences are lexicographically equal.
### How can I implement `Ord`?
`Ord` requires that the type also be [`PartialOrd`](trait.partialord "PartialOrd") and [`Eq`](trait.eq "Eq") (which requires [`PartialEq`](trait.partialeq "PartialEq")).
Then you must define an implementation for [`cmp`](trait.ord#tymethod.cmp). You may find it useful to use [`cmp`](trait.ord#tymethod.cmp) on your type’s fields.
Here’s an example where you want to sort people by height only, disregarding `id` and `name`:
```
use std::cmp::Ordering;
#[derive(Eq)]
struct Person {
id: u32,
name: String,
height: u32,
}
impl Ord for Person {
fn cmp(&self, other: &Self) -> Ordering {
self.height.cmp(&other.height)
}
}
impl PartialOrd for Person {
fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
Some(self.cmp(other))
}
}
impl PartialEq for Person {
fn eq(&self, other: &Self) -> bool {
self.height == other.height
}
}
```
Required Methods
----------------
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#789)#### fn cmp(&self, other: &Self) -> Ordering
This method returns an [`Ordering`](enum.ordering "Ordering") between `self` and `other`.
By convention, `self.cmp(&other)` returns the ordering matching the expression `self <operator> other` if true.
##### Examples
```
use std::cmp::Ordering;
assert_eq!(5.cmp(&10), Ordering::Less);
assert_eq!(10.cmp(&5), Ordering::Greater);
assert_eq!(5.cmp(&5), Ordering::Equal);
```
Provided Methods
----------------
[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.
Returns the second argument if the comparison determines them to be equal.
##### Examples
```
assert_eq!(2, 1.max(2));
assert_eq!(2, 2.max(2));
```
[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.
Returns the first argument if the comparison determines them to be equal.
##### Examples
```
assert_eq!(1, 1.min(2));
assert_eq!(2, 2.min(2));
```
[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](trait.partialord "trait std::cmp::PartialOrd")<Self>,
Restrict a value to a certain interval.
Returns `max` if `self` is greater than `max`, and `min` if `self` is less than `min`. Otherwise this returns `self`.
##### Panics
Panics if `min > max`.
##### Examples
```
assert!((-3).clamp(-2, 1) == -2);
assert!(0.clamp(-2, 1) == 0);
assert!(2.clamp(-2, 1) == 1);
```
Implementors
------------
[source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#747)1.34.0 · ### impl Ord for Infallible
[source](https://doc.rust-lang.org/src/std/io/error.rs.html#166)### impl Ord for ErrorKind
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#34)1.7.0 · ### impl Ord for IpAddr
[source](https://doc.rust-lang.org/src/std/net/socket_addr.rs.html#42)### impl Ord for SocketAddr
[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/cmp.rs.html#902)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · ### impl Ord for Ordering
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1470)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · ### impl Ord for bool
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1486)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · ### impl Ord for char
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1486)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · ### impl Ord for i8
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1486)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · ### impl Ord for i16
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1486)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · ### impl Ord for i32
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1486)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · ### impl Ord for i64
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1486)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · ### impl Ord for i128
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1486)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · ### impl Ord for isize
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1509)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · ### impl Ord for !
[source](https://doc.rust-lang.org/src/core/str/traits.rs.html#18)### impl Ord for str
Implements ordering of strings.
Strings are ordered [lexicographically](trait.ord#lexicographical-comparison) by their byte values. This orders Unicode code points based on their positions in the code charts. This is not necessarily the same as “alphabetical” order, which varies by language and locale. Sorting strings according to culturally-accepted standards requires locale-specific data that is outside the scope of the `str` type.
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1486)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · ### impl Ord for u8
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1486)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · ### impl Ord for u16
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1486)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · ### impl Ord for u32
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1486)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · ### impl Ord for u64
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1486)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · ### impl Ord for u128
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1461)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · ### impl Ord for ()
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1486)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · ### impl Ord 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 Ord for CpuidResult
[source](https://doc.rust-lang.org/src/core/any.rs.html#665)### impl Ord for TypeId
[source](https://doc.rust-lang.org/src/core/ffi/c_str.rs.html#575)### impl Ord for CStr
[source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#109)1.64.0 · ### impl Ord for CString
[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#632-637)### impl Ord for OsString
[source](https://doc.rust-lang.org/src/core/fmt/mod.rs.html#98)### impl Ord for Error
[source](https://doc.rust-lang.org/src/core/marker.rs.html#776)1.33.0 · ### impl Ord for PhantomPinned
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#1071-1076)### impl Ord for Ipv4Addr
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#1918-1923)### impl Ord for Ipv6Addr
[source](https://doc.rust-lang.org/src/std/net/socket_addr.rs.html#693-697)1.45.0 · ### impl Ord for SocketAddrV4
[source](https://doc.rust-lang.org/src/std/net/socket_addr.rs.html#700-704)1.45.0 · ### impl Ord for SocketAddrV6
[source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.34.0 · ### impl Ord for NonZeroI8
[source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.34.0 · ### impl Ord for NonZeroI16
[source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.34.0 · ### impl Ord for NonZeroI32
[source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.34.0 · ### impl Ord for NonZeroI64
[source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.34.0 · ### impl Ord for NonZeroI128
[source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.34.0 · ### impl Ord for NonZeroIsize
[source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.28.0 · ### impl Ord for NonZeroU8
[source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.28.0 · ### impl Ord for NonZeroU16
[source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.28.0 · ### impl Ord for NonZeroU32
[source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.28.0 · ### impl Ord for NonZeroU64
[source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.28.0 · ### impl Ord for NonZeroU128
[source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.28.0 · ### impl Ord for NonZeroUsize
[source](https://doc.rust-lang.org/src/std/path.rs.html#1029-1034)### impl Ord for Components<'\_>
[source](https://doc.rust-lang.org/src/std/path.rs.html#2993-2998)### impl Ord for Path
[source](https://doc.rust-lang.org/src/std/path.rs.html#1872-1877)### impl Ord for PathBuf
[source](https://doc.rust-lang.org/src/std/path.rs.html#469-474)### impl Ord for PrefixComponent<'\_>
[source](https://doc.rust-lang.org/src/alloc/string.rs.html#365)### impl Ord for String
[source](https://doc.rust-lang.org/src/core/time.rs.html#70)1.3.0 · ### impl Ord for Duration
[source](https://doc.rust-lang.org/src/std/time.rs.html#152)1.8.0 · ### impl Ord for Instant
[source](https://doc.rust-lang.org/src/std/time.rs.html#237)1.8.0 · ### impl Ord for SystemTime
[source](https://doc.rust-lang.org/src/std/path.rs.html#505)### impl<'a> Ord for Component<'a>
[source](https://doc.rust-lang.org/src/std/path.rs.html#141)### impl<'a> Ord for Prefix<'a>
[source](https://doc.rust-lang.org/src/core/panic/location.rs.html#31)1.10.0 · ### impl<'a> Ord for Location<'a>
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1559)### impl<A> Ord for &Awhere A: [Ord](trait.ord "trait std::cmp::Ord") + ?[Sized](../marker/trait.sized "trait std::marker::Sized"),
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1614)### impl<A> Ord for &mut Awhere A: [Ord](trait.ord "trait std::cmp::Ord") + ?[Sized](../marker/trait.sized "trait std::marker::Sized"),
[source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#351)### impl<B> Ord for Cow<'\_, B>where B: [Ord](trait.ord "trait std::cmp::Ord") + [ToOwned](../borrow/trait.toowned "trait std::borrow::ToOwned") + ?[Sized](../marker/trait.sized "trait std::marker::Sized"),
[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/alloc/collections/btree/map.rs.html#2190)### impl<K, V, A> Ord for BTreeMap<K, V, A>where K: [Ord](trait.ord "trait std::cmp::Ord"), V: [Ord](trait.ord "trait std::cmp::Ord"), A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator") + [Clone](../clone/trait.clone "trait std::clone::Clone"),
[source](https://doc.rust-lang.org/src/core/pin.rs.html#469)1.41.0 · ### impl<P> Ord for Pin<P>where P: [Deref](../ops/trait.deref "trait std::ops::Deref"), <P as [Deref](../ops/trait.deref "trait std::ops::Deref")>::[Target](../ops/trait.deref#associatedtype.Target "type std::ops::Deref::Target"): [Ord](trait.ord "trait std::cmp::Ord"),
[source](https://doc.rust-lang.org/src/core/ptr/mod.rs.html#1949)1.4.0 · ### impl<Ret, T> Ord for fn (T₁, T₂, …, Tₙ) -> Ret
This trait is implemented for function pointers with up to twelve arguments.
[source](https://doc.rust-lang.org/src/core/ptr/mod.rs.html#1949)1.4.0 · ### impl<Ret, T> Ord for extern "C" fn (T₁, T₂, …, Tₙ) -> Ret
This trait is implemented for function pointers with up to twelve arguments.
[source](https://doc.rust-lang.org/src/core/ptr/mod.rs.html#1949)1.4.0 · ### impl<Ret, T> Ord for extern "C" fn (T₁, T₂, …, Tₙ, ...) -> Ret
This trait is implemented for function pointers with up to twelve arguments.
[source](https://doc.rust-lang.org/src/core/ptr/mod.rs.html#1949)1.4.0 · ### impl<Ret, T> Ord for unsafe fn (T₁, T₂, …, Tₙ) -> Ret
This trait is implemented for function pointers with up to twelve arguments.
[source](https://doc.rust-lang.org/src/core/ptr/mod.rs.html#1949)1.4.0 · ### impl<Ret, T> Ord for unsafe extern "C" fn (T₁, T₂, …, Tₙ) -> Ret
This trait is implemented for function pointers with up to twelve arguments.
[source](https://doc.rust-lang.org/src/core/ptr/mod.rs.html#1949)1.4.0 · ### impl<Ret, T> Ord for unsafe extern "C" fn (T₁, T₂, …, Tₙ, ...) -> Ret
This trait is implemented for function pointers with up to twelve arguments.
[source](https://doc.rust-lang.org/src/core/option.rs.html#515)### impl<T> Ord for Option<T>where T: [Ord](trait.ord "trait std::cmp::Ord"),
[source](https://doc.rust-lang.org/src/core/task/poll.rs.html#11)1.36.0 · ### impl<T> Ord for Poll<T>where T: [Ord](trait.ord "trait std::cmp::Ord"),
[source](https://doc.rust-lang.org/src/core/ptr/const_ptr.rs.html#1503)### impl<T> Ord for \*const Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"),
[source](https://doc.rust-lang.org/src/core/ptr/mut_ptr.rs.html#1944)### impl<T> Ord for \*mut Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"),
[source](https://doc.rust-lang.org/src/core/slice/cmp.rs.html#39)### impl<T> Ord for [T]where T: [Ord](trait.ord "trait std::cmp::Ord"),
Implements comparison of vectors [lexicographically](trait.ord#lexicographical-comparison).
[source](https://doc.rust-lang.org/src/core/tuple.rs.html#159)### impl<T> Ord for (T₁, T₂, …, Tₙ)where T: [Ord](trait.ord "trait std::cmp::Ord") + ?[Sized](../marker/trait.sized "trait std::marker::Sized"),
This trait is implemented for tuples up to twelve items long.
[source](https://doc.rust-lang.org/src/core/cell.rs.html#316)1.10.0 · ### impl<T> Ord for Cell<T>where T: [Ord](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#1245)1.10.0 · ### impl<T> Ord for RefCell<T>where T: [Ord](trait.ord "trait std::cmp::Ord") + ?[Sized](../marker/trait.sized "trait std::marker::Sized"),
[source](https://doc.rust-lang.org/src/alloc/collections/linked_list.rs.html#1910)### impl<T> Ord for LinkedList<T>where T: [Ord](trait.ord "trait std::cmp::Ord"),
[source](https://doc.rust-lang.org/src/core/marker.rs.html#680)### impl<T> Ord 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> Ord for ManuallyDrop<T>where T: [Ord](trait.ord "trait std::cmp::Ord") + ?[Sized](../marker/trait.sized "trait std::marker::Sized"),
[source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#36)### impl<T> Ord for Saturating<T>where T: [Ord](trait.ord "trait std::cmp::Ord"),
[source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#40)### impl<T> Ord for Wrapping<T>where T: [Ord](trait.ord "trait std::cmp::Ord"),
[source](https://doc.rust-lang.org/src/core/ptr/non_null.rs.html#743)1.25.0 · ### impl<T> Ord for NonNull<T>where T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"),
[source](https://doc.rust-lang.org/src/alloc/rc.rs.html#1808)### impl<T> Ord for Rc<T>where T: [Ord](trait.ord "trait std::cmp::Ord") + ?[Sized](../marker/trait.sized "trait std::marker::Sized"),
[source](https://doc.rust-lang.org/src/alloc/sync.rs.html#2392)### impl<T> Ord for Arc<T>where T: [Ord](trait.ord "trait std::cmp::Ord") + ?[Sized](../marker/trait.sized "trait std::marker::Sized"),
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#638)1.19.0 · ### impl<T> Ord for Reverse<T>where T: [Ord](trait.ord "trait std::cmp::Ord"),
[source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#1371)### impl<T, A> Ord for Box<T, A>where T: [Ord](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/collections/btree/set.rs.html#113)### impl<T, A> Ord for BTreeSet<T, A>where T: [Ord](trait.ord "trait std::cmp::Ord"), 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/vec_deque/mod.rs.html#2906)### impl<T, A> Ord for VecDeque<T, A>where T: [Ord](trait.ord "trait std::cmp::Ord"), A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"),
[source](https://doc.rust-lang.org/src/alloc/vec/mod.rs.html#2907)### impl<T, A> Ord for Vec<T, A>where T: [Ord](trait.ord "trait std::cmp::Ord"), A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"),
Implements ordering of vectors, [lexicographically](trait.ord#lexicographical-comparison).
[source](https://doc.rust-lang.org/src/core/result.rs.html#500)### impl<T, E> Ord for Result<T, E>where T: [Ord](trait.ord "trait std::cmp::Ord"), E: [Ord](trait.ord "trait std::cmp::Ord"),
[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](../simd/trait.simdelement "trait std::simd::SimdElement") + [Ord](trait.ord "trait std::cmp::Ord"), [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#339)### impl<T, const N: usize> Ord for [T; N]where T: [Ord](trait.ord "trait std::cmp::Ord"),
Implements comparison of arrays [lexicographically](trait.ord#lexicographical-comparison).
[source](https://doc.rust-lang.org/src/core/ops/generator.rs.html#9)### impl<Y, R> Ord for GeneratorState<Y, R>where Y: [Ord](trait.ord "trait std::cmp::Ord"), R: [Ord](trait.ord "trait std::cmp::Ord"),
| programming_docs |
rust Function std::cmp::max_by_key Function std::cmp::max\_by\_key
===============================
```
pub fn max_by_key<T, F, K>(v1: T, v2: T, f: F) -> Twhere F: FnMut(&T) -> K, K: Ord,
```
Returns the element that gives the maximum value from the specified function.
Returns the second argument if the comparison determines them to be equal.
Examples
--------
```
use std::cmp;
assert_eq!(cmp::max_by_key(-2, 1, |x: &i32| x.abs()), -2);
assert_eq!(cmp::max_by_key(-2, 2, |x: &i32| x.abs()), 2);
```
rust Trait std::cmp::Eq Trait std::cmp::Eq
==================
```
pub trait Eq: PartialEq<Self> { }
```
Trait for equality comparisons which are [equivalence relations](https://en.wikipedia.org/wiki/Equivalence_relation).
This means, that in addition to `a == b` and `a != b` being strict inverses, the equality must be (for all `a`, `b` and `c`):
* reflexive: `a == a`;
* symmetric: `a == b` implies `b == a`; and
* transitive: `a == b` and `b == c` implies `a == c`.
This property cannot be checked by the compiler, and therefore `Eq` implies [`PartialEq`](trait.partialeq "PartialEq"), and has no extra methods.
### Derivable
This trait can be used with `#[derive]`. When `derive`d, because `Eq` has no extra methods, it is only informing the compiler that this is an equivalence relation rather than a partial equivalence relation. Note that the `derive` strategy requires all fields are `Eq`, which isn’t always desired.
### How can I implement `Eq`?
If you cannot use the `derive` strategy, specify that your type implements `Eq`, which has no methods:
```
enum BookFormat { Paperback, Hardback, Ebook }
struct Book {
isbn: i32,
format: BookFormat,
}
impl PartialEq for Book {
fn eq(&self, other: &Self) -> bool {
self.isbn == other.isbn
}
}
impl Eq for Book {}
```
Implementors
------------
[source](https://doc.rust-lang.org/src/std/backtrace.rs.html#117)1.65.0 · ### impl Eq for BacktraceStatus
[source](https://doc.rust-lang.org/src/alloc/collections/mod.rs.html#80)### impl Eq for TryReserveErrorKind
[source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#737)1.34.0 · ### impl Eq for Infallible
[source](https://doc.rust-lang.org/src/std/env.rs.html#280)### impl Eq for VarError
[source](https://doc.rust-lang.org/src/core/fmt/mod.rs.html#25)1.28.0 · ### impl Eq for Alignment
[source](https://doc.rust-lang.org/src/std/io/error.rs.html#166)### impl Eq for ErrorKind
[source](https://doc.rust-lang.org/src/std/io/mod.rs.html#1881)### impl Eq for SeekFrom
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#34)1.7.0 · ### impl Eq for IpAddr
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#200)### impl Eq for Ipv6MulticastScope
[source](https://doc.rust-lang.org/src/std/net/mod.rs.html#49)### impl Eq for Shutdown
[source](https://doc.rust-lang.org/src/std/net/socket_addr.rs.html#42)### impl Eq for SocketAddr
[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/error.rs.html#87)1.55.0 · ### impl Eq for IntErrorKind
[source](https://doc.rust-lang.org/src/std/panic.rs.html#208)### impl Eq for BacktraceStyle
[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/str/pattern.rs.html#167)### impl Eq for SearchStep
[source](https://doc.rust-lang.org/src/core/sync/atomic.rs.html#212)### impl Eq for std::sync::atomic::Ordering
[source](https://doc.rust-lang.org/src/std/sync/mpsc/mod.rs.html#611)1.12.0 · ### impl Eq for RecvTimeoutError
[source](https://doc.rust-lang.org/src/std/sync/mpsc/mod.rs.html#592)### impl Eq for TryRecvError
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#342)### impl Eq for std::cmp::Ordering
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1377)### impl Eq for bool
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1377)### impl Eq for char
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1377)### impl Eq for i8
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1377)### impl Eq for i16
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1377)### impl Eq for i32
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1377)### impl Eq for i64
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1377)### impl Eq for i128
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1377)### impl Eq for isize
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1497)### impl Eq for !
[source](https://doc.rust-lang.org/src/core/str/traits.rs.html#38)### impl Eq for str
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1377)### impl Eq for u8
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1377)### impl Eq for u16
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1377)### impl Eq for u32
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1377)### impl Eq for u64
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1377)### impl Eq for u128
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1377)### impl Eq for ()
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1377)### impl Eq 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 Eq for CpuidResult
[source](https://doc.rust-lang.org/src/core/ffi/c_str.rs.html#149)### impl Eq for FromBytesUntilNulError
[source](https://doc.rust-lang.org/src/core/alloc/mod.rs.html#34)### impl Eq for AllocError
[source](https://doc.rust-lang.org/src/core/alloc/layout.rs.html#37)1.28.0 · ### impl Eq for Layout
[source](https://doc.rust-lang.org/src/core/alloc/layout.rs.html#463)1.50.0 · ### impl Eq for LayoutError
[source](https://doc.rust-lang.org/src/core/any.rs.html#665)### impl Eq for TypeId
[source](https://doc.rust-lang.org/src/core/char/convert.rs.html#235)1.34.0 · ### impl Eq for CharTryFromError
[source](https://doc.rust-lang.org/src/core/char/decode.rs.html#29)1.9.0 · ### impl Eq for DecodeUtf16Error
[source](https://doc.rust-lang.org/src/core/char/convert.rs.html#149)1.20.0 · ### impl Eq for ParseCharError
[source](https://doc.rust-lang.org/src/core/char/mod.rs.html#580)1.59.0 · ### impl Eq for TryFromCharError
[source](https://doc.rust-lang.org/src/alloc/collections/mod.rs.html#59)1.57.0 · ### impl Eq for TryReserveError
[source](https://doc.rust-lang.org/src/core/ffi/c_str.rs.html#567)### impl Eq for CStr
[source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#109)1.64.0 · ### impl Eq for CString
[source](https://doc.rust-lang.org/src/core/ffi/c_str.rs.html#110)1.64.0 · ### impl Eq for FromBytesWithNulError
[source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#159)1.64.0 · ### impl Eq for FromVecWithNulError
[source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#225)1.64.0 · ### impl Eq for IntoStringError
[source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#134)1.64.0 · ### impl Eq for NulError
[source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#1156)### impl Eq for OsStr
[source](https://doc.rust-lang.org/src/std/ffi/os_str.rs.html#597)### impl Eq for OsString
[source](https://doc.rust-lang.org/src/core/fmt/mod.rs.html#98)### impl Eq for Error
[source](https://doc.rust-lang.org/src/std/fs.rs.html#207)1.1.0 · ### impl Eq for FileType
[source](https://doc.rust-lang.org/src/std/fs.rs.html#200)### impl Eq for Permissions
[source](https://doc.rust-lang.org/src/core/marker.rs.html#776)1.33.0 · ### impl Eq for PhantomPinned
[source](https://doc.rust-lang.org/src/core/mem/transmutability.rs.html#21)### impl Eq for Assume
[source](https://doc.rust-lang.org/src/std/net/parser.rs.html#476)### impl Eq for AddrParseError
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#75)### impl Eq for Ipv4Addr
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#158)### impl Eq for Ipv6Addr
[source](https://doc.rust-lang.org/src/std/net/socket_addr.rs.html#78)### impl Eq for SocketAddrV4
[source](https://doc.rust-lang.org/src/std/net/socket_addr.rs.html#111)### impl Eq for SocketAddrV6
[source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.34.0 · ### impl Eq for NonZeroI8
[source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.34.0 · ### impl Eq for NonZeroI16
[source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.34.0 · ### impl Eq for NonZeroI32
[source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.34.0 · ### impl Eq for NonZeroI64
[source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.34.0 · ### impl Eq for NonZeroI128
[source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.34.0 · ### impl Eq for NonZeroIsize
[source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.28.0 · ### impl Eq for NonZeroU8
[source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.28.0 · ### impl Eq for NonZeroU16
[source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.28.0 · ### impl Eq for NonZeroU32
[source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.28.0 · ### impl Eq for NonZeroU64
[source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.28.0 · ### impl Eq for NonZeroU128
[source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.28.0 · ### impl Eq for NonZeroUsize
[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/error.rs.html#69)### impl Eq for ParseIntError
[source](https://doc.rust-lang.org/src/core/num/error.rs.html#10)1.34.0 · ### impl Eq for TryFromIntError
[source](https://doc.rust-lang.org/src/core/ops/range.rs.html#41)### impl Eq for RangeFull
[source](https://doc.rust-lang.org/src/std/os/unix/ucred.rs.html#13)### impl Eq 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 Eq 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 Eq for NullHandleError
Available on **Windows** only.[source](https://doc.rust-lang.org/src/std/path.rs.html#1018)### impl Eq for Components<'\_>
[source](https://doc.rust-lang.org/src/std/path.rs.html#2982)### impl Eq for Path
[source](https://doc.rust-lang.org/src/std/path.rs.html#1861)### impl Eq for PathBuf
[source](https://doc.rust-lang.org/src/std/path.rs.html#1937)1.7.0 · ### impl Eq for StripPrefixError
[source](https://doc.rust-lang.org/src/std/process.rs.html#1452)### impl Eq for ExitStatus
[source](https://doc.rust-lang.org/src/std/process.rs.html#1585)### impl Eq for ExitStatusError
[source](https://doc.rust-lang.org/src/std/process.rs.html#1096)### impl Eq for Output
[source](https://doc.rust-lang.org/src/core/str/error.rs.html#139)### impl Eq for ParseBoolError
[source](https://doc.rust-lang.org/src/core/str/error.rs.html#46)### impl Eq for Utf8Error
[source](https://doc.rust-lang.org/src/alloc/string.rs.html#407)### impl Eq for FromUtf8Error
[source](https://doc.rust-lang.org/src/alloc/string.rs.html#365)### impl Eq for String
[source](https://doc.rust-lang.org/src/std/sync/mpsc/mod.rs.html#583)### impl Eq for RecvError
[source](https://doc.rust-lang.org/src/std/sync/condvar.rs.html#15)1.5.0 · ### impl Eq for WaitTimeoutResult
[source](https://doc.rust-lang.org/src/std/thread/local.rs.html#372)1.26.0 · ### impl Eq for AccessError
[source](https://doc.rust-lang.org/src/std/thread/mod.rs.html#1039)1.19.0 · ### impl Eq for ThreadId
[source](https://doc.rust-lang.org/src/core/time.rs.html#70)1.3.0 · ### impl Eq for Duration
[source](https://doc.rust-lang.org/src/core/time.rs.html#1210)### impl Eq for FromFloatSecsError
[source](https://doc.rust-lang.org/src/std/time.rs.html#152)1.8.0 · ### impl Eq for Instant
[source](https://doc.rust-lang.org/src/std/time.rs.html#237)1.8.0 · ### impl Eq for SystemTime
[source](https://doc.rust-lang.org/src/std/path.rs.html#505)### impl<'a> Eq for Component<'a>
[source](https://doc.rust-lang.org/src/std/path.rs.html#141)### impl<'a> Eq for Prefix<'a>
[source](https://doc.rust-lang.org/src/core/panic/location.rs.html#31)1.10.0 · ### impl<'a> Eq for Location<'a>
[source](https://doc.rust-lang.org/src/std/path.rs.html#422)### impl<'a> Eq for PrefixComponent<'a>
[source](https://doc.rust-lang.org/src/core/str/lossy.rs.html#34)### impl<'a> Eq for Utf8Chunk<'a>
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1569)### impl<A> Eq for &Awhere A: [Eq](trait.eq "trait std::cmp::Eq") + ?[Sized](../marker/trait.sized "trait std::marker::Sized"),
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1624)### impl<A> Eq for &mut Awhere A: [Eq](trait.eq "trait std::cmp::Eq") + ?[Sized](../marker/trait.sized "trait std::marker::Sized"),
[source](https://doc.rust-lang.org/src/alloc/borrow.rs.html#348)### impl<B> Eq for Cow<'\_, B>where B: [Eq](trait.eq "trait std::cmp::Eq") + [ToOwned](../borrow/trait.toowned "trait std::borrow::ToOwned") + ?[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/hash/mod.rs.html#798)1.29.0 · ### impl<H> Eq for BuildHasherDefault<H>
[source](https://doc.rust-lang.org/src/core/ops/range.rs.html#78)### impl<Idx> Eq for Range<Idx>where Idx: [Eq](trait.eq "trait std::cmp::Eq"),
[source](https://doc.rust-lang.org/src/core/ops/range.rs.html#185)### impl<Idx> Eq for RangeFrom<Idx>where Idx: [Eq](trait.eq "trait std::cmp::Eq"),
[source](https://doc.rust-lang.org/src/core/ops/range.rs.html#339)1.26.0 · ### impl<Idx> Eq for RangeInclusive<Idx>where Idx: [Eq](trait.eq "trait std::cmp::Eq"),
[source](https://doc.rust-lang.org/src/core/ops/range.rs.html#266)### impl<Idx> Eq for RangeTo<Idx>where Idx: [Eq](trait.eq "trait std::cmp::Eq"),
[source](https://doc.rust-lang.org/src/core/ops/range.rs.html#584)1.26.0 · ### impl<Idx> Eq for RangeToInclusive<Idx>where Idx: [Eq](trait.eq "trait std::cmp::Eq"),
[source](https://doc.rust-lang.org/src/alloc/collections/btree/map.rs.html#2179)### impl<K, V, A> Eq for BTreeMap<K, V, A>where K: [Eq](trait.eq "trait std::cmp::Eq"), V: [Eq](trait.eq "trait std::cmp::Eq"), A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator") + [Clone](../clone/trait.clone "trait std::clone::Clone"),
[source](https://doc.rust-lang.org/src/std/collections/hash/map.rs.html#1293-1299)### impl<K, V, S> Eq for HashMap<K, V, S>where K: [Eq](trait.eq "trait std::cmp::Eq") + [Hash](../hash/trait.hash "trait std::hash::Hash"), V: [Eq](trait.eq "trait std::cmp::Eq"), S: [BuildHasher](../hash/trait.buildhasher "trait std::hash::BuildHasher"),
[source](https://doc.rust-lang.org/src/core/pin.rs.html#440)1.41.0 · ### impl<P> Eq for Pin<P>where P: [Deref](../ops/trait.deref "trait std::ops::Deref"), <P as [Deref](../ops/trait.deref "trait std::ops::Deref")>::[Target](../ops/trait.deref#associatedtype.Target "type std::ops::Deref::Target"): [Eq](trait.eq "trait std::cmp::Eq"),
[source](https://doc.rust-lang.org/src/core/ptr/mod.rs.html#1949)1.4.0 · ### impl<Ret, T> Eq for fn (T₁, T₂, …, Tₙ) -> Ret
This trait is implemented for function pointers with up to twelve arguments.
[source](https://doc.rust-lang.org/src/core/ptr/mod.rs.html#1949)1.4.0 · ### impl<Ret, T> Eq for extern "C" fn (T₁, T₂, …, Tₙ) -> Ret
This trait is implemented for function pointers with up to twelve arguments.
[source](https://doc.rust-lang.org/src/core/ptr/mod.rs.html#1949)1.4.0 · ### impl<Ret, T> Eq for extern "C" fn (T₁, T₂, …, Tₙ, ...) -> Ret
This trait is implemented for function pointers with up to twelve arguments.
[source](https://doc.rust-lang.org/src/core/ptr/mod.rs.html#1949)1.4.0 · ### impl<Ret, T> Eq for unsafe fn (T₁, T₂, …, Tₙ) -> Ret
This trait is implemented for function pointers with up to twelve arguments.
[source](https://doc.rust-lang.org/src/core/ptr/mod.rs.html#1949)1.4.0 · ### impl<Ret, T> Eq for unsafe extern "C" fn (T₁, T₂, …, Tₙ) -> Ret
This trait is implemented for function pointers with up to twelve arguments.
[source](https://doc.rust-lang.org/src/core/ptr/mod.rs.html#1949)1.4.0 · ### impl<Ret, T> Eq for unsafe extern "C" fn (T₁, T₂, …, Tₙ, ...) -> Ret
This trait is implemented for function pointers with up to twelve arguments.
[source](https://doc.rust-lang.org/src/core/ops/range.rs.html#664)1.17.0 · ### impl<T> Eq for Bound<T>where T: [Eq](trait.eq "trait std::cmp::Eq"),
[source](https://doc.rust-lang.org/src/core/option.rs.html#515)### impl<T> Eq for Option<T>where T: [Eq](trait.eq "trait std::cmp::Eq"),
[source](https://doc.rust-lang.org/src/core/task/poll.rs.html#11)1.36.0 · ### impl<T> Eq for Poll<T>where T: [Eq](trait.eq "trait std::cmp::Eq"),
[source](https://doc.rust-lang.org/src/core/ptr/const_ptr.rs.html#1499)### impl<T> Eq for \*const Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"),
[source](https://doc.rust-lang.org/src/core/ptr/mut_ptr.rs.html#1941)### impl<T> Eq for \*mut Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"),
[source](https://doc.rust-lang.org/src/core/slice/cmp.rs.html#35)### impl<T> Eq for [T]where T: [Eq](trait.eq "trait std::cmp::Eq"),
[source](https://doc.rust-lang.org/src/core/tuple.rs.html#159)### impl<T> Eq for (T₁, T₂, …, Tₙ)where T: [Eq](trait.eq "trait std::cmp::Eq") + ?[Sized](../marker/trait.sized "trait std::marker::Sized"),
This trait is implemented for tuples up to twelve items long.
[source](https://doc.rust-lang.org/src/core/cell.rs.html#285)1.2.0 · ### impl<T> Eq for Cell<T>where T: [Eq](trait.eq "trait std::cmp::Eq") + [Copy](../marker/trait.copy "trait std::marker::Copy"),
[source](https://doc.rust-lang.org/src/core/cell/once.rs.html#275)### impl<T> Eq for OnceCell<T>where T: [Eq](trait.eq "trait std::cmp::Eq"),
[source](https://doc.rust-lang.org/src/core/cell.rs.html#1199)1.2.0 · ### impl<T> Eq for RefCell<T>where T: [Eq](trait.eq "trait std::cmp::Eq") + ?[Sized](../marker/trait.sized "trait std::marker::Sized"),
[source](https://doc.rust-lang.org/src/alloc/collections/linked_list.rs.html#1900)### impl<T> Eq for LinkedList<T>where T: [Eq](trait.eq "trait std::cmp::Eq"),
[source](https://doc.rust-lang.org/src/core/marker.rs.html#680)### impl<T> Eq 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#1098)1.21.0 · ### impl<T> Eq for Discriminant<T>
[source](https://doc.rust-lang.org/src/core/mem/manually_drop.rs.html#48)1.20.0 · ### impl<T> Eq for ManuallyDrop<T>where T: [Eq](trait.eq "trait std::cmp::Eq") + ?[Sized](../marker/trait.sized "trait std::marker::Sized"),
[source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#36)### impl<T> Eq for Saturating<T>where T: [Eq](trait.eq "trait std::cmp::Eq"),
[source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#40)### impl<T> Eq for Wrapping<T>where T: [Eq](trait.eq "trait std::cmp::Eq"),
[source](https://doc.rust-lang.org/src/core/ptr/non_null.rs.html#732)1.25.0 · ### impl<T> Eq for NonNull<T>where T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"),
[source](https://doc.rust-lang.org/src/alloc/rc.rs.html#1711)### impl<T> Eq for Rc<T>where T: [Eq](trait.eq "trait std::cmp::Eq") + ?[Sized](../marker/trait.sized "trait std::marker::Sized"),
[source](https://doc.rust-lang.org/src/alloc/sync.rs.html#2412)### impl<T> Eq for Arc<T>where T: [Eq](trait.eq "trait std::cmp::Eq") + ?[Sized](../marker/trait.sized "trait std::marker::Sized"),
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#606)1.19.0 · ### impl<T> Eq for Reverse<T>where T: [Eq](trait.eq "trait std::cmp::Eq"),
[source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#1378)### impl<T, A> Eq for Box<T, A>where T: [Eq](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/collections/btree/set.rs.html#103)### impl<T, A> Eq for BTreeSet<T, A>where T: [Eq](trait.eq "trait std::cmp::Eq"), 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/vec_deque/mod.rs.html#2889)### impl<T, A> Eq for VecDeque<T, A>where T: [Eq](trait.eq "trait std::cmp::Eq"), A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"),
[source](https://doc.rust-lang.org/src/alloc/vec/mod.rs.html#2903)### impl<T, A> Eq for Vec<T, A>where T: [Eq](trait.eq "trait std::cmp::Eq"), A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"),
[source](https://doc.rust-lang.org/src/core/result.rs.html#500)### impl<T, E> Eq for Result<T, E>where T: [Eq](trait.eq "trait std::cmp::Eq"), E: [Eq](trait.eq "trait std::cmp::Eq"),
[source](https://doc.rust-lang.org/src/std/collections/hash/set.rs.html#1004-1009)### impl<T, S> Eq for HashSet<T, S>where T: [Eq](trait.eq "trait std::cmp::Eq") + [Hash](../hash/trait.hash "trait std::hash::Hash"), S: [BuildHasher](../hash/trait.buildhasher "trait std::hash::BuildHasher"),
[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](../simd/trait.simdelement "trait std::simd::SimdElement") + [Eq](trait.eq "trait std::cmp::Eq"), [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/equality.rs.html#131)### impl<T, const N: usize> Eq for [T; N]where T: [Eq](trait.eq "trait std::cmp::Eq"),
[source](https://doc.rust-lang.org/src/std/sync/mpsc/mod.rs.html#629)### impl<T: Eq> Eq for TrySendError<T>
[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/sync/mpsc/mod.rs.html#573)### impl<T: Eq> Eq for SendError<T>
[source](https://doc.rust-lang.org/src/std/sync/once_lock.rs.html#426)### impl<T: Eq> Eq for OnceLock<T>
[source](https://doc.rust-lang.org/src/core/ops/generator.rs.html#9)### impl<Y, R> Eq for GeneratorState<Y, R>where Y: [Eq](trait.eq "trait std::cmp::Eq"), R: [Eq](trait.eq "trait std::cmp::Eq"),
| programming_docs |
rust Enum std::cmp::Ordering Enum std::cmp::Ordering
=======================
```
#[repr(i8)]
pub enum Ordering {
Less,
Equal,
Greater,
}
```
An `Ordering` is the result of a comparison between two values.
Examples
--------
```
use std::cmp::Ordering;
let result = 1.cmp(&2);
assert_eq!(Ordering::Less, result);
let result = 1.cmp(&1);
assert_eq!(Ordering::Equal, result);
let result = 2.cmp(&1);
assert_eq!(Ordering::Greater, result);
```
Variants
--------
### `Less`
An ordering where a compared value is less than another.
### `Equal`
An ordering where a compared value is equal to another.
### `Greater`
An ordering where a compared value is greater than another.
Implementations
---------------
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#357)### impl Ordering
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#373)1.53.0 (const: 1.53.0) · #### pub const fn is\_eq(self) -> bool
Returns `true` if the ordering is the `Equal` variant.
##### Examples
```
use std::cmp::Ordering;
assert_eq!(Ordering::Less.is_eq(), false);
assert_eq!(Ordering::Equal.is_eq(), true);
assert_eq!(Ordering::Greater.is_eq(), false);
```
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#392)1.53.0 (const: 1.53.0) · #### pub const fn is\_ne(self) -> bool
Returns `true` if the ordering is not the `Equal` variant.
##### Examples
```
use std::cmp::Ordering;
assert_eq!(Ordering::Less.is_ne(), true);
assert_eq!(Ordering::Equal.is_ne(), false);
assert_eq!(Ordering::Greater.is_ne(), true);
```
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#411)1.53.0 (const: 1.53.0) · #### pub const fn is\_lt(self) -> bool
Returns `true` if the ordering is the `Less` variant.
##### Examples
```
use std::cmp::Ordering;
assert_eq!(Ordering::Less.is_lt(), true);
assert_eq!(Ordering::Equal.is_lt(), false);
assert_eq!(Ordering::Greater.is_lt(), false);
```
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#430)1.53.0 (const: 1.53.0) · #### pub const fn is\_gt(self) -> bool
Returns `true` if the ordering is the `Greater` variant.
##### Examples
```
use std::cmp::Ordering;
assert_eq!(Ordering::Less.is_gt(), false);
assert_eq!(Ordering::Equal.is_gt(), false);
assert_eq!(Ordering::Greater.is_gt(), true);
```
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#449)1.53.0 (const: 1.53.0) · #### pub const fn is\_le(self) -> bool
Returns `true` if the ordering is either the `Less` or `Equal` variant.
##### Examples
```
use std::cmp::Ordering;
assert_eq!(Ordering::Less.is_le(), true);
assert_eq!(Ordering::Equal.is_le(), true);
assert_eq!(Ordering::Greater.is_le(), false);
```
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#468)1.53.0 (const: 1.53.0) · #### pub const fn is\_ge(self) -> bool
Returns `true` if the ordering is either the `Greater` or `Equal` variant.
##### Examples
```
use std::cmp::Ordering;
assert_eq!(Ordering::Less.is_ge(), false);
assert_eq!(Ordering::Equal.is_ge(), true);
assert_eq!(Ordering::Greater.is_ge(), true);
```
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#505)const: 1.48.0 · #### pub const fn reverse(self) -> Ordering
Reverses the `Ordering`.
* `Less` becomes `Greater`.
* `Greater` becomes `Less`.
* `Equal` becomes `Equal`.
##### Examples
Basic behavior:
```
use std::cmp::Ordering;
assert_eq!(Ordering::Less.reverse(), Ordering::Greater);
assert_eq!(Ordering::Equal.reverse(), Ordering::Equal);
assert_eq!(Ordering::Greater.reverse(), Ordering::Less);
```
This method can be used to reverse a comparison:
```
let data: &mut [_] = &mut [2, 10, 5, 8];
// sort the array from largest to smallest.
data.sort_by(|a, b| a.cmp(b).reverse());
let b: &mut [_] = &mut [10, 8, 5, 2];
assert!(data == b);
```
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#544)1.17.0 (const: 1.48.0) · #### pub const fn then(self, other: Ordering) -> Ordering
Chains two orderings.
Returns `self` when it’s not `Equal`. Otherwise returns `other`.
##### Examples
```
use std::cmp::Ordering;
let result = Ordering::Equal.then(Ordering::Less);
assert_eq!(result, Ordering::Less);
let result = Ordering::Less.then(Ordering::Equal);
assert_eq!(result, Ordering::Less);
let result = Ordering::Less.then(Ordering::Greater);
assert_eq!(result, Ordering::Less);
let result = Ordering::Equal.then(Ordering::Equal);
assert_eq!(result, Ordering::Equal);
let x: (i64, i64, i64) = (1, 2, 7);
let y: (i64, i64, i64) = (1, 5, 3);
let result = x.0.cmp(&y.0).then(x.1.cmp(&y.1)).then(x.2.cmp(&y.2));
assert_eq!(result, Ordering::Less);
```
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#582)1.17.0 · #### pub fn then\_with<F>(self, f: F) -> Orderingwhere F: [FnOnce](../ops/trait.fnonce "trait std::ops::FnOnce")() -> [Ordering](enum.ordering "enum std::cmp::Ordering"),
Chains the ordering with the given function.
Returns `self` when it’s not `Equal`. Otherwise calls `f` and returns the result.
##### Examples
```
use std::cmp::Ordering;
let result = Ordering::Equal.then_with(|| Ordering::Less);
assert_eq!(result, Ordering::Less);
let result = Ordering::Less.then_with(|| Ordering::Equal);
assert_eq!(result, Ordering::Less);
let result = Ordering::Less.then_with(|| Ordering::Greater);
assert_eq!(result, Ordering::Less);
let result = Ordering::Equal.then_with(|| Ordering::Equal);
assert_eq!(result, Ordering::Equal);
let x: (i64, i64, i64) = (1, 2, 7);
let y: (i64, i64, i64) = (1, 5, 3);
let result = x.0.cmp(&y.0).then_with(|| x.1.cmp(&y.1)).then_with(|| x.2.cmp(&y.2));
assert_eq!(result, Ordering::Less);
```
Trait Implementations
---------------------
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#342)### impl Clone for Ordering
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#342)#### fn clone(&self) -> Ordering
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/cmp.rs.html#342)### impl Debug for Ordering
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#342)#### 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/cmp.rs.html#342)### impl Hash for Ordering
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#342)#### 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/cmp.rs.html#902)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · ### impl Ord for Ordering
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#904)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · #### fn cmp(&self, other: &Ordering) -> Ordering
This method returns an [`Ordering`](enum.ordering "Ordering") between `self` and `other`. [Read more](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](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](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](trait.partialord "trait std::cmp::PartialOrd")<Self>,
Restrict a value to a certain interval. [Read more](trait.ord#method.clamp)
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#893)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · ### impl PartialEq<Ordering> for Ordering
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#895)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · #### fn eq(&self, other: &Ordering) -> bool
This method tests for `self` and `other` values to be equal, and is used by `==`. [Read more](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](trait.partialeq#method.ne)
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#911)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · ### impl PartialOrd<Ordering> for Ordering
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#913)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · #### fn partial\_cmp(&self, other: &Ordering) -> Option<Ordering>
This method returns an ordering between `self` and `other` values if one exists. [Read more](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](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](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](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](trait.partialord#method.ge)
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#342)### impl Copy for Ordering
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#342)### impl Eq for Ordering
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#342)### impl StructuralEq for Ordering
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#889)### impl StructuralPartialEq for Ordering
Auto Trait Implementations
--------------------------
### impl RefUnwindSafe for Ordering
### impl Send for Ordering
### impl Sync for Ordering
### impl Unpin for Ordering
### impl UnwindSafe for Ordering
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::cmp::Reverse Struct std::cmp::Reverse
========================
```
#[repr(transparent)]pub struct Reverse<T>(pub T);
```
A helper struct for reverse ordering.
This struct is a helper to be used with functions like [`Vec::sort_by_key`](../vec/struct.vec#method.sort_by_key) and can be used to reverse order a part of a key.
Examples
--------
```
use std::cmp::Reverse;
let mut v = vec![1, 2, 3, 4, 5, 6];
v.sort_by_key(|&num| (num > 3, Reverse(num)));
assert_eq!(v, vec![3, 2, 1, 6, 5, 4]);
```
Tuple Fields
------------
`0: T`Trait Implementations
---------------------
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#646)### impl<T> Clone for Reverse<T>where T: [Clone](../clone/trait.clone "trait std::clone::Clone"),
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#648)#### fn clone(&self) -> Reverse<T>
Returns a copy of the value. [Read more](../clone/trait.clone#tymethod.clone)
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#653)#### fn clone\_from(&mut self, other: &Reverse<T>)
Performs copy-assignment from `source`. [Read more](../clone/trait.clone#method.clone_from)
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#606)### impl<T> Debug for Reverse<T>where T: [Debug](../fmt/trait.debug "trait std::fmt::Debug"),
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#606)#### 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/cmp.rs.html#606)### impl<T> Default for Reverse<T>where T: [Default](../default/trait.default "trait std::default::Default"),
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#606)#### fn default() -> Reverse<T>
Returns the “default value” for a type. [Read more](../default/trait.default#tymethod.default)
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#606)### impl<T> Hash for Reverse<T>where T: [Hash](../hash/trait.hash "trait std::hash::Hash"),
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#606)#### 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/cmp.rs.html#638)### impl<T> Ord for Reverse<T>where T: [Ord](trait.ord "trait std::cmp::Ord"),
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#640)#### fn cmp(&self, other: &Reverse<T>) -> Ordering
This method returns an [`Ordering`](enum.ordering "Ordering") between `self` and `other`. [Read more](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](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](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](trait.partialord "trait std::cmp::PartialOrd")<Self>,
Restrict a value to a certain interval. [Read more](trait.ord#method.clamp)
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#606)### impl<T> PartialEq<Reverse<T>> for Reverse<T>where T: [PartialEq](trait.partialeq "trait std::cmp::PartialEq")<T>,
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#606)#### fn eq(&self, other: &Reverse<T>) -> bool
This method tests for `self` and `other` values to be equal, and is used by `==`. [Read more](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](trait.partialeq#method.ne)
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#613)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · ### impl<T> PartialOrd<Reverse<T>> for Reverse<T>where T: [PartialOrd](trait.partialord "trait std::cmp::PartialOrd")<T>,
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#615)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · #### fn partial\_cmp(&self, other: &Reverse<T>) -> Option<Ordering>
This method returns an ordering between `self` and `other` values if one exists. [Read more](trait.partialord#tymethod.partial_cmp)
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#620)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · #### fn lt(&self, other: &Reverse<T>) -> bool
This method tests less than (for `self` and `other`) and is used by the `<` operator. [Read more](trait.partialord#method.lt)
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#624)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · #### fn le(&self, other: &Reverse<T>) -> bool
This method tests less than or equal to (for `self` and `other`) and is used by the `<=` operator. [Read more](trait.partialord#method.le)
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#628)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · #### fn gt(&self, other: &Reverse<T>) -> bool
This method tests greater than (for `self` and `other`) and is used by the `>` operator. [Read more](trait.partialord#method.gt)
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#632)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · #### fn ge(&self, other: &Reverse<T>) -> bool
This method tests greater than or equal to (for `self` and `other`) and is used by the `>=` operator. [Read more](trait.partialord#method.ge)
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#606)### impl<T> Copy for Reverse<T>where T: [Copy](../marker/trait.copy "trait std::marker::Copy"),
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#606)### impl<T> Eq for Reverse<T>where T: [Eq](trait.eq "trait std::cmp::Eq"),
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#606)### impl<T> StructuralEq for Reverse<T>
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#606)### impl<T> StructuralPartialEq for Reverse<T>
Auto Trait Implementations
--------------------------
### impl<T> RefUnwindSafe for Reverse<T>where T: [RefUnwindSafe](../panic/trait.refunwindsafe "trait std::panic::RefUnwindSafe"),
### impl<T> Send for Reverse<T>where T: [Send](../marker/trait.send "trait std::marker::Send"),
### impl<T> Sync for Reverse<T>where T: [Sync](../marker/trait.sync "trait std::marker::Sync"),
### impl<T> Unpin for Reverse<T>where T: [Unpin](../marker/trait.unpin "trait std::marker::Unpin"),
### impl<T> UnwindSafe for Reverse<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::cmp::min_by Function std::cmp::min\_by
==========================
```
pub fn min_by<T, F>(v1: T, v2: T, compare: F) -> Twhere F: FnOnce(&T, &T) -> Ordering,
```
Returns the minimum of two values with respect to the specified comparison function.
Returns the first argument if the comparison determines them to be equal.
Examples
--------
```
use std::cmp;
assert_eq!(cmp::min_by(-2, 1, |x: &i32, y: &i32| x.abs().cmp(&y.abs())), 1);
assert_eq!(cmp::min_by(-2, 2, |x: &i32, y: &i32| x.abs().cmp(&y.abs())), -2);
```
rust Trait std::cmp::PartialOrd Trait std::cmp::PartialOrd
==========================
```
pub trait PartialOrd<Rhs = Self>: PartialEq<Rhs>where Rhs: ?Sized,{
fn partial_cmp(&self, other: &Rhs) -> Option<Ordering>;
fn lt(&self, other: &Rhs) -> bool { ... }
fn le(&self, other: &Rhs) -> bool { ... }
fn gt(&self, other: &Rhs) -> bool { ... }
fn ge(&self, other: &Rhs) -> bool { ... }
}
```
Trait for types that form a [partial order](https://en.wikipedia.org/wiki/Partial_order).
The `lt`, `le`, `gt`, and `ge` methods of this trait can be called using the `<`, `<=`, `>`, and `>=` operators, respectively.
The methods of this trait must be consistent with each other and with those of [`PartialEq`](trait.partialeq "PartialEq"). The following conditions must hold:
1. `a == b` if and only if `partial_cmp(a, b) == Some(Equal)`.
2. `a < b` if and only if `partial_cmp(a, b) == Some(Less)`
3. `a > b` if and only if `partial_cmp(a, b) == Some(Greater)`
4. `a <= b` if and only if `a < b || a == b`
5. `a >= b` if and only if `a > b || a == b`
6. `a != b` if and only if `!(a == b)`.
Conditions 2–5 above are ensured by the default implementation. Condition 6 is already ensured by [`PartialEq`](trait.partialeq "PartialEq").
If [`Ord`](trait.ord "Ord") is also implemented for `Self` and `Rhs`, it must also be consistent with `partial_cmp` (see the documentation of that trait for the exact requirements). It’s easy to accidentally make them disagree by deriving some of the traits and manually implementing others.
The comparison must satisfy, for all `a`, `b` and `c`:
* transitivity: `a < b` and `b < c` implies `a < c`. The same must hold for both `==` and `>`.
* duality: `a < b` if and only if `b > a`.
Note that these requirements mean that the trait itself must be implemented symmetrically and transitively: if `T: PartialOrd<U>` and `U: PartialOrd<V>` then `U: PartialOrd<T>` and `T: PartialOrd<V>`.
### Corollaries
The following corollaries follow from the above requirements:
* irreflexivity of `<` and `>`: `!(a < a)`, `!(a > a)`
* transitivity of `>`: if `a > b` and `b > c` then `a > c`
* duality of `partial_cmp`: `partial_cmp(a, b) == partial_cmp(b, a).map(Ordering::reverse)`
### Derivable
This trait can be used with `#[derive]`.
When `derive`d on structs, it will produce a [lexicographic](https://en.wikipedia.org/wiki/Lexicographic_order) ordering based on the top-to-bottom declaration order of the struct’s members.
When `derive`d on enums, variants are ordered by their discriminants. By default, the discriminant is smallest for variants at the top, and largest for variants at the bottom. Here’s an example:
```
#[derive(PartialEq, PartialOrd)]
enum E {
Top,
Bottom,
}
assert!(E::Top < E::Bottom);
```
However, manually setting the discriminants can override this default behavior:
```
#[derive(PartialEq, PartialOrd)]
enum E {
Top = 2,
Bottom = 1,
}
assert!(E::Bottom < E::Top);
```
### How can I implement `PartialOrd`?
`PartialOrd` only requires implementation of the [`partial_cmp`](trait.partialord#tymethod.partial_cmp) method, with the others generated from default implementations.
However it remains possible to implement the others separately for types which do not have a total order. For example, for floating point numbers, `NaN < 0 == false` and `NaN >= 0 == false` (cf. IEEE 754-2008 section 5.11).
`PartialOrd` requires your type to be [`PartialEq`](trait.partialeq "PartialEq").
If your type is [`Ord`](trait.ord "Ord"), you can implement [`partial_cmp`](trait.partialord#tymethod.partial_cmp) by using [`cmp`](trait.ord#tymethod.cmp):
```
use std::cmp::Ordering;
#[derive(Eq)]
struct Person {
id: u32,
name: String,
height: u32,
}
impl PartialOrd for Person {
fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
Some(self.cmp(other))
}
}
impl Ord for Person {
fn cmp(&self, other: &Self) -> Ordering {
self.height.cmp(&other.height)
}
}
impl PartialEq for Person {
fn eq(&self, other: &Self) -> bool {
self.height == other.height
}
}
```
You may also find it useful to use [`partial_cmp`](trait.partialord#tymethod.partial_cmp) on your type’s fields. Here is an example of `Person` types who have a floating-point `height` field that is the only field to be used for sorting:
```
use std::cmp::Ordering;
struct Person {
id: u32,
name: String,
height: f64,
}
impl PartialOrd for Person {
fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
self.height.partial_cmp(&other.height)
}
}
impl PartialEq for Person {
fn eq(&self, other: &Self) -> bool {
self.height == other.height
}
}
```
Examples
--------
```
let x: u32 = 0;
let y: u32 = 1;
assert_eq!(x < y, true);
assert_eq!(x.lt(&y), true);
```
Required Methods
----------------
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1122)#### fn partial\_cmp(&self, other: &Rhs) -> Option<Ordering>
This method returns an ordering between `self` and `other` values if one exists.
##### Examples
```
use std::cmp::Ordering;
let result = 1.0.partial_cmp(&2.0);
assert_eq!(result, Some(Ordering::Less));
let result = 1.0.partial_cmp(&1.0);
assert_eq!(result, Some(Ordering::Equal));
let result = 2.0.partial_cmp(&1.0);
assert_eq!(result, Some(Ordering::Greater));
```
When comparison is impossible:
```
let result = f64::NAN.partial_cmp(&1.0);
assert_eq!(result, None);
```
Provided Methods
----------------
[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.
##### Examples
```
let result = 1.0 < 2.0;
assert_eq!(result, true);
let result = 2.0 < 1.0;
assert_eq!(result, false);
```
[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.
##### Examples
```
let result = 1.0 <= 2.0;
assert_eq!(result, true);
let result = 2.0 <= 2.0;
assert_eq!(result, true);
```
[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.
##### Examples
```
let result = 1.0 > 2.0;
assert_eq!(result, false);
let result = 2.0 > 2.0;
assert_eq!(result, false);
```
[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.
##### Examples
```
let result = 2.0 >= 1.0;
assert_eq!(result, true);
let result = 2.0 >= 2.0;
assert_eq!(result, true);
```
Implementors
------------
[source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#740)1.34.0 · ### impl PartialOrd<Infallible> for Infallible
[source](https://doc.rust-lang.org/src/std/io/error.rs.html#166)### impl PartialOrd<ErrorKind> for ErrorKind
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#34)1.7.0 · ### impl PartialOrd<IpAddr> for IpAddr
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#1060-1068)1.16.0 · ### impl PartialOrd<IpAddr> for Ipv4Addr
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#1907-1915)1.16.0 · ### impl PartialOrd<IpAddr> for Ipv6Addr
[source](https://doc.rust-lang.org/src/std/net/socket_addr.rs.html#42)### impl PartialOrd<SocketAddr> for SocketAddr
[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/cmp.rs.html#911)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · ### impl PartialOrd<Ordering> for Ordering
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1416)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · ### impl PartialOrd<bool> for bool
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1486)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · ### impl PartialOrd<char> for char
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1423)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · ### impl PartialOrd<f32> for f32
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1423)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · ### impl PartialOrd<f64> for f64
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1486)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · ### impl PartialOrd<i8> for i8
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1486)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · ### impl PartialOrd<i16> for i16
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1486)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · ### impl PartialOrd<i32> for i32
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1486)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · ### impl PartialOrd<i64> for i64
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1486)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · ### impl PartialOrd<i128> for i128
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1486)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · ### impl PartialOrd<isize> for isize
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1501)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · ### impl PartialOrd<!> for !
[source](https://doc.rust-lang.org/src/core/str/traits.rs.html#48)### impl PartialOrd<str> for str
Implements comparison operations on strings.
Strings are compared [lexicographically](trait.ord#lexicographical-comparison) by their byte values. This compares Unicode code points based on their positions in the code charts. This is not necessarily the same as “alphabetical” order, which varies by language and locale. Comparing strings according to culturally-accepted standards requires locale-specific data that is outside the scope of the `str` type.
[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#624-629)### impl PartialOrd<str> for OsString
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1486)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · ### impl PartialOrd<u8> for u8
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1486)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · ### impl PartialOrd<u16> for u16
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1486)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · ### impl PartialOrd<u32> for u32
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1486)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · ### impl PartialOrd<u64> for u64
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1486)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · ### impl PartialOrd<u128> for u128
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1407)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · ### impl PartialOrd<()> for ()
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1486)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · ### impl PartialOrd<usize> 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 PartialOrd<CpuidResult> for CpuidResult
[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/ffi/c_str.rs.html#569)### impl PartialOrd<CStr> for CStr
[source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#109)1.64.0 · ### impl PartialOrd<CString> for CString
[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#600-621)### impl PartialOrd<OsString> for OsString
[source](https://doc.rust-lang.org/src/core/fmt/mod.rs.html#98)### impl PartialOrd<Error> for Error
[source](https://doc.rust-lang.org/src/core/marker.rs.html#776)1.33.0 · ### impl PartialOrd<PhantomPinned> for PhantomPinned
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#1049-1057)1.16.0 · ### impl PartialOrd<Ipv4Addr> for IpAddr
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#1041-1046)### impl PartialOrd<Ipv4Addr> for Ipv4Addr
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#1896-1904)1.16.0 · ### impl PartialOrd<Ipv6Addr> for IpAddr
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#1888-1893)### impl PartialOrd<Ipv6Addr> for Ipv6Addr
[source](https://doc.rust-lang.org/src/std/net/socket_addr.rs.html#679-683)1.45.0 · ### impl PartialOrd<SocketAddrV4> for SocketAddrV4
[source](https://doc.rust-lang.org/src/std/net/socket_addr.rs.html#686-690)1.45.0 · ### impl PartialOrd<SocketAddrV6> for SocketAddrV6
[source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.34.0 · ### impl PartialOrd<NonZeroI8> for NonZeroI8
[source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.34.0 · ### impl PartialOrd<NonZeroI16> for NonZeroI16
[source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.34.0 · ### impl PartialOrd<NonZeroI32> for NonZeroI32
[source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.34.0 · ### impl PartialOrd<NonZeroI64> for NonZeroI64
[source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.34.0 · ### impl PartialOrd<NonZeroI128> for NonZeroI128
[source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.34.0 · ### impl PartialOrd<NonZeroIsize> for NonZeroIsize
[source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.28.0 · ### impl PartialOrd<NonZeroU8> for NonZeroU8
[source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.28.0 · ### impl PartialOrd<NonZeroU16> for NonZeroU16
[source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.28.0 · ### impl PartialOrd<NonZeroU32> for NonZeroU32
[source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.28.0 · ### impl PartialOrd<NonZeroU64> for NonZeroU64
[source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.28.0 · ### impl PartialOrd<NonZeroU128> for NonZeroU128
[source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.28.0 · ### impl PartialOrd<NonZeroUsize> for NonZeroUsize
[source](https://doc.rust-lang.org/src/std/path.rs.html#2985-2990)### impl PartialOrd<Path> for Path
[source](https://doc.rust-lang.org/src/std/path.rs.html#1864-1869)### impl PartialOrd<PathBuf> for PathBuf
[source](https://doc.rust-lang.org/src/alloc/string.rs.html#365)### impl PartialOrd<String> for String
[source](https://doc.rust-lang.org/src/core/time.rs.html#70)1.3.0 · ### impl PartialOrd<Duration> for Duration
[source](https://doc.rust-lang.org/src/std/time.rs.html#152)1.8.0 · ### impl PartialOrd<Instant> for Instant
[source](https://doc.rust-lang.org/src/std/time.rs.html#237)1.8.0 · ### impl PartialOrd<SystemTime> for SystemTime
[source](https://doc.rust-lang.org/src/std/path.rs.html#505)### impl<'a> PartialOrd<Component<'a>> for Component<'a>
[source](https://doc.rust-lang.org/src/std/path.rs.html#141)### impl<'a> PartialOrd<Prefix<'a>> for Prefix<'a>
[source](https://doc.rust-lang.org/src/core/panic/location.rs.html#31)1.10.0 · ### impl<'a> PartialOrd<Location<'a>> for Location<'a>
[source](https://doc.rust-lang.org/src/std/path.rs.html#1021-1026)### impl<'a> PartialOrd<Components<'a>> for Components<'a>
[source](https://doc.rust-lang.org/src/std/path.rs.html#461-466)### impl<'a> PartialOrd<PrefixComponent<'a>> for PrefixComponent<'a>
[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/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#3155)1.8.0 · ### impl<'a, 'b> PartialOrd<&'a OsStr> for PathBuf
[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#3162)1.8.0 · ### impl<'a, 'b> PartialOrd<&'a Path> for OsStr
[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#3113)1.8.0 · ### impl<'a, 'b> PartialOrd<&'a Path> for PathBuf
[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/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#3115)1.8.0 · ### impl<'a, 'b> PartialOrd<&'b Path> for Cow<'a, Path>
[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#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#1241)1.8.0 · ### impl<'a, 'b> PartialOrd<Cow<'a, OsStr>> for OsString
[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#3156)1.8.0 · ### impl<'a, 'b> PartialOrd<Cow<'a, OsStr>> for PathBuf
[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#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#3165)1.8.0 · ### impl<'a, 'b> PartialOrd<Cow<'a, Path>> for OsStr
[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#3114)1.8.0 · ### impl<'a, 'b> PartialOrd<Cow<'a, Path>> for Path
[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#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#3162)1.8.0 · ### impl<'a, 'b> PartialOrd<OsStr> for &'a Path
[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/path.rs.html#3165)1.8.0 · ### impl<'a, 'b> PartialOrd<OsStr> for Cow<'a, Path>
[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/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#3154)1.8.0 · ### impl<'a, 'b> PartialOrd<OsStr> for PathBuf
[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/path.rs.html#3164)1.8.0 · ### impl<'a, 'b> PartialOrd<OsString> for &'a Path
[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/path.rs.html#3167)1.8.0 · ### impl<'a, 'b> PartialOrd<OsString> for Cow<'a, Path>
[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/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#3157)1.8.0 · ### impl<'a, 'b> PartialOrd<OsString> for PathBuf
[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#3160)1.8.0 · ### impl<'a, 'b> PartialOrd<Path> for Cow<'a, OsStr>
[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#3158)1.8.0 · ### impl<'a, 'b> PartialOrd<Path> for OsStr
[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#3112)1.8.0 · ### impl<'a, 'b> PartialOrd<Path> for PathBuf
[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#3113)1.8.0 · ### impl<'a, 'b> PartialOrd<PathBuf> for &'a Path
[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#3116)1.8.0 · ### impl<'a, 'b> PartialOrd<PathBuf> for Cow<'a, Path>
[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#3157)1.8.0 · ### impl<'a, 'b> PartialOrd<PathBuf> for OsString
[source](https://doc.rust-lang.org/src/std/path.rs.html#3112)1.8.0 · ### impl<'a, 'b> PartialOrd<PathBuf> for Path
[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](trait.partialord "trait std::cmp::PartialOrd")<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/cmp.rs.html#1533)### impl<A, B> PartialOrd<&B> for &Awhere A: [PartialOrd](trait.partialord "trait std::cmp::PartialOrd")<B> + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), B: ?[Sized](../marker/trait.sized "trait std::marker::Sized"),
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1588)### impl<A, B> PartialOrd<&mut B> for &mut Awhere A: [PartialOrd](trait.partialord "trait std::cmp::PartialOrd")<B> + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), B: ?[Sized](../marker/trait.sized "trait std::marker::Sized"),
[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/alloc/collections/btree/map.rs.html#2182)### impl<K, V, A> PartialOrd<BTreeMap<K, V, A>> for BTreeMap<K, V, A>where K: [PartialOrd](trait.partialord "trait std::cmp::PartialOrd")<K>, V: [PartialOrd](trait.partialord "trait std::cmp::PartialOrd")<V>, A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator") + [Clone](../clone/trait.clone "trait std::clone::Clone"),
[source](https://doc.rust-lang.org/src/core/pin.rs.html#443)1.41.0 · ### impl<P, Q> PartialOrd<Pin<Q>> for Pin<P>where P: [Deref](../ops/trait.deref "trait std::ops::Deref"), Q: [Deref](../ops/trait.deref "trait std::ops::Deref"), <P as [Deref](../ops/trait.deref "trait std::ops::Deref")>::[Target](../ops/trait.deref#associatedtype.Target "type std::ops::Deref::Target"): [PartialOrd](trait.partialord "trait std::cmp::PartialOrd")<<Q as [Deref](../ops/trait.deref "trait std::ops::Deref")>::[Target](../ops/trait.deref#associatedtype.Target "type std::ops::Deref::Target")>,
[source](https://doc.rust-lang.org/src/core/ptr/mod.rs.html#1949)1.4.0 · ### impl<Ret, T> PartialOrd<fn(T) -> Ret> for fn (T₁, T₂, …, Tₙ) -> Ret
This trait is implemented for function pointers with up to twelve arguments.
[source](https://doc.rust-lang.org/src/core/ptr/mod.rs.html#1949)1.4.0 · ### impl<Ret, T> PartialOrd<extern "C" fn(T) -> Ret> for extern "C" fn (T₁, T₂, …, Tₙ) -> Ret
This trait is implemented for function pointers with up to twelve arguments.
[source](https://doc.rust-lang.org/src/core/ptr/mod.rs.html#1949)1.4.0 · ### impl<Ret, T> PartialOrd<extern "C" fn(T, ...) -> Ret> for extern "C" fn (T₁, T₂, …, Tₙ, ...) -> Ret
This trait is implemented for function pointers with up to twelve arguments.
[source](https://doc.rust-lang.org/src/core/ptr/mod.rs.html#1949)1.4.0 · ### impl<Ret, T> PartialOrd<unsafe fn(T) -> Ret> for unsafe fn (T₁, T₂, …, Tₙ) -> Ret
This trait is implemented for function pointers with up to twelve arguments.
[source](https://doc.rust-lang.org/src/core/ptr/mod.rs.html#1949)1.4.0 · ### impl<Ret, T> PartialOrd<unsafe extern "C" fn(T) -> Ret> for unsafe extern "C" fn (T₁, T₂, …, Tₙ) -> Ret
This trait is implemented for function pointers with up to twelve arguments.
[source](https://doc.rust-lang.org/src/core/ptr/mod.rs.html#1949)1.4.0 · ### impl<Ret, T> PartialOrd<unsafe extern "C" fn(T, ...) -> Ret> for unsafe extern "C" fn (T₁, T₂, …, Tₙ, ...) -> Ret
This trait is implemented for function pointers with up to twelve arguments.
[source](https://doc.rust-lang.org/src/core/option.rs.html#515)### impl<T> PartialOrd<Option<T>> for Option<T>where T: [PartialOrd](trait.partialord "trait std::cmp::PartialOrd")<T>,
[source](https://doc.rust-lang.org/src/core/task/poll.rs.html#11)1.36.0 · ### impl<T> PartialOrd<Poll<T>> for Poll<T>where T: [PartialOrd](trait.partialord "trait std::cmp::PartialOrd")<T>,
[source](https://doc.rust-lang.org/src/core/ptr/const_ptr.rs.html#1517)### impl<T> PartialOrd<\*const T> for \*const Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"),
[source](https://doc.rust-lang.org/src/core/ptr/mut_ptr.rs.html#1958)### impl<T> PartialOrd<\*mut T> for \*mut Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"),
[source](https://doc.rust-lang.org/src/core/slice/cmp.rs.html#47)### impl<T> PartialOrd<[T]> for [T]where T: [PartialOrd](trait.partialord "trait std::cmp::PartialOrd")<T>,
Implements comparison of vectors [lexicographically](trait.ord#lexicographical-comparison).
[source](https://doc.rust-lang.org/src/core/tuple.rs.html#159)### impl<T> PartialOrd<(T,)> for (T₁, T₂, …, Tₙ)where T: [PartialOrd](trait.partialord "trait std::cmp::PartialOrd")<T> + [PartialEq](trait.partialeq "trait std::cmp::PartialEq")<T> + ?[Sized](../marker/trait.sized "trait std::marker::Sized"),
This trait is implemented for tuples up to twelve items long.
[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](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#1202)1.10.0 · ### impl<T> PartialOrd<RefCell<T>> for RefCell<T>where T: [PartialOrd](trait.partialord "trait std::cmp::PartialOrd")<T> + ?[Sized](../marker/trait.sized "trait std::marker::Sized"),
[source](https://doc.rust-lang.org/src/alloc/collections/linked_list.rs.html#1903)### impl<T> PartialOrd<LinkedList<T>> for LinkedList<T>where T: [PartialOrd](trait.partialord "trait std::cmp::PartialOrd")<T>,
[source](https://doc.rust-lang.org/src/core/marker.rs.html#680)### impl<T> PartialOrd<PhantomData<T>> 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> PartialOrd<ManuallyDrop<T>> for ManuallyDrop<T>where T: [PartialOrd](trait.partialord "trait std::cmp::PartialOrd")<T> + ?[Sized](../marker/trait.sized "trait std::marker::Sized"),
[source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#36)### impl<T> PartialOrd<Saturating<T>> for Saturating<T>where T: [PartialOrd](trait.partialord "trait std::cmp::PartialOrd")<T>,
[source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#40)### impl<T> PartialOrd<Wrapping<T>> for Wrapping<T>where T: [PartialOrd](trait.partialord "trait std::cmp::PartialOrd")<T>,
[source](https://doc.rust-lang.org/src/core/ptr/non_null.rs.html#751)1.25.0 · ### 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/alloc/rc.rs.html#1714)### impl<T> PartialOrd<Rc<T>> for Rc<T>where T: [PartialOrd](trait.partialord "trait std::cmp::PartialOrd")<T> + ?[Sized](../marker/trait.sized "trait std::marker::Sized"),
[source](https://doc.rust-lang.org/src/alloc/sync.rs.html#2304)### impl<T> PartialOrd<Arc<T>> for Arc<T>where T: [PartialOrd](trait.partialord "trait std::cmp::PartialOrd")<T> + ?[Sized](../marker/trait.sized "trait std::marker::Sized"),
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#613)1.19.0 (const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp")) · ### impl<T> PartialOrd<Reverse<T>> for Reverse<T>where T: [PartialOrd](trait.partialord "trait std::cmp::PartialOrd")<T>,
[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](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/collections/btree/set.rs.html#106)### impl<T, A> PartialOrd<BTreeSet<T, A>> for BTreeSet<T, A>where T: [PartialOrd](trait.partialord "trait std::cmp::PartialOrd")<T>, 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/vec_deque/mod.rs.html#2899)### impl<T, A> PartialOrd<VecDeque<T, A>> for VecDeque<T, A>where T: [PartialOrd](trait.partialord "trait std::cmp::PartialOrd")<T>, A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"),
[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](trait.partialord "trait std::cmp::PartialOrd")<T>, A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"),
Implements comparison of vectors, [lexicographically](trait.ord#lexicographical-comparison).
[source](https://doc.rust-lang.org/src/core/result.rs.html#500)### impl<T, E> PartialOrd<Result<T, E>> for Result<T, E>where T: [PartialOrd](trait.partialord "trait std::cmp::PartialOrd")<T>, E: [PartialOrd](trait.partialord "trait std::cmp::PartialOrd")<E>,
[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](../simd/trait.maskelement "trait std::simd::MaskElement") + [PartialOrd](trait.partialord "trait std::cmp::PartialOrd")<T>, [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#530)### impl<T, const LANES: usize> PartialOrd<Simd<T, LANES>> for Simd<T, LANES>where T: [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement") + [PartialOrd](trait.partialord "trait std::cmp::PartialOrd")<T>, [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#314)### impl<T, const N: usize> PartialOrd<[T; N]> for [T; N]where T: [PartialOrd](trait.partialord "trait std::cmp::PartialOrd")<T>,
[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](trait.partialord "trait std::cmp::PartialOrd")<Y>, R: [PartialOrd](trait.partialord "trait std::cmp::PartialOrd")<R>,
| programming_docs |
rust Function std::cmp::min Function std::cmp::min
======================
```
pub fn min<T>(v1: T, v2: T) -> Twhere T: Ord,
```
Compares and returns the minimum of two values.
Returns the first argument if the comparison determines them to be equal.
Internally uses an alias to [`Ord::min`](trait.ord#method.min "Ord::min").
Examples
--------
```
use std::cmp;
assert_eq!(1, cmp::min(1, 2));
assert_eq!(2, cmp::min(2, 2));
```
rust Trait std::cmp::PartialEq Trait std::cmp::PartialEq
=========================
```
pub trait PartialEq<Rhs = Self>where Rhs: ?Sized,{
fn eq(&self, other: &Rhs) -> bool;
fn ne(&self, other: &Rhs) -> bool { ... }
}
```
Trait for equality comparisons which are [partial equivalence relations](https://en.wikipedia.org/wiki/Partial_equivalence_relation).
`x.eq(y)` can also be written `x == y`, and `x.ne(y)` can be written `x != y`. We use the easier-to-read infix notation in the remainder of this documentation.
This trait allows for partial equality, for types that do not have a full equivalence relation. For example, in floating point numbers `NaN != NaN`, so floating point types implement `PartialEq` but not [`Eq`](trait.eq "Eq").
Implementations must ensure that `eq` and `ne` are consistent with each other:
* `a != b` if and only if `!(a == b)`.
The default implementation of `ne` provides this consistency and is almost always sufficient. It should not be overridden without very good reason.
If [`PartialOrd`](trait.partialord "PartialOrd") or [`Ord`](trait.ord "Ord") are also implemented for `Self` and `Rhs`, their methods must also be consistent with `PartialEq` (see the documentation of those traits for the exact requirements). It’s easy to accidentally make them disagree by deriving some of the traits and manually implementing others.
The equality relation `==` must satisfy the following conditions (for all `a`, `b`, `c` of type `A`, `B`, `C`):
* **Symmetric**: if `A: PartialEq<B>` and `B: PartialEq<A>`, then **`a == b` implies `b == a`**; and
* **Transitive**: if `A: PartialEq<B>` and `B: PartialEq<C>` and `A: PartialEq<C>`, then **`a == b` and `b == c` implies `a == c`**.
Note that the `B: PartialEq<A>` (symmetric) and `A: PartialEq<C>` (transitive) impls are not forced to exist, but these requirements apply whenever they do exist.
### Derivable
This trait can be used with `#[derive]`. When `derive`d on structs, two instances are equal if all fields are equal, and not equal if any fields are not equal. When `derive`d on enums, two instances are equal if they are the same variant and all fields are equal.
### How can I implement `PartialEq`?
An example implementation for a domain in which two books are considered the same book if their ISBN matches, even if the formats differ:
```
enum BookFormat {
Paperback,
Hardback,
Ebook,
}
struct Book {
isbn: i32,
format: BookFormat,
}
impl PartialEq for Book {
fn eq(&self, other: &Self) -> bool {
self.isbn == other.isbn
}
}
let b1 = Book { isbn: 3, format: BookFormat::Paperback };
let b2 = Book { isbn: 3, format: BookFormat::Ebook };
let b3 = Book { isbn: 10, format: BookFormat::Paperback };
assert!(b1 == b2);
assert!(b1 != b3);
```
### How can I compare two different types?
The type you can compare with is controlled by `PartialEq`’s type parameter. For example, let’s tweak our previous code a bit:
```
// The derive implements <BookFormat> == <BookFormat> comparisons
#[derive(PartialEq)]
enum BookFormat {
Paperback,
Hardback,
Ebook,
}
struct Book {
isbn: i32,
format: BookFormat,
}
// Implement <Book> == <BookFormat> comparisons
impl PartialEq<BookFormat> for Book {
fn eq(&self, other: &BookFormat) -> bool {
self.format == *other
}
}
// Implement <BookFormat> == <Book> comparisons
impl PartialEq<Book> for BookFormat {
fn eq(&self, other: &Book) -> bool {
*self == other.format
}
}
let b1 = Book { isbn: 3, format: BookFormat::Paperback };
assert!(b1 == BookFormat::Paperback);
assert!(BookFormat::Ebook != b1);
```
By changing `impl PartialEq for Book` to `impl PartialEq<BookFormat> for Book`, we allow `BookFormat`s to be compared with `Book`s.
A comparison like the one above, which ignores some fields of the struct, can be dangerous. It can easily lead to an unintended violation of the requirements for a partial equivalence relation. For example, if we kept the above implementation of `PartialEq<Book>` for `BookFormat` and added an implementation of `PartialEq<Book>` for `Book` (either via a `#[derive]` or via the manual implementation from the first example) then the result would violate transitivity:
ⓘ
```
#[derive(PartialEq)]
enum BookFormat {
Paperback,
Hardback,
Ebook,
}
#[derive(PartialEq)]
struct Book {
isbn: i32,
format: BookFormat,
}
impl PartialEq<BookFormat> for Book {
fn eq(&self, other: &BookFormat) -> bool {
self.format == *other
}
}
impl PartialEq<Book> for BookFormat {
fn eq(&self, other: &Book) -> bool {
*self == other.format
}
}
fn main() {
let b1 = Book { isbn: 1, format: BookFormat::Paperback };
let b2 = Book { isbn: 2, format: BookFormat::Paperback };
assert!(b1 == BookFormat::Paperback);
assert!(BookFormat::Paperback == b2);
// The following should hold by transitivity but doesn't.
assert!(b1 == b2); // <-- PANICS
}
```
Examples
--------
```
let x: u32 = 0;
let y: u32 = 1;
assert_eq!(x == y, false);
assert_eq!(x.eq(&y), false);
```
Required Methods
----------------
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#229)#### fn eq(&self, other: &Rhs) -> bool
This method tests for `self` and `other` values to be equal, and is used by `==`.
Provided Methods
----------------
[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.
Implementors
------------
[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/backtrace.rs.html#117)1.65.0 · ### impl PartialEq<BacktraceStatus> for BacktraceStatus
[source](https://doc.rust-lang.org/src/alloc/collections/mod.rs.html#80)### impl PartialEq<TryReserveErrorKind> for TryReserveErrorKind
[source](https://doc.rust-lang.org/src/core/convert/mod.rs.html#730)1.34.0 · ### impl PartialEq<Infallible> for Infallible
[source](https://doc.rust-lang.org/src/std/env.rs.html#280)### impl PartialEq<VarError> for VarError
[source](https://doc.rust-lang.org/src/core/fmt/mod.rs.html#25)1.28.0 · ### impl PartialEq<Alignment> for Alignment
[source](https://doc.rust-lang.org/src/std/io/error.rs.html#166)### impl PartialEq<ErrorKind> for ErrorKind
[source](https://doc.rust-lang.org/src/std/io/mod.rs.html#1881)### impl PartialEq<SeekFrom> for SeekFrom
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#34)1.7.0 · ### impl PartialEq<IpAddr> for IpAddr
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#1030-1038)1.16.0 · ### impl PartialEq<IpAddr> for Ipv4Addr
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#1866-1874)1.16.0 · ### impl PartialEq<IpAddr> for Ipv6Addr
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#200)### impl PartialEq<Ipv6MulticastScope> for Ipv6MulticastScope
[source](https://doc.rust-lang.org/src/std/net/mod.rs.html#49)### impl PartialEq<Shutdown> for Shutdown
[source](https://doc.rust-lang.org/src/std/net/socket_addr.rs.html#42)### impl PartialEq<SocketAddr> for SocketAddr
[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/error.rs.html#87)1.55.0 · ### impl PartialEq<IntErrorKind> for IntErrorKind
[source](https://doc.rust-lang.org/src/std/panic.rs.html#208)### impl PartialEq<BacktraceStyle> for BacktraceStyle
[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/str/pattern.rs.html#167)### impl PartialEq<SearchStep> for SearchStep
[source](https://doc.rust-lang.org/src/core/sync/atomic.rs.html#212)### impl PartialEq<Ordering> for std::sync::atomic::Ordering
[source](https://doc.rust-lang.org/src/std/sync/mpsc/mod.rs.html#611)1.12.0 · ### impl PartialEq<RecvTimeoutError> for RecvTimeoutError
[source](https://doc.rust-lang.org/src/std/sync/mpsc/mod.rs.html#592)### impl PartialEq<TryRecvError> for TryRecvError
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#893)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · ### impl PartialEq<Ordering> for std::cmp::Ordering
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1366-1368)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · ### impl PartialEq<bool> for bool
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1366-1368)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · ### impl PartialEq<char> for char
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1366-1368)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · ### impl PartialEq<f32> for f32
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1366-1368)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · ### impl PartialEq<f64> for f64
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1366-1368)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · ### impl PartialEq<i8> for i8
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1366-1368)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · ### impl PartialEq<i16> for i16
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1366-1368)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · ### impl PartialEq<i32> for i32
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1366-1368)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · ### impl PartialEq<i64> for i64
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1366-1368)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · ### impl PartialEq<i128> for i128
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1366-1368)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · ### impl PartialEq<isize> for isize
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1490)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · ### impl PartialEq<!> for !
[source](https://doc.rust-lang.org/src/core/str/traits.rs.html#26)### impl PartialEq<str> for str
[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#565-570)### impl PartialEq<str> for OsString
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1366-1368)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · ### impl PartialEq<u8> for u8
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1366-1368)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · ### impl PartialEq<u16> for u16
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1366-1368)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · ### impl PartialEq<u32> for u32
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1366-1368)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · ### impl PartialEq<u64> for u64
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1366-1368)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · ### impl PartialEq<u128> for u128
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1355)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · ### impl PartialEq<()> for ()
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1366-1368)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · ### impl PartialEq<usize> 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 PartialEq<CpuidResult> for CpuidResult
[source](https://doc.rust-lang.org/src/core/ffi/c_str.rs.html#149)### impl PartialEq<FromBytesUntilNulError> for FromBytesUntilNulError
[source](https://doc.rust-lang.org/src/core/alloc/mod.rs.html#34)### impl PartialEq<AllocError> for AllocError
[source](https://doc.rust-lang.org/src/core/alloc/layout.rs.html#37)1.28.0 · ### impl PartialEq<Layout> for Layout
[source](https://doc.rust-lang.org/src/core/alloc/layout.rs.html#463)1.50.0 · ### impl PartialEq<LayoutError> for LayoutError
[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/char/convert.rs.html#235)1.34.0 · ### impl PartialEq<CharTryFromError> for CharTryFromError
[source](https://doc.rust-lang.org/src/core/char/decode.rs.html#29)1.9.0 · ### impl PartialEq<DecodeUtf16Error> for DecodeUtf16Error
[source](https://doc.rust-lang.org/src/core/char/convert.rs.html#149)1.20.0 · ### impl PartialEq<ParseCharError> for ParseCharError
[source](https://doc.rust-lang.org/src/core/char/mod.rs.html#580)1.59.0 · ### impl PartialEq<TryFromCharError> for TryFromCharError
[source](https://doc.rust-lang.org/src/alloc/collections/mod.rs.html#59)1.57.0 · ### impl PartialEq<TryReserveError> for TryReserveError
[source](https://doc.rust-lang.org/src/core/ffi/c_str.rs.html#561)### impl PartialEq<CStr> for CStr
[source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#109)1.64.0 · ### impl PartialEq<CString> for CString
[source](https://doc.rust-lang.org/src/core/ffi/c_str.rs.html#110)1.64.0 · ### impl PartialEq<FromBytesWithNulError> for FromBytesWithNulError
[source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#159)1.64.0 · ### impl PartialEq<FromVecWithNulError> for FromVecWithNulError
[source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#225)1.64.0 · ### impl PartialEq<IntoStringError> for IntoStringError
[source](https://doc.rust-lang.org/src/alloc/ffi/c_str.rs.html#134)1.64.0 · ### impl PartialEq<NulError> for NulError
[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#1132-1137)### impl PartialEq<OsStr> for OsStr
[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#557-562)### impl PartialEq<OsString> for OsString
[source](https://doc.rust-lang.org/src/core/fmt/mod.rs.html#98)### impl PartialEq<Error> for Error
[source](https://doc.rust-lang.org/src/std/fs.rs.html#207)1.1.0 · ### impl PartialEq<FileType> for FileType
[source](https://doc.rust-lang.org/src/std/fs.rs.html#200)### impl PartialEq<Permissions> for Permissions
[source](https://doc.rust-lang.org/src/core/marker.rs.html#776)1.33.0 · ### impl PartialEq<PhantomPinned> for PhantomPinned
[source](https://doc.rust-lang.org/src/core/mem/transmutability.rs.html#21)### impl PartialEq<Assume> for Assume
[source](https://doc.rust-lang.org/src/std/net/parser.rs.html#476)### impl PartialEq<AddrParseError> for AddrParseError
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#1019-1027)1.16.0 · ### impl PartialEq<Ipv4Addr> for IpAddr
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#75)### impl PartialEq<Ipv4Addr> for Ipv4Addr
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#1877-1885)1.16.0 · ### impl PartialEq<Ipv6Addr> for IpAddr
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#158)### impl PartialEq<Ipv6Addr> for Ipv6Addr
[source](https://doc.rust-lang.org/src/std/net/socket_addr.rs.html#78)### impl PartialEq<SocketAddrV4> for SocketAddrV4
[source](https://doc.rust-lang.org/src/std/net/socket_addr.rs.html#111)### impl PartialEq<SocketAddrV6> for SocketAddrV6
[source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.34.0 · ### impl PartialEq<NonZeroI8> for NonZeroI8
[source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.34.0 · ### impl PartialEq<NonZeroI16> for NonZeroI16
[source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.34.0 · ### impl PartialEq<NonZeroI32> for NonZeroI32
[source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.34.0 · ### impl PartialEq<NonZeroI64> for NonZeroI64
[source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.34.0 · ### impl PartialEq<NonZeroI128> for NonZeroI128
[source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.34.0 · ### impl PartialEq<NonZeroIsize> for NonZeroIsize
[source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.28.0 · ### impl PartialEq<NonZeroU8> for NonZeroU8
[source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.28.0 · ### impl PartialEq<NonZeroU16> for NonZeroU16
[source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.28.0 · ### impl PartialEq<NonZeroU32> for NonZeroU32
[source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.28.0 · ### impl PartialEq<NonZeroU64> for NonZeroU64
[source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.28.0 · ### impl PartialEq<NonZeroU128> for NonZeroU128
[source](https://doc.rust-lang.org/src/core/num/nonzero.rs.html#161-174)1.28.0 · ### impl PartialEq<NonZeroUsize> for NonZeroUsize
[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/error.rs.html#69)### impl PartialEq<ParseIntError> for ParseIntError
[source](https://doc.rust-lang.org/src/core/num/error.rs.html#10)1.34.0 · ### impl PartialEq<TryFromIntError> for TryFromIntError
[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/std/os/unix/ucred.rs.html#13)### impl PartialEq<UCred> 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 PartialEq<InvalidHandleError> 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 PartialEq<NullHandleError> for NullHandleError
Available on **Windows** only.[source](https://doc.rust-lang.org/src/std/path.rs.html#2923-2928)### impl PartialEq<Path> for Path
[source](https://doc.rust-lang.org/src/std/path.rs.html#1846-1851)### impl PartialEq<PathBuf> for PathBuf
[source](https://doc.rust-lang.org/src/std/path.rs.html#1937)1.7.0 · ### impl PartialEq<StripPrefixError> for StripPrefixError
[source](https://doc.rust-lang.org/src/std/process.rs.html#1452)### impl PartialEq<ExitStatus> for ExitStatus
[source](https://doc.rust-lang.org/src/std/process.rs.html#1585)### impl PartialEq<ExitStatusError> for ExitStatusError
[source](https://doc.rust-lang.org/src/std/process.rs.html#1096)### impl PartialEq<Output> for Output
[source](https://doc.rust-lang.org/src/core/str/error.rs.html#139)### impl PartialEq<ParseBoolError> for ParseBoolError
[source](https://doc.rust-lang.org/src/core/str/error.rs.html#46)### impl PartialEq<Utf8Error> for Utf8Error
[source](https://doc.rust-lang.org/src/alloc/string.rs.html#407)### impl PartialEq<FromUtf8Error> for FromUtf8Error
[source](https://doc.rust-lang.org/src/alloc/string.rs.html#2185)### impl PartialEq<String> for String
[source](https://doc.rust-lang.org/src/std/sync/mpsc/mod.rs.html#583)### impl PartialEq<RecvError> for RecvError
[source](https://doc.rust-lang.org/src/std/sync/condvar.rs.html#15)1.5.0 · ### impl PartialEq<WaitTimeoutResult> for WaitTimeoutResult
[source](https://doc.rust-lang.org/src/core/task/wake.rs.html#13)1.36.0 · ### impl PartialEq<RawWaker> for RawWaker
[source](https://doc.rust-lang.org/src/core/task/wake.rs.html#81)1.36.0 · ### impl PartialEq<RawWakerVTable> for RawWakerVTable
[source](https://doc.rust-lang.org/src/std/thread/local.rs.html#372)1.26.0 · ### impl PartialEq<AccessError> for AccessError
[source](https://doc.rust-lang.org/src/std/thread/mod.rs.html#1039)1.19.0 · ### impl PartialEq<ThreadId> for ThreadId
[source](https://doc.rust-lang.org/src/core/time.rs.html#70)1.3.0 · ### impl PartialEq<Duration> for Duration
[source](https://doc.rust-lang.org/src/core/time.rs.html#1210)### impl PartialEq<FromFloatSecsError> for FromFloatSecsError
[source](https://doc.rust-lang.org/src/std/time.rs.html#152)1.8.0 · ### impl PartialEq<Instant> for Instant
[source](https://doc.rust-lang.org/src/std/time.rs.html#237)1.8.0 · ### impl PartialEq<SystemTime> for SystemTime
[source](https://doc.rust-lang.org/src/std/path.rs.html#505)### impl<'a> PartialEq<Component<'a>> for Component<'a>
[source](https://doc.rust-lang.org/src/std/path.rs.html#141)### impl<'a> PartialEq<Prefix<'a>> for Prefix<'a>
[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/core/panic/location.rs.html#31)1.10.0 · ### impl<'a> PartialEq<Location<'a>> for Location<'a>
[source](https://doc.rust-lang.org/src/std/path.rs.html#991-1015)### impl<'a> PartialEq<Components<'a>> for Components<'a>
[source](https://doc.rust-lang.org/src/std/path.rs.html#453-458)### impl<'a> PartialEq<PrefixComponent<'a>> for PrefixComponent<'a>
[source](https://doc.rust-lang.org/src/core/str/lossy.rs.html#34)### impl<'a> PartialEq<Utf8Chunk<'a>> for Utf8Chunk<'a>
[source](https://doc.rust-lang.org/src/alloc/string.rs.html#2227)### impl<'a, 'b> PartialEq<&'a str> for String
[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/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#3155)1.8.0 · ### impl<'a, 'b> PartialEq<&'a OsStr> for PathBuf
[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#3162)1.8.0 · ### impl<'a, 'b> PartialEq<&'a Path> for OsStr
[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#3113)1.6.0 · ### impl<'a, 'b> PartialEq<&'a Path> for PathBuf
[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/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/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#3115)1.6.0 · ### impl<'a, 'b> PartialEq<&'b Path> for Cow<'a, Path>
[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#2229)### impl<'a, 'b> PartialEq<Cow<'a, str>> for str
[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/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#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#1241)1.8.0 · ### impl<'a, 'b> PartialEq<Cow<'a, OsStr>> for OsString
[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#3156)1.8.0 · ### impl<'a, 'b> PartialEq<Cow<'a, OsStr>> for PathBuf
[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#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#3165)1.8.0 · ### impl<'a, 'b> PartialEq<Cow<'a, Path>> for OsStr
[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#3114)1.6.0 · ### impl<'a, 'b> PartialEq<Cow<'a, Path>> for Path
[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#3163)1.8.0 · ### impl<'a, 'b> PartialEq<Cow<'b, OsStr>> for &'a Path
[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#2226)### impl<'a, 'b> PartialEq<str> for String
[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/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/path.rs.html#3165)1.8.0 · ### impl<'a, 'b> PartialEq<OsStr> for Cow<'a, Path>
[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/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#3154)1.8.0 · ### impl<'a, 'b> PartialEq<OsStr> for PathBuf
[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/path.rs.html#3164)1.8.0 · ### impl<'a, 'b> PartialEq<OsString> for &'a Path
[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/path.rs.html#3167)1.8.0 · ### impl<'a, 'b> PartialEq<OsString> for Cow<'a, Path>
[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/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#3157)1.8.0 · ### impl<'a, 'b> PartialEq<OsString> for PathBuf
[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#3160)1.8.0 · ### impl<'a, 'b> PartialEq<Path> for Cow<'a, OsStr>
[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#3158)1.8.0 · ### impl<'a, 'b> PartialEq<Path> for OsStr
[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#3112)1.6.0 · ### impl<'a, 'b> PartialEq<Path> for PathBuf
[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#3113)1.6.0 · ### impl<'a, 'b> PartialEq<PathBuf> for &'a Path
[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#3116)1.6.0 · ### impl<'a, 'b> PartialEq<PathBuf> for Cow<'a, Path>
[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#3157)1.8.0 · ### impl<'a, 'b> PartialEq<PathBuf> for OsString
[source](https://doc.rust-lang.org/src/std/path.rs.html#3112)1.6.0 · ### impl<'a, 'b> PartialEq<PathBuf> for Path
[source](https://doc.rust-lang.org/src/alloc/string.rs.html#2227)### impl<'a, 'b> PartialEq<String> for &'a str
[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#2226)### impl<'a, 'b> PartialEq<String> for str
[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](trait.partialeq "trait std::cmp::PartialEq")<C> + [ToOwned](../borrow/trait.toowned "trait std::borrow::ToOwned") + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), C: [ToOwned](../borrow/trait.toowned "trait std::borrow::ToOwned") + ?[Sized](../marker/trait.sized "trait std::marker::Sized"),
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1519)const: [unstable](https://github.com/rust-lang/rust/issues/92391 "Tracking issue for const_cmp") · ### impl<A, B> PartialEq<&B> for &Awhere A: [PartialEq](trait.partialeq "trait std::cmp::PartialEq")<B> + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), B: ?[Sized](../marker/trait.sized "trait std::marker::Sized"),
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1642)### impl<A, B> PartialEq<&B> for &mut Awhere A: [PartialEq](trait.partialeq "trait std::cmp::PartialEq")<B> + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), B: ?[Sized](../marker/trait.sized "trait std::marker::Sized"),
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1627)### impl<A, B> PartialEq<&mut B> for &Awhere A: [PartialEq](trait.partialeq "trait std::cmp::PartialEq")<B> + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), B: ?[Sized](../marker/trait.sized "trait std::marker::Sized"),
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#1574)### impl<A, B> PartialEq<&mut B> for &mut Awhere A: [PartialEq](trait.partialeq "trait std::cmp::PartialEq")<B> + ?[Sized](../marker/trait.sized "trait std::marker::Sized"), B: ?[Sized](../marker/trait.sized "trait std::marker::Sized"),
[source](https://doc.rust-lang.org/src/core/slice/cmp.rs.html#21)### impl<A, B> PartialEq<[B]> for [A]where A: [PartialEq](trait.partialeq "trait std::cmp::PartialEq")<B>,
[source](https://doc.rust-lang.org/src/core/array/equality.rs.html#67)### impl<A, B, const N: usize> PartialEq<&[B]> for [A; N]where A: [PartialEq](trait.partialeq "trait std::cmp::PartialEq")<B>,
[source](https://doc.rust-lang.org/src/core/array/equality.rs.html#97)### impl<A, B, const N: usize> PartialEq<&mut [B]> for [A; N]where A: [PartialEq](trait.partialeq "trait std::cmp::PartialEq")<B>,
[source](https://doc.rust-lang.org/src/core/array/equality.rs.html#82)### impl<A, B, const N: usize> PartialEq<[A; N]> for &[B]where B: [PartialEq](trait.partialeq "trait std::cmp::PartialEq")<A>,
[source](https://doc.rust-lang.org/src/core/array/equality.rs.html#112)### impl<A, B, const N: usize> PartialEq<[A; N]> for &mut [B]where B: [PartialEq](trait.partialeq "trait std::cmp::PartialEq")<A>,
[source](https://doc.rust-lang.org/src/core/array/equality.rs.html#44)### impl<A, B, const N: usize> PartialEq<[A; N]> for [B]where B: [PartialEq](trait.partialeq "trait std::cmp::PartialEq")<A>,
[source](https://doc.rust-lang.org/src/core/array/equality.rs.html#6)### impl<A, B, const N: usize> PartialEq<[B; N]> for [A; N]where A: [PartialEq](trait.partialeq "trait std::cmp::PartialEq")<B>,
[source](https://doc.rust-lang.org/src/core/array/equality.rs.html#21)### impl<A, B, const N: usize> PartialEq<[B]> for [A; N]where A: [PartialEq](trait.partialeq "trait std::cmp::PartialEq")<B>,
[source](https://doc.rust-lang.org/src/core/ops/control_flow.rs.html#82)1.55.0 · ### impl<B, C> PartialEq<ControlFlow<B, C>> for ControlFlow<B, C>where B: [PartialEq](trait.partialeq "trait std::cmp::PartialEq")<B>, C: [PartialEq](trait.partialeq "trait std::cmp::PartialEq")<C>,
[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/hash/mod.rs.html#791)1.29.0 · ### impl<H> PartialEq<BuildHasherDefault<H>> for BuildHasherDefault<H>
[source](https://doc.rust-lang.org/src/core/ops/range.rs.html#78)### impl<Idx> PartialEq<Range<Idx>> for Range<Idx>where Idx: [PartialEq](trait.partialeq "trait std::cmp::PartialEq")<Idx>,
[source](https://doc.rust-lang.org/src/core/ops/range.rs.html#185)### impl<Idx> PartialEq<RangeFrom<Idx>> for RangeFrom<Idx>where Idx: [PartialEq](trait.partialeq "trait std::cmp::PartialEq")<Idx>,
[source](https://doc.rust-lang.org/src/core/ops/range.rs.html#339)1.26.0 · ### impl<Idx> PartialEq<RangeInclusive<Idx>> for RangeInclusive<Idx>where Idx: [PartialEq](trait.partialeq "trait std::cmp::PartialEq")<Idx>,
[source](https://doc.rust-lang.org/src/core/ops/range.rs.html#266)### impl<Idx> PartialEq<RangeTo<Idx>> for RangeTo<Idx>where Idx: [PartialEq](trait.partialeq "trait std::cmp::PartialEq")<Idx>,
[source](https://doc.rust-lang.org/src/core/ops/range.rs.html#584)1.26.0 · ### impl<Idx> PartialEq<RangeToInclusive<Idx>> for RangeToInclusive<Idx>where Idx: [PartialEq](trait.partialeq "trait std::cmp::PartialEq")<Idx>,
[source](https://doc.rust-lang.org/src/alloc/collections/btree/map.rs.html#2172)### impl<K, V, A> PartialEq<BTreeMap<K, V, A>> for BTreeMap<K, V, A>where K: [PartialEq](trait.partialeq "trait std::cmp::PartialEq")<K>, V: [PartialEq](trait.partialeq "trait std::cmp::PartialEq")<V>, A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator") + [Clone](../clone/trait.clone "trait std::clone::Clone"),
[source](https://doc.rust-lang.org/src/std/collections/hash/map.rs.html#1277-1290)### impl<K, V, S> PartialEq<HashMap<K, V, S>> for HashMap<K, V, S>where K: [Eq](trait.eq "trait std::cmp::Eq") + [Hash](../hash/trait.hash "trait std::hash::Hash"), V: [PartialEq](trait.partialeq "trait std::cmp::PartialEq"), S: [BuildHasher](../hash/trait.buildhasher "trait std::hash::BuildHasher"),
[source](https://doc.rust-lang.org/src/core/pin.rs.html#426)1.41.0 · ### impl<P, Q> PartialEq<Pin<Q>> for Pin<P>where P: [Deref](../ops/trait.deref "trait std::ops::Deref"), Q: [Deref](../ops/trait.deref "trait std::ops::Deref"), <P as [Deref](../ops/trait.deref "trait std::ops::Deref")>::[Target](../ops/trait.deref#associatedtype.Target "type std::ops::Deref::Target"): [PartialEq](trait.partialeq "trait std::cmp::PartialEq")<<Q as [Deref](../ops/trait.deref "trait std::ops::Deref")>::[Target](../ops/trait.deref#associatedtype.Target "type std::ops::Deref::Target")>,
[source](https://doc.rust-lang.org/src/core/ptr/mod.rs.html#1949)1.4.0 · ### impl<Ret, T> PartialEq<fn(T) -> Ret> for fn (T₁, T₂, …, Tₙ) -> Ret
This trait is implemented for function pointers with up to twelve arguments.
[source](https://doc.rust-lang.org/src/core/ptr/mod.rs.html#1949)1.4.0 · ### impl<Ret, T> PartialEq<extern "C" fn(T) -> Ret> for extern "C" fn (T₁, T₂, …, Tₙ) -> Ret
This trait is implemented for function pointers with up to twelve arguments.
[source](https://doc.rust-lang.org/src/core/ptr/mod.rs.html#1949)1.4.0 · ### impl<Ret, T> PartialEq<extern "C" fn(T, ...) -> Ret> for extern "C" fn (T₁, T₂, …, Tₙ, ...) -> Ret
This trait is implemented for function pointers with up to twelve arguments.
[source](https://doc.rust-lang.org/src/core/ptr/mod.rs.html#1949)1.4.0 · ### impl<Ret, T> PartialEq<unsafe fn(T) -> Ret> for unsafe fn (T₁, T₂, …, Tₙ) -> Ret
This trait is implemented for function pointers with up to twelve arguments.
[source](https://doc.rust-lang.org/src/core/ptr/mod.rs.html#1949)1.4.0 · ### impl<Ret, T> PartialEq<unsafe extern "C" fn(T) -> Ret> for unsafe extern "C" fn (T₁, T₂, …, Tₙ) -> Ret
This trait is implemented for function pointers with up to twelve arguments.
[source](https://doc.rust-lang.org/src/core/ptr/mod.rs.html#1949)1.4.0 · ### impl<Ret, T> PartialEq<unsafe extern "C" fn(T, ...) -> Ret> for unsafe extern "C" fn (T₁, T₂, …, Tₙ, ...) -> Ret
This trait is implemented for function pointers with up to twelve arguments.
[source](https://doc.rust-lang.org/src/core/ops/range.rs.html#664)1.17.0 · ### impl<T> PartialEq<Bound<T>> for Bound<T>where T: [PartialEq](trait.partialeq "trait std::cmp::PartialEq")<T>,
[source](https://doc.rust-lang.org/src/core/option.rs.html#515)### impl<T> PartialEq<Option<T>> for Option<T>where T: [PartialEq](trait.partialeq "trait std::cmp::PartialEq")<T>,
[source](https://doc.rust-lang.org/src/core/task/poll.rs.html#11)1.36.0 · ### impl<T> PartialEq<Poll<T>> for Poll<T>where T: [PartialEq](trait.partialeq "trait std::cmp::PartialEq")<T>,
[source](https://doc.rust-lang.org/src/core/ptr/const_ptr.rs.html#1491)### impl<T> PartialEq<\*const T> for \*const Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"),
[source](https://doc.rust-lang.org/src/core/ptr/mut_ptr.rs.html#1933)### impl<T> PartialEq<\*mut T> for \*mut Twhere T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"),
[source](https://doc.rust-lang.org/src/core/tuple.rs.html#159)### impl<T> PartialEq<(T,)> for (T₁, T₂, …, Tₙ)where T: [PartialEq](trait.partialeq "trait std::cmp::PartialEq")<T> + ?[Sized](../marker/trait.sized "trait std::marker::Sized"),
This trait is implemented for tuples up to twelve items long.
[source](https://doc.rust-lang.org/src/core/cell.rs.html#277)### impl<T> PartialEq<Cell<T>> for Cell<T>where T: [PartialEq](trait.partialeq "trait std::cmp::PartialEq")<T> + [Copy](../marker/trait.copy "trait std::marker::Copy"),
[source](https://doc.rust-lang.org/src/core/cell/once.rs.html#268)### impl<T> PartialEq<OnceCell<T>> for OnceCell<T>where T: [PartialEq](trait.partialeq "trait std::cmp::PartialEq")<T>,
[source](https://doc.rust-lang.org/src/core/cell.rs.html#1188)### impl<T> PartialEq<RefCell<T>> for RefCell<T>where T: [PartialEq](trait.partialeq "trait std::cmp::PartialEq")<T> + ?[Sized](../marker/trait.sized "trait std::marker::Sized"),
[source](https://doc.rust-lang.org/src/alloc/collections/linked_list.rs.html#1889)### impl<T> PartialEq<LinkedList<T>> for LinkedList<T>where T: [PartialEq](trait.partialeq "trait std::cmp::PartialEq")<T>,
[source](https://doc.rust-lang.org/src/core/marker.rs.html#680)### impl<T> PartialEq<PhantomData<T>> 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#1091)1.21.0 · ### impl<T> PartialEq<Discriminant<T>> for Discriminant<T>
[source](https://doc.rust-lang.org/src/core/mem/manually_drop.rs.html#48)1.20.0 · ### impl<T> PartialEq<ManuallyDrop<T>> for ManuallyDrop<T>where T: [PartialEq](trait.partialeq "trait std::cmp::PartialEq")<T> + ?[Sized](../marker/trait.sized "trait std::marker::Sized"),
[source](https://doc.rust-lang.org/src/core/num/saturating.rs.html#36)### impl<T> PartialEq<Saturating<T>> for Saturating<T>where T: [PartialEq](trait.partialeq "trait std::cmp::PartialEq")<T>,
[source](https://doc.rust-lang.org/src/core/num/wrapping.rs.html#40)### impl<T> PartialEq<Wrapping<T>> for Wrapping<T>where T: [PartialEq](trait.partialeq "trait std::cmp::PartialEq")<T>,
[source](https://doc.rust-lang.org/src/core/ptr/non_null.rs.html#735)1.25.0 · ### 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/alloc/rc.rs.html#1663)### impl<T> PartialEq<Rc<T>> for Rc<T>where T: [PartialEq](trait.partialeq "trait std::cmp::PartialEq")<T> + ?[Sized](../marker/trait.sized "trait std::marker::Sized"),
[source](https://doc.rust-lang.org/src/alloc/sync.rs.html#2258)### impl<T> PartialEq<Arc<T>> for Arc<T>where T: [PartialEq](trait.partialeq "trait std::cmp::PartialEq")<T> + ?[Sized](../marker/trait.sized "trait std::marker::Sized"),
[source](https://doc.rust-lang.org/src/core/cmp.rs.html#606)1.19.0 · ### impl<T> PartialEq<Reverse<T>> for Reverse<T>where T: [PartialEq](trait.partialeq "trait std::cmp::PartialEq")<T>,
[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](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/collections/btree/set.rs.html#96)### impl<T, A> PartialEq<BTreeSet<T, A>> for BTreeSet<T, A>where T: [PartialEq](trait.partialeq "trait std::cmp::PartialEq")<T>, 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/vec_deque/mod.rs.html#2850)### impl<T, A> PartialEq<VecDeque<T, A>> for VecDeque<T, A>where T: [PartialEq](trait.partialeq "trait std::cmp::PartialEq")<T>, A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"),
[source](https://doc.rust-lang.org/src/core/result.rs.html#500)### impl<T, E> PartialEq<Result<T, E>> for Result<T, E>where T: [PartialEq](trait.partialeq "trait std::cmp::PartialEq")<T>, E: [PartialEq](trait.partialeq "trait std::cmp::PartialEq")<E>,
[source](https://doc.rust-lang.org/src/std/collections/hash/set.rs.html#989-1001)### impl<T, S> PartialEq<HashSet<T, S>> for HashSet<T, S>where T: [Eq](trait.eq "trait std::cmp::Eq") + [Hash](../hash/trait.hash "trait std::hash::Hash"), S: [BuildHasher](../hash/trait.buildhasher "trait std::hash::BuildHasher"),
[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](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)### impl<T, U> PartialEq<&mut [U]> for Cow<'\_, [T]>where T: [PartialEq](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#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](trait.partialeq "trait std::cmp::PartialEq")<U>,
[source](https://doc.rust-lang.org/src/alloc/collections/vec_deque/mod.rs.html#2892)1.17.0 · ### impl<T, U, A> PartialEq<&[U]> for VecDeque<T, A>where A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), T: [PartialEq](trait.partialeq "trait std::cmp::PartialEq")<U>,
[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](trait.partialeq "trait std::cmp::PartialEq")<U>,
[source](https://doc.rust-lang.org/src/alloc/collections/vec_deque/mod.rs.html#2893)1.17.0 · ### impl<T, U, A> PartialEq<&mut [U]> for VecDeque<T, A>where A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), T: [PartialEq](trait.partialeq "trait std::cmp::PartialEq")<U>,
[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](trait.partialeq "trait std::cmp::PartialEq")<U>,
[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](trait.partialeq "trait std::cmp::PartialEq")<U>,
[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](trait.partialeq "trait std::cmp::PartialEq")<U>,
[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](trait.partialeq "trait std::cmp::PartialEq")<U>,
[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](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#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](trait.partialeq "trait std::cmp::PartialEq")<U>,
[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](trait.partialeq "trait std::cmp::PartialEq")<U>,
[source](https://doc.rust-lang.org/src/alloc/collections/vec_deque/mod.rs.html#2895)1.17.0 · ### impl<T, U, A, const N: usize> PartialEq<&[U; N]> for VecDeque<T, A>where A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), T: [PartialEq](trait.partialeq "trait std::cmp::PartialEq")<U>,
[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](trait.partialeq "trait std::cmp::PartialEq")<U>,
[source](https://doc.rust-lang.org/src/alloc/collections/vec_deque/mod.rs.html#2896)1.17.0 · ### impl<T, U, A, const N: usize> PartialEq<&mut [U; N]> for VecDeque<T, A>where A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), T: [PartialEq](trait.partialeq "trait std::cmp::PartialEq")<U>,
[source](https://doc.rust-lang.org/src/alloc/collections/vec_deque/mod.rs.html#2894)1.17.0 · ### impl<T, U, A, const N: usize> PartialEq<[U; N]> for VecDeque<T, A>where A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"), T: [PartialEq](trait.partialeq "trait std::cmp::PartialEq")<U>,
[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](trait.partialeq "trait std::cmp::PartialEq")<U>,
[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](../simd/trait.maskelement "trait std::simd::MaskElement") + [PartialEq](trait.partialeq "trait std::cmp::PartialEq")<T>, [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#499)### impl<T, const LANES: usize> PartialEq<Simd<T, LANES>> for Simd<T, LANES>where T: [SimdElement](../simd/trait.simdelement "trait std::simd::SimdElement") + [PartialEq](trait.partialeq "trait std::cmp::PartialEq")<T>, [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/sync/mpsc/mod.rs.html#629)### impl<T: PartialEq> PartialEq<TrySendError<T>> for TrySendError<T>
[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/sync/mpsc/mod.rs.html#573)### impl<T: PartialEq> PartialEq<SendError<T>> for SendError<T>
[source](https://doc.rust-lang.org/src/std/sync/once_lock.rs.html#419-423)### impl<T: PartialEq> PartialEq<OnceLock<T>> for OnceLock<T>
[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](trait.partialeq "trait std::cmp::PartialEq")<Y>, R: [PartialEq](trait.partialeq "trait std::cmp::PartialEq")<R>,
| programming_docs |
rust Function std::cmp::min_by_key Function std::cmp::min\_by\_key
===============================
```
pub fn min_by_key<T, F, K>(v1: T, v2: T, f: F) -> Twhere F: FnMut(&T) -> K, K: Ord,
```
Returns the element that gives the minimum value from the specified function.
Returns the first argument if the comparison determines them to be equal.
Examples
--------
```
use std::cmp;
assert_eq!(cmp::min_by_key(-2, 1, |x: &i32| x.abs()), 1);
assert_eq!(cmp::min_by_key(-2, 2, |x: &i32| x.abs()), -2);
```
rust Function std::cmp::max Function std::cmp::max
======================
```
pub fn max<T>(v1: T, v2: T) -> Twhere T: Ord,
```
Compares and returns the maximum of two values.
Returns the second argument if the comparison determines them to be equal.
Internally uses an alias to [`Ord::max`](trait.ord#method.max "Ord::max").
Examples
--------
```
use std::cmp;
assert_eq!(2, cmp::max(1, 2));
assert_eq!(2, cmp::max(2, 2));
```
rust Module std::u8 Module std::u8
==============
👎Deprecating in a future Rust version: all constants in this module replaced by associated constants on `u8`
Constants for the 8-bit unsigned integer type.
*[See also the `u8` primitive type](../primitive.u8 "u8").*
New code should use the associated constants directly on the primitive type.
Constants
---------
[MAX](constant.max "std::u8::MAX constant")Deprecation planned
The largest value that can be represented by this integer type. Use [`u8::MAX`](../primitive.u8#associatedconstant.MAX "u8::MAX") instead.
[MIN](constant.min "std::u8::MIN constant")Deprecation planned
The smallest value that can be represented by this integer type. Use [`u8::MIN`](../primitive.u8#associatedconstant.MIN "u8::MIN") instead.
rust Constant std::u8::MAX Constant std::u8::MAX
=====================
```
pub const MAX: u8 = u8::MAX; // 255u8
```
👎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 [`u8::MAX`](../primitive.u8#associatedconstant.MAX "u8::MAX") instead.
Examples
--------
```
// deprecated way
let max = std::u8::MAX;
// intended way
let max = u8::MAX;
```
rust Constant std::u8::MIN Constant std::u8::MIN
=====================
```
pub const MIN: u8 = u8::MIN; // 0u8
```
👎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 [`u8::MIN`](../primitive.u8#associatedconstant.MIN "u8::MIN") instead.
Examples
--------
```
// deprecated way
let min = std::u8::MIN;
// intended way
let min = u8::MIN;
```
rust Module std::pin Module std::pin
===============
Types that pin data to its location in memory.
It is sometimes useful to have objects that are guaranteed not to move, in the sense that their placement in memory does not change, and can thus be relied upon. A prime example of such a scenario would be building self-referential structs, as moving an object with pointers to itself will invalidate them, which could cause undefined behavior.
At a high level, a `[Pin](struct.pin "Pin")<P>` ensures that the pointee of any pointer type `P` has a stable location in memory, meaning it cannot be moved elsewhere and its memory cannot be deallocated until it gets dropped. We say that the pointee is “pinned”. Things get more subtle when discussing types that combine pinned with non-pinned data; [see below](#projections-and-structural-pinning) for more details.
By default, all types in Rust are movable. Rust allows passing all types by-value, and common smart-pointer types such as `[Box](../boxed/struct.box "Box")<T>` and `[&mut](../primitive.reference "mutable reference") T` allow replacing and moving the values they contain: you can move out of a `[Box](../boxed/struct.box "Box")<T>`, or you can use [`mem::swap`](../mem/fn.swap "mem::swap"). `[Pin](struct.pin "Pin")<P>` wraps a pointer type `P`, so `[Pin](struct.pin "Pin")<[Box](../boxed/struct.box "Box")<T>>` functions much like a regular `[Box](../boxed/struct.box "Box")<T>`: when a `[Pin](struct.pin "Pin")<[Box](../boxed/struct.box "Box")<T>>` gets dropped, so do its contents, and the memory gets deallocated. Similarly, `[Pin](struct.pin "Pin")<[&mut](../primitive.reference "mutable reference") T>` is a lot like `[&mut](../primitive.reference "mutable reference") T`. However, `[Pin](struct.pin "Pin")<P>` does not let clients actually obtain a `[Box](../boxed/struct.box "Box")<T>` or `[&mut](../primitive.reference "mutable reference") T` to pinned data, which implies that you cannot use operations such as [`mem::swap`](../mem/fn.swap "mem::swap"):
```
use std::pin::Pin;
fn swap_pins<T>(x: Pin<&mut T>, y: Pin<&mut T>) {
// `mem::swap` needs `&mut T`, but we cannot get it.
// We are stuck, we cannot swap the contents of these references.
// We could use `Pin::get_unchecked_mut`, but that is unsafe for a reason:
// we are not allowed to use it for moving things out of the `Pin`.
}
```
It is worth reiterating that `[Pin](struct.pin "Pin")<P>` does *not* change the fact that a Rust compiler considers all types movable. [`mem::swap`](../mem/fn.swap "mem::swap") remains callable for any `T`. Instead, `[Pin](struct.pin "Pin")<P>` prevents certain *values* (pointed to by pointers wrapped in `[Pin](struct.pin "Pin")<P>`) from being moved by making it impossible to call methods that require `[&mut](../primitive.reference "mutable reference") T` on them (like [`mem::swap`](../mem/fn.swap "mem::swap")).
`[Pin](struct.pin "Pin")<P>` can be used to wrap any pointer type `P`, and as such it interacts with [`Deref`](../ops/trait.deref "ops::Deref") and [`DerefMut`](../ops/trait.derefmut "ops::DerefMut"). A `[Pin](struct.pin "Pin")<P>` where `P: [Deref](../ops/trait.deref "ops::Deref")` should be considered as a “`P`-style pointer” to a pinned `P::[Target](../ops/trait.deref#associatedtype.Target "ops::Deref::Target")` – so, a `[Pin](struct.pin "Pin")<[Box](../boxed/struct.box "Box")<T>>` is an owned pointer to a pinned `T`, and a `[Pin](struct.pin "Pin")<[Rc](../rc/struct.rc "rc::Rc")<T>>` is a reference-counted pointer to a pinned `T`. For correctness, `[Pin](struct.pin "Pin")<P>` relies on the implementations of [`Deref`](../ops/trait.deref "ops::Deref") and [`DerefMut`](../ops/trait.derefmut "ops::DerefMut") not to move out of their `self` parameter, and only ever to return a pointer to pinned data when they are called on a pinned pointer.
`Unpin`
-------
Many types are always freely movable, even when pinned, because they do not rely on having a stable address. This includes all the basic types (like [`bool`](../primitive.bool "bool"), [`i32`](../primitive.i32 "i32"), and references) as well as types consisting solely of these types. Types that do not care about pinning implement the [`Unpin`](../marker/trait.unpin "Unpin") auto-trait, which cancels the effect of `[Pin](struct.pin "Pin")<P>`. For `T: [Unpin](../marker/trait.unpin "Unpin")`, `[Pin](struct.pin "Pin")<[Box](../boxed/struct.box "Box")<T>>` and `[Box](../boxed/struct.box "Box")<T>` function identically, as do `[Pin](struct.pin "Pin")<[&mut](../primitive.reference "mutable reference") T>` and `[&mut](../primitive.reference "mutable reference") T`.
Note that pinning and [`Unpin`](../marker/trait.unpin "Unpin") only affect the pointed-to type `P::[Target](../ops/trait.deref#associatedtype.Target "ops::Deref::Target")`, not the pointer type `P` itself that got wrapped in `[Pin](struct.pin "Pin")<P>`. For example, whether or not `[Box](../boxed/struct.box "Box")<T>` is [`Unpin`](../marker/trait.unpin "Unpin") has no effect on the behavior of `[Pin](struct.pin "Pin")<[Box](../boxed/struct.box "Box")<T>>` (here, `T` is the pointed-to type).
Example: self-referential struct
--------------------------------
Before we go into more details to explain the guarantees and choices associated with `[Pin](struct.pin "Pin")<P>`, we discuss some examples for how it might be used. Feel free to [skip to where the theoretical discussion continues](#drop-guarantee).
```
use std::pin::Pin;
use std::marker::PhantomPinned;
use std::ptr::NonNull;
// This is a self-referential struct because the slice field points to the data field.
// We cannot inform the compiler about that with a normal reference,
// as this pattern cannot be described with the usual borrowing rules.
// Instead we use a raw pointer, though one which is known not to be null,
// as we know it's pointing at the string.
struct Unmovable {
data: String,
slice: NonNull<String>,
_pin: PhantomPinned,
}
impl Unmovable {
// To ensure the data doesn't move when the function returns,
// we place it in the heap where it will stay for the lifetime of the object,
// and the only way to access it would be through a pointer to it.
fn new(data: String) -> Pin<Box<Self>> {
let res = Unmovable {
data,
// we only create the pointer once the data is in place
// otherwise it will have already moved before we even started
slice: NonNull::dangling(),
_pin: PhantomPinned,
};
let mut boxed = Box::pin(res);
let slice = NonNull::from(&boxed.data);
// we know this is safe because modifying a field doesn't move the whole struct
unsafe {
let mut_ref: Pin<&mut Self> = Pin::as_mut(&mut boxed);
Pin::get_unchecked_mut(mut_ref).slice = slice;
}
boxed
}
}
let unmoved = Unmovable::new("hello".to_string());
// The pointer should point to the correct location,
// so long as the struct hasn't moved.
// Meanwhile, we are free to move the pointer around.
let mut still_unmoved = unmoved;
assert_eq!(still_unmoved.slice, NonNull::from(&still_unmoved.data));
// Since our type doesn't implement Unpin, this will fail to compile:
// let mut new_unmoved = Unmovable::new("world".to_string());
// std::mem::swap(&mut *still_unmoved, &mut *new_unmoved);
```
Example: intrusive doubly-linked list
-------------------------------------
In an intrusive doubly-linked list, the collection does not actually allocate the memory for the elements itself. Allocation is controlled by the clients, and elements can live on a stack frame that lives shorter than the collection does.
To make this work, every element has pointers to its predecessor and successor in the list. Elements can only be added when they are pinned, because moving the elements around would invalidate the pointers. Moreover, the [`Drop`](../ops/trait.drop "Drop") implementation of a linked list element will patch the pointers of its predecessor and successor to remove itself from the list.
Crucially, we have to be able to rely on [`drop`](../ops/trait.drop#tymethod.drop) being called. If an element could be deallocated or otherwise invalidated without calling [`drop`](../ops/trait.drop#tymethod.drop), the pointers into it from its neighboring elements would become invalid, which would break the data structure.
Therefore, pinning also comes with a [`drop`](../ops/trait.drop#tymethod.drop)-related guarantee.
`Drop` guarantee
-----------------
The purpose of pinning is to be able to rely on the placement of some data in memory. To make this work, not just moving the data is restricted; deallocating, repurposing, or otherwise invalidating the memory used to store the data is restricted, too. Concretely, for pinned data you have to maintain the invariant that *its memory will not get invalidated or repurposed from the moment it gets pinned until when [`drop`](../ops/trait.drop#tymethod.drop) is called*. Only once [`drop`](../ops/trait.drop#tymethod.drop) returns or panics, the memory may be reused.
Memory can be “invalidated” by deallocation, but also by replacing a `[Some](../option/enum.option#variant.Some "Some")(v)` by [`None`](../option/enum.option#variant.None "None"), or calling [`Vec::set_len`](../vec/struct.vec#method.set_len "Vec::set_len") to “kill” some elements off of a vector. It can be repurposed by using [`ptr::write`](../ptr/fn.write "ptr::write") to overwrite it without calling the destructor first. None of this is allowed for pinned data without calling [`drop`](../ops/trait.drop#tymethod.drop).
This is exactly the kind of guarantee that the intrusive linked list from the previous section needs to function correctly.
Notice that this guarantee does *not* mean that memory does not leak! It is still completely okay to not ever call [`drop`](../ops/trait.drop#tymethod.drop) on a pinned element (e.g., you can still call [`mem::forget`](../mem/fn.forget "mem::forget") on a `[Pin](struct.pin "Pin")<[Box](../boxed/struct.box "Box")<T>>`). In the example of the doubly-linked list, that element would just stay in the list. However you must not free or reuse the storage *without calling [`drop`](../ops/trait.drop#tymethod.drop)*.
`Drop` implementation
----------------------
If your type uses pinning (such as the two examples above), you have to be careful when implementing [`Drop`](../ops/trait.drop "Drop"). The [`drop`](../ops/trait.drop#tymethod.drop) function takes `[&mut](../primitive.reference "mutable reference") self`, but this is called *even if your type was previously pinned*! It is as if the compiler automatically called [`Pin::get_unchecked_mut`](struct.pin#method.get_unchecked_mut "Pin::get_unchecked_mut").
This can never cause a problem in safe code because implementing a type that relies on pinning requires unsafe code, but be aware that deciding to make use of pinning in your type (for example by implementing some operation on `[Pin](struct.pin "Pin")<[&](../primitive.reference "shared reference")Self>` or `[Pin](struct.pin "Pin")<[&mut](../primitive.reference "mutable reference") Self>`) has consequences for your [`Drop`](../ops/trait.drop "Drop") implementation as well: if an element of your type could have been pinned, you must treat [`Drop`](../ops/trait.drop "Drop") as implicitly taking `[Pin](struct.pin "Pin")<[&mut](../primitive.reference "mutable reference") Self>`.
For example, you could implement [`Drop`](../ops/trait.drop "Drop") as follows:
```
impl Drop for Type {
fn drop(&mut self) {
// `new_unchecked` is okay because we know this value is never used
// again after being dropped.
inner_drop(unsafe { Pin::new_unchecked(self)});
fn inner_drop(this: Pin<&mut Type>) {
// Actual drop code goes here.
}
}
}
```
The function `inner_drop` has the type that [`drop`](../ops/trait.drop#tymethod.drop) *should* have, so this makes sure that you do not accidentally use `self`/`this` in a way that is in conflict with pinning.
Moreover, if your type is `#[repr(packed)]`, the compiler will automatically move fields around to be able to drop them. It might even do that for fields that happen to be sufficiently aligned. As a consequence, you cannot use pinning with a `#[repr(packed)]` type.
Projections and Structural Pinning
----------------------------------
When working with pinned structs, the question arises how one can access the fields of that struct in a method that takes just `[Pin](struct.pin "Pin")<[&mut](../primitive.reference "mutable reference") Struct>`. The usual approach is to write helper methods (so called *projections*) that turn `[Pin](struct.pin "Pin")<[&mut](../primitive.reference "mutable reference") Struct>` into a reference to the field, but what type should that reference have? Is it `[Pin](struct.pin "Pin")<[&mut](../primitive.reference "mutable reference") Field>` or `[&mut](../primitive.reference "mutable reference") Field`? The same question arises with the fields of an `enum`, and also when considering container/wrapper types such as `[Vec](../vec/struct.vec "Vec")<T>`, `[Box](../boxed/struct.box "Box")<T>`, or `[RefCell](../cell/struct.refcell "cell::RefCell")<T>`. (This question applies to both mutable and shared references, we just use the more common case of mutable references here for illustration.)
It turns out that it is actually up to the author of the data structure to decide whether the pinned projection for a particular field turns `[Pin](struct.pin "Pin")<[&mut](../primitive.reference "mutable reference") Struct>` into `[Pin](struct.pin "Pin")<[&mut](../primitive.reference "mutable reference") Field>` or `[&mut](../primitive.reference "mutable reference") Field`. There are some constraints though, and the most important constraint is *consistency*: every field can be *either* projected to a pinned reference, *or* have pinning removed as part of the projection. If both are done for the same field, that will likely be unsound!
As the author of a data structure you get to decide for each field whether pinning “propagates” to this field or not. Pinning that propagates is also called “structural”, because it follows the structure of the type. In the following subsections, we describe the considerations that have to be made for either choice.
### Pinning *is not* structural for `field`
It may seem counter-intuitive that the field of a pinned struct might not be pinned, but that is actually the easiest choice: if a `[Pin](struct.pin "Pin")<[&mut](../primitive.reference "mutable reference") Field>` is never created, nothing can go wrong! So, if you decide that some field does not have structural pinning, all you have to ensure is that you never create a pinned reference to that field.
Fields without structural pinning may have a projection method that turns `[Pin](struct.pin "Pin")<[&mut](../primitive.reference "mutable reference") Struct>` into `[&mut](../primitive.reference "mutable reference") Field`:
```
impl Struct {
fn pin_get_field(self: Pin<&mut Self>) -> &mut Field {
// This is okay because `field` is never considered pinned.
unsafe { &mut self.get_unchecked_mut().field }
}
}
```
You may also `impl [Unpin](../marker/trait.unpin "Unpin") for Struct` *even if* the type of `field` is not [`Unpin`](../marker/trait.unpin "Unpin"). What that type thinks about pinning is not relevant when no `[Pin](struct.pin "Pin")<[&mut](../primitive.reference "mutable reference") Field>` is ever created.
### Pinning *is* structural for `field`
The other option is to decide that pinning is “structural” for `field`, meaning that if the struct is pinned then so is the field.
This allows writing a projection that creates a `[Pin](struct.pin "Pin")<[&mut](../primitive.reference "mutable reference") Field>`, thus witnessing that the field is pinned:
```
impl Struct {
fn pin_get_field(self: Pin<&mut Self>) -> Pin<&mut Field> {
// This is okay because `field` is pinned when `self` is.
unsafe { self.map_unchecked_mut(|s| &mut s.field) }
}
}
```
However, structural pinning comes with a few extra requirements:
1. The struct must only be [`Unpin`](../marker/trait.unpin "Unpin") if all the structural fields are [`Unpin`](../marker/trait.unpin "Unpin"). This is the default, but [`Unpin`](../marker/trait.unpin "Unpin") is a safe trait, so as the author of the struct it is your responsibility *not* to add something like `impl<T> [Unpin](../marker/trait.unpin "Unpin") for Struct<T>`. (Notice that adding a projection operation requires unsafe code, so the fact that [`Unpin`](../marker/trait.unpin "Unpin") is a safe trait does not break the principle that you only have to worry about any of this if you use [`unsafe`](../keyword.unsafe "keyword unsafe").)
2. The destructor of the struct must not move structural fields out of its argument. This is the exact point that was raised in the [previous section](#drop-implementation): [`drop`](../ops/trait.drop#tymethod.drop) takes `[&mut](../primitive.reference "mutable reference") self`, but the struct (and hence its fields) might have been pinned before. You have to guarantee that you do not move a field inside your [`Drop`](../ops/trait.drop "Drop") implementation. In particular, as explained previously, this means that your struct must *not* be `#[repr(packed)]`. See that section for how to write [`drop`](../ops/trait.drop#tymethod.drop) in a way that the compiler can help you not accidentally break pinning.
3. You must make sure that you uphold the [`Drop` guarantee](#drop-guarantee): once your struct is pinned, the memory that contains the content is not overwritten or deallocated without calling the content’s destructors. This can be tricky, as witnessed by `[VecDeque](../collections/struct.vecdeque "collections::VecDeque")<T>`: the destructor of `[VecDeque](../collections/struct.vecdeque "collections::VecDeque")<T>` can fail to call [`drop`](../ops/trait.drop#tymethod.drop) on all elements if one of the destructors panics. This violates the [`Drop`](../ops/trait.drop "Drop") guarantee, because it can lead to elements being deallocated without their destructor being called. (`[VecDeque](../collections/struct.vecdeque "collections::VecDeque")<T>` has no pinning projections, so this does not cause unsoundness.)
4. You must not offer any other operations that could lead to data being moved out of the structural fields when your type is pinned. For example, if the struct contains an `[Option](../option/enum.option "Option")<T>` and there is a [`take`](../option/enum.option#method.take "Option::take")-like operation with type `fn([Pin](struct.pin "Pin")<[&mut](../primitive.reference "mutable reference") Struct<T>>) -> [Option](../option/enum.option "Option")<T>`, that operation can be used to move a `T` out of a pinned `Struct<T>` – which means pinning cannot be structural for the field holding this data.
For a more complex example of moving data out of a pinned type, imagine if `[RefCell](../cell/struct.refcell "cell::RefCell")<T>` had a method `fn get_pin_mut(self: [Pin](struct.pin "Pin")<[&mut](../primitive.reference "mutable reference") Self>) -> [Pin](struct.pin "Pin")<[&mut](../primitive.reference "mutable reference") T>`. Then we could do the following:
ⓘ
```
fn exploit_ref_cell<T>(rc: Pin<&mut RefCell<T>>) {
{ let p = rc.as_mut().get_pin_mut(); } // Here we get pinned access to the `T`.
let rc_shr: &RefCell<T> = rc.into_ref().get_ref();
let b = rc_shr.borrow_mut();
let content = &mut *b; // And here we have `&mut T` to the same data.
}
```
This is catastrophic, it means we can first pin the content of the `[RefCell](../cell/struct.refcell "cell::RefCell")<T>` (using `[RefCell](../cell/struct.refcell "cell::RefCell")::get_pin_mut`) and then move that content using the mutable reference we got later.
### Examples
For a type like `[Vec](../vec/struct.vec "Vec")<T>`, both possibilities (structural pinning or not) make sense. A `[Vec](../vec/struct.vec "Vec")<T>` with structural pinning could have `get_pin`/`get_pin_mut` methods to get pinned references to elements. However, it could *not* allow calling [`pop`](../vec/struct.vec#method.pop "Vec::pop") on a pinned `[Vec](../vec/struct.vec "Vec")<T>` because that would move the (structurally pinned) contents! Nor could it allow [`push`](../vec/struct.vec#method.push "Vec::push"), which might reallocate and thus also move the contents.
A `[Vec](../vec/struct.vec "Vec")<T>` without structural pinning could `impl<T> [Unpin](../marker/trait.unpin "Unpin") for [Vec](../vec/struct.vec "Vec")<T>`, because the contents are never pinned and the `[Vec](../vec/struct.vec "Vec")<T>` itself is fine with being moved as well. At that point pinning just has no effect on the vector at all.
In the standard library, pointer types generally do not have structural pinning, and thus they do not offer pinning projections. This is why `[Box](../boxed/struct.box "Box")<T>: [Unpin](../marker/trait.unpin "Unpin")` holds for all `T`. It makes sense to do this for pointer types, because moving the `[Box](../boxed/struct.box "Box")<T>` does not actually move the `T`: the `[Box](../boxed/struct.box "Box")<T>` can be freely movable (aka [`Unpin`](../marker/trait.unpin "Unpin")) even if the `T` is not. In fact, even `[Pin](struct.pin "Pin")<[Box](../boxed/struct.box "Box")<T>>` and `[Pin](struct.pin "Pin")<[&mut](../primitive.reference "mutable reference") T>` are always [`Unpin`](../marker/trait.unpin "Unpin") themselves, for the same reason: their contents (the `T`) are pinned, but the pointers themselves can be moved without moving the pinned data. For both `[Box](../boxed/struct.box "Box")<T>` and `[Pin](struct.pin "Pin")<[Box](../boxed/struct.box "Box")<T>>`, whether the content is pinned is entirely independent of whether the pointer is pinned, meaning pinning is *not* structural.
When implementing a [`Future`](../future/trait.future "future::Future") combinator, you will usually need structural pinning for the nested futures, as you need to get pinned references to them to call [`poll`](../future/trait.future#tymethod.poll "future::Future::poll"). But if your combinator contains any other data that does not need to be pinned, you can make those fields not structural and hence freely access them with a mutable reference even when you just have `[Pin](struct.pin "Pin")<[&mut](../primitive.reference "mutable reference") Self>` (such as in your own [`poll`](../future/trait.future#tymethod.poll "future::Future::poll") implementation).
Macros
------
[pin](macro.pin "std::pin::pin macro")Experimental
Constructs a `[Pin](struct.pin "Pin")<[&mut](../primitive.reference "&mut") T>`, by pinning[1](#1) a `value: T` *locally*[2](#2).
Structs
-------
[Pin](struct.pin "std::pin::Pin struct")
A pinned pointer.
| programming_docs |
rust Struct std::pin::Pin Struct std::pin::Pin
====================
```
#[repr(transparent)]pub struct Pin<P> { /* private fields */ }
```
A pinned pointer.
This is a wrapper around a kind of pointer which makes that pointer “pin” its value in place, preventing the value referenced by that pointer from being moved unless it implements [`Unpin`](../marker/trait.unpin "Unpin").
*See the [`pin` module](index) documentation for an explanation of pinning.*
Implementations
---------------
[source](https://doc.rust-lang.org/src/core/pin.rs.html#482)### impl<P> Pin<P>where P: [Deref](../ops/trait.deref "trait std::ops::Deref"), <P as [Deref](../ops/trait.deref "trait std::ops::Deref")>::[Target](../ops/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/pin.rs.html#491)const: [unstable](https://github.com/rust-lang/rust/issues/76654 "Tracking issue for const_pin") · #### pub fn new(pointer: P) -> Pin<P>
Notable traits for [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;
```
Construct a new `Pin<P>` around a pointer to some data of a type that implements [`Unpin`](../marker/trait.unpin "Unpin").
Unlike `Pin::new_unchecked`, this method is safe because the pointer `P` dereferences to an [`Unpin`](../marker/trait.unpin "Unpin") type, which cancels the pinning guarantees.
[source](https://doc.rust-lang.org/src/core/pin.rs.html#504)1.39.0 (const: [unstable](https://github.com/rust-lang/rust/issues/76654 "Tracking issue for const_pin")) · #### pub fn into\_inner(pin: Pin<P>) -> P
Unwraps this `Pin<P>` returning the underlying pointer.
This requires that the data inside this `Pin` is [`Unpin`](../marker/trait.unpin "Unpin") so that we can ignore the pinning invariants when unwrapping it.
[source](https://doc.rust-lang.org/src/core/pin.rs.html#509)### impl<P> Pin<P>where P: [Deref](../ops/trait.deref "trait std::ops::Deref"),
[source](https://doc.rust-lang.org/src/core/pin.rs.html#578)const: [unstable](https://github.com/rust-lang/rust/issues/76654 "Tracking issue for const_pin") · #### pub unsafe fn new\_unchecked(pointer: P) -> Pin<P>
Notable traits for [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;
```
Construct a new `Pin<P>` around a reference to some data of a type that may or may not implement `Unpin`.
If `pointer` dereferences to an `Unpin` type, `Pin::new` should be used instead.
##### Safety
This constructor is unsafe because we cannot guarantee that the data pointed to by `pointer` is pinned, meaning that the data will not be moved or its storage invalidated until it gets dropped. If the constructed `Pin<P>` does not guarantee that the data `P` points to is pinned, that is a violation of the API contract and may lead to undefined behavior in later (safe) operations.
By using this method, you are making a promise about the `P::Deref` and `P::DerefMut` implementations, if they exist. Most importantly, they must not move out of their `self` arguments: `Pin::as_mut` and `Pin::as_ref` will call `DerefMut::deref_mut` and `Deref::deref` *on the pinned pointer* and expect these methods to uphold the pinning invariants. Moreover, by calling this method you promise that the reference `P` dereferences to will not be moved out of again; in particular, it must not be possible to obtain a `&mut P::Target` and then move out of that reference (using, for example [`mem::swap`](../mem/fn.swap)).
For example, calling `Pin::new_unchecked` on an `&'a mut T` is unsafe because while you are able to pin it for the given lifetime `'a`, you have no control over whether it is kept pinned once `'a` ends:
```
use std::mem;
use std::pin::Pin;
fn move_pinned_ref<T>(mut a: T, mut b: T) {
unsafe {
let p: Pin<&mut T> = Pin::new_unchecked(&mut a);
// This should mean the pointee `a` can never move again.
}
mem::swap(&mut a, &mut b);
// The address of `a` changed to `b`'s stack slot, so `a` got moved even
// though we have previously pinned it! We have violated the pinning API contract.
}
```
A value, once pinned, must remain pinned forever (unless its type implements `Unpin`).
Similarly, calling `Pin::new_unchecked` on an `Rc<T>` is unsafe because there could be aliases to the same data that are not subject to the pinning restrictions:
```
use std::rc::Rc;
use std::pin::Pin;
fn move_pinned_rc<T>(mut x: Rc<T>) {
let pinned = unsafe { Pin::new_unchecked(Rc::clone(&x)) };
{
let p: Pin<&T> = pinned.as_ref();
// This should mean the pointee can never move again.
}
drop(pinned);
let content = Rc::get_mut(&mut x).unwrap();
// Now, if `x` was the only reference, we have a mutable reference to
// data that we pinned above, which we could use to move it as we have
// seen in the previous example. We have violated the pinning API contract.
}
```
[source](https://doc.rust-lang.org/src/core/pin.rs.html#591)#### pub fn as\_ref(&self) -> Pin<&<P as Deref>::Target>
Notable traits for [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;
```
Gets a pinned shared reference from this pinned pointer.
This is a generic method to go from `&Pin<Pointer<T>>` to `Pin<&T>`. It is safe because, as part of the contract of `Pin::new_unchecked`, the pointee cannot move after `Pin<Pointer<T>>` got created. “Malicious” implementations of `Pointer::Deref` are likewise ruled out by the contract of `Pin::new_unchecked`.
[source](https://doc.rust-lang.org/src/core/pin.rs.html#612)1.39.0 (const: [unstable](https://github.com/rust-lang/rust/issues/76654 "Tracking issue for const_pin")) · #### pub unsafe fn into\_inner\_unchecked(pin: Pin<P>) -> P
Unwraps this `Pin<P>` returning the underlying pointer.
##### Safety
This function is unsafe. You must guarantee that you will continue to treat the pointer `P` as pinned after you call this function, so that the invariants on the `Pin` type can be upheld. If the code using the resulting `P` does not continue to maintain the pinning invariants that is a violation of the API contract and may lead to undefined behavior in later (safe) operations.
If the underlying data is [`Unpin`](../marker/trait.unpin "Unpin"), [`Pin::into_inner`](struct.pin#method.into_inner "Pin::into_inner") should be used instead.
[source](https://doc.rust-lang.org/src/core/pin.rs.html#617)### impl<P> Pin<P>where P: [DerefMut](../ops/trait.derefmut "trait std::ops::DerefMut"),
[source](https://doc.rust-lang.org/src/core/pin.rs.html#648)#### pub fn as\_mut(&mut self) -> Pin<&mut <P as Deref>::Target>
Notable traits for [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;
```
Gets a pinned mutable reference from this pinned pointer.
This is a generic method to go from `&mut Pin<Pointer<T>>` to `Pin<&mut T>`. It is safe because, as part of the contract of `Pin::new_unchecked`, the pointee cannot move after `Pin<Pointer<T>>` got created. “Malicious” implementations of `Pointer::DerefMut` are likewise ruled out by the contract of `Pin::new_unchecked`.
This method is useful when doing multiple calls to functions that consume the pinned type.
##### Example
```
use std::pin::Pin;
impl Type {
fn method(self: Pin<&mut Self>) {
// do something
}
fn call_method_twice(mut self: Pin<&mut Self>) {
// `method` consumes `self`, so reborrow the `Pin<&mut Self>` via `as_mut`.
self.as_mut().method();
self.as_mut().method();
}
}
```
[source](https://doc.rust-lang.org/src/core/pin.rs.html#659-661)#### pub fn set(&mut self, value: <P as Deref>::Target)where <P as [Deref](../ops/trait.deref "trait std::ops::Deref")>::[Target](../ops/trait.deref#associatedtype.Target "type std::ops::Deref::Target"): [Sized](../marker/trait.sized "trait std::marker::Sized"),
Assigns a new value to the memory behind the pinned reference.
This overwrites pinned data, but that is okay: its destructor gets run before being overwritten, so no pinning guarantee is violated.
[source](https://doc.rust-lang.org/src/core/pin.rs.html#667)### impl<'a, T> Pin<&'a T>where T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"),
[source](https://doc.rust-lang.org/src/core/pin.rs.html#684-687)#### pub unsafe fn map\_unchecked<U, F>(self, func: F) -> Pin<&'a 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"),
Notable traits for [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 by mapping the interior value.
For example, if you wanted to get a `Pin` of a field of something, you could use this to get access to that field in one line of code. However, there are several gotchas with these “pinning projections”; see the [`pin` module](index#projections-and-structural-pinning) documentation for further details on that topic.
##### Safety
This function is unsafe. You must guarantee that the data you return will not move so long as the argument value does not move (for example, because it is one of the fields of that value), and also that you do not move out of the argument you receive to the interior function.
[source](https://doc.rust-lang.org/src/core/pin.rs.html#718)const: [unstable](https://github.com/rust-lang/rust/issues/76654 "Tracking issue for const_pin") · #### pub fn get\_ref(self) -> &'a T
Gets a shared reference out of a pin.
This is safe because it is not possible to move out of a shared reference. It may seem like there is an issue here with interior mutability: in fact, it *is* possible to move a `T` out of a `&RefCell<T>`. However, this is not a problem as long as there does not also exist a `Pin<&T>` pointing to the same data, and `RefCell<T>` does not let you create a pinned reference to its contents. See the discussion on [“pinning projections”](index#projections-and-structural-pinning) for further details.
Note: `Pin` also implements `Deref` to the target, which can be used to access the inner value. However, `Deref` only provides a reference that lives for as long as the borrow of the `Pin`, not the lifetime of the `Pin` itself. This method allows turning the `Pin` into a reference with the same lifetime as the original `Pin`.
[source](https://doc.rust-lang.org/src/core/pin.rs.html#723)### impl<'a, T> Pin<&'a mut T>where T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"),
[source](https://doc.rust-lang.org/src/core/pin.rs.html#729)const: [unstable](https://github.com/rust-lang/rust/issues/76654 "Tracking issue for const_pin") · #### pub fn into\_ref(self) -> Pin<&'a T>
Notable traits for [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 this `Pin<&mut T>` into a `Pin<&T>` with the same lifetime.
[source](https://doc.rust-lang.org/src/core/pin.rs.html#746-748)const: [unstable](https://github.com/rust-lang/rust/issues/76654 "Tracking issue for const_pin") · #### pub fn get\_mut(self) -> &'a mut Twhere T: [Unpin](../marker/trait.unpin "trait std::marker::Unpin"),
Gets a mutable reference to the data inside of this `Pin`.
This requires that the data inside this `Pin` is `Unpin`.
Note: `Pin` also implements `DerefMut` to the data, which can be used to access the inner value. However, `DerefMut` only provides a reference that lives for as long as the borrow of the `Pin`, not the lifetime of the `Pin` itself. This method allows turning the `Pin` into a reference with the same lifetime as the original `Pin`.
[source](https://doc.rust-lang.org/src/core/pin.rs.html#767)const: [unstable](https://github.com/rust-lang/rust/issues/76654 "Tracking issue for const_pin") · #### pub unsafe fn get\_unchecked\_mut(self) -> &'a mut T
Gets a mutable reference to the data inside of this `Pin`.
##### Safety
This function is unsafe. You must guarantee that you will never move the data out of the mutable reference you receive when you call this function, so that the invariants on the `Pin` type can be upheld.
If the underlying data is `Unpin`, `Pin::get_mut` should be used instead.
[source](https://doc.rust-lang.org/src/core/pin.rs.html#788-791)#### pub unsafe fn map\_unchecked\_mut<U, F>(self, func: F) -> Pin<&'a mut 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"),
Notable traits for [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;
```
Construct a new pin by mapping the interior value.
For example, if you wanted to get a `Pin` of a field of something, you could use this to get access to that field in one line of code. However, there are several gotchas with these “pinning projections”; see the [`pin` module](index#projections-and-structural-pinning) documentation for further details on that topic.
##### Safety
This function is unsafe. You must guarantee that the data you return will not move so long as the argument value does not move (for example, because it is one of the fields of that value), and also that you do not move out of the argument you receive to the interior function.
[source](https://doc.rust-lang.org/src/core/pin.rs.html#803)### impl<T> Pin<&'static T>where T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"),
[source](https://doc.rust-lang.org/src/core/pin.rs.html#810)1.61.0 (const: [unstable](https://github.com/rust-lang/rust/issues/76654 "Tracking issue for const_pin")) · #### pub fn static\_ref(r: &'static T) -> Pin<&'static T>
Notable traits for [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;
```
Get a pinned reference from a static reference.
This is safe, because `T` is borrowed for the `'static` lifetime, which never ends.
[source](https://doc.rust-lang.org/src/core/pin.rs.html#817)### impl<'a, P> Pin<&'a mut Pin<P>>where P: [DerefMut](../ops/trait.derefmut "trait std::ops::DerefMut"),
[source](https://doc.rust-lang.org/src/core/pin.rs.html#828)#### pub fn as\_deref\_mut(self) -> Pin<&'a mut <P as Deref>::Target>
Notable traits for [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. (`pin_deref_mut` [#86918](https://github.com/rust-lang/rust/issues/86918))
Gets a pinned mutable reference from this nested pinned pointer.
This is a generic method to go from `Pin<&mut Pin<Pointer<T>>>` to `Pin<&mut T>`. It is safe because the existence of a `Pin<Pointer<T>>` ensures that the pointee, `T`, cannot move in the future, and this method does not enable the pointee to move. “Malicious” implementations of `P::DerefMut` are likewise ruled out by the contract of `Pin::new_unchecked`.
[source](https://doc.rust-lang.org/src/core/pin.rs.html#856)### impl<T> Pin<&'static mut T>where T: ?[Sized](../marker/trait.sized "trait std::marker::Sized"),
[source](https://doc.rust-lang.org/src/core/pin.rs.html#863)1.61.0 (const: [unstable](https://github.com/rust-lang/rust/issues/76654 "Tracking issue for const_pin")) · #### pub fn static\_mut(r: &'static mut T) -> Pin<&'static mut T>
Notable traits for [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;
```
Get a pinned mutable reference from a static mutable reference.
This is safe, because `T` is borrowed for the `'static` lifetime, which never ends.
Trait Implementations
---------------------
[source](https://doc.rust-lang.org/src/core/async_iter/async_iter.rs.html#97)### impl<P> AsyncIterator for Pin<P>where P: [DerefMut](../ops/trait.derefmut "trait std::ops::DerefMut"), <P as [Deref](../ops/trait.deref "trait std::ops::Deref")>::[Target](../ops/trait.deref#associatedtype.Target "type std::ops::Deref::Target"): [AsyncIterator](../async_iter/trait.asynciterator "trait std::async_iter::AsyncIterator"),
#### type Item = <<P as Deref>::Target 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/async_iter/async_iter.rs.html#104)#### fn poll\_next( self: Pin<&mut Pin<P>>, cx: &mut Context<'\_>) -> Poll<Option<<Pin<P> 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/async_iter/async_iter.rs.html#108)#### 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/pin.rs.html#407)### impl<P> Clone for Pin<P>where P: [Clone](../clone/trait.clone "trait std::clone::Clone"),
[source](https://doc.rust-lang.org/src/core/pin.rs.html#407)#### fn clone(&self) -> Pin<P>
Notable traits for [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;
```
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/pin.rs.html#889)### impl<P> Debug for Pin<P>where P: [Debug](../fmt/trait.debug "trait std::fmt::Debug"),
[source](https://doc.rust-lang.org/src/core/pin.rs.html#890)#### 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/pin.rs.html#871)### impl<P> Deref for Pin<P>where P: [Deref](../ops/trait.deref "trait std::ops::Deref"),
#### type Target = <P as Deref>::Target
The resulting type after dereferencing.
[source](https://doc.rust-lang.org/src/core/pin.rs.html#873)#### fn deref(&self) -> &<P as Deref>::Target
Dereferences the value.
[source](https://doc.rust-lang.org/src/core/pin.rs.html#879)### impl<P> DerefMut for Pin<P>where P: [DerefMut](../ops/trait.derefmut "trait std::ops::DerefMut"), <P as [Deref](../ops/trait.deref "trait std::ops::Deref")>::[Target](../ops/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/pin.rs.html#880)#### fn deref\_mut(&mut self) -> &mut <P as Deref>::Target
Mutably dereferences the value.
[source](https://doc.rust-lang.org/src/core/pin.rs.html#896)### impl<P> Display for Pin<P>where P: [Display](../fmt/trait.display "trait std::fmt::Display"),
[source](https://doc.rust-lang.org/src/core/pin.rs.html#897)#### 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#1462)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](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`](../boxed/struct.box#method.into_pin "Box::into_pin").
Constructing and pinning a `Box` with `<Pin<Box<T>>>::from([Box::new](../boxed/struct.box#method.new "Box::new")(x))` can also be written more concisely using `[Box::pin](../boxed/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`](../boxed/struct.box#method.new "Box::new").
[source](https://doc.rust-lang.org/src/core/future/future.rs.html#117)1.36.0 · ### impl<P> Future for Pin<P>where P: [DerefMut](../ops/trait.derefmut "trait std::ops::DerefMut"), <P as [Deref](../ops/trait.deref "trait std::ops::Deref")>::[Target](../ops/trait.deref#associatedtype.Target "type std::ops::Deref::Target"): [Future](../future/trait.future "trait std::future::Future"),
#### type Output = <<P as Deref>::Target as Future>::Output
The type of value produced on completion.
[source](https://doc.rust-lang.org/src/core/future/future.rs.html#123)#### fn poll( self: Pin<&mut Pin<P>>, cx: &mut Context<'\_>) -> Poll<<Pin<P> 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/ops/generator.rs.html#119)### impl<G, R> Generator<R> for Pin<&mut G>where G: [Generator](../ops/trait.generator "trait std::ops::Generator")<R> + ?[Sized](../marker/trait.sized "trait std::marker::Sized"),
#### 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/core/ops/generator.rs.html#123)#### fn resume( self: Pin<&mut Pin<&mut G>>, arg: R) -> GeneratorState<<Pin<&mut G> as Generator<R>>::Yield, <Pin<&mut G> 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/core/pin.rs.html#476)1.41.0 · ### impl<P> Hash for Pin<P>where P: [Deref](../ops/trait.deref "trait std::ops::Deref"), <P as [Deref](../ops/trait.deref "trait std::ops::Deref")>::[Target](../ops/trait.deref#associatedtype.Target "type std::ops::Deref::Target"): [Hash](../hash/trait.hash "trait std::hash::Hash"),
[source](https://doc.rust-lang.org/src/core/pin.rs.html#477)#### 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/pin.rs.html#469)1.41.0 · ### impl<P> Ord for Pin<P>where P: [Deref](../ops/trait.deref "trait std::ops::Deref"), <P as [Deref](../ops/trait.deref "trait std::ops::Deref")>::[Target](../ops/trait.deref#associatedtype.Target "type std::ops::Deref::Target"): [Ord](../cmp/trait.ord "trait std::cmp::Ord"),
[source](https://doc.rust-lang.org/src/core/pin.rs.html#470)#### fn cmp(&self, other: &Pin<P>) -> 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/pin.rs.html#426)1.41.0 · ### impl<P, Q> PartialEq<Pin<Q>> for Pin<P>where P: [Deref](../ops/trait.deref "trait std::ops::Deref"), Q: [Deref](../ops/trait.deref "trait std::ops::Deref"), <P as [Deref](../ops/trait.deref "trait std::ops::Deref")>::[Target](../ops/trait.deref#associatedtype.Target "type std::ops::Deref::Target"): [PartialEq](../cmp/trait.partialeq "trait std::cmp::PartialEq")<<Q as [Deref](../ops/trait.deref "trait std::ops::Deref")>::[Target](../ops/trait.deref#associatedtype.Target "type std::ops::Deref::Target")>,
[source](https://doc.rust-lang.org/src/core/pin.rs.html#430)#### fn eq(&self, other: &Pin<Q>) -> 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/pin.rs.html#434)#### fn ne(&self, other: &Pin<Q>) -> 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/pin.rs.html#443)1.41.0 · ### impl<P, Q> PartialOrd<Pin<Q>> for Pin<P>where P: [Deref](../ops/trait.deref "trait std::ops::Deref"), Q: [Deref](../ops/trait.deref "trait std::ops::Deref"), <P as [Deref](../ops/trait.deref "trait std::ops::Deref")>::[Target](../ops/trait.deref#associatedtype.Target "type std::ops::Deref::Target"): [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<<Q as [Deref](../ops/trait.deref "trait std::ops::Deref")>::[Target](../ops/trait.deref#associatedtype.Target "type std::ops::Deref::Target")>,
[source](https://doc.rust-lang.org/src/core/pin.rs.html#447)#### fn partial\_cmp(&self, other: &Pin<Q>) -> 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/pin.rs.html#451)#### fn lt(&self, other: &Pin<Q>) -> 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/pin.rs.html#455)#### fn le(&self, other: &Pin<Q>) -> 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/pin.rs.html#459)#### fn gt(&self, other: &Pin<Q>) -> 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/pin.rs.html#463)#### fn ge(&self, other: &Pin<Q>) -> 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/pin.rs.html#903)### impl<P> Pointer for Pin<P>where P: [Pointer](../fmt/trait.pointer "trait std::fmt::Pointer"),
[source](https://doc.rust-lang.org/src/core/pin.rs.html#904)#### fn fmt(&self, f: &mut Formatter<'\_>) -> Result<(), Error>
Formats the value using the given formatter.
[source](https://doc.rust-lang.org/src/core/pin.rs.html#915)### impl<P, U> CoerceUnsized<Pin<U>> for Pin<P>where P: [CoerceUnsized](../ops/trait.coerceunsized "trait std::ops::CoerceUnsized")<U>,
[source](https://doc.rust-lang.org/src/core/pin.rs.html#407)### impl<P> Copy for Pin<P>where P: [Copy](../marker/trait.copy "trait std::marker::Copy"),
[source](https://doc.rust-lang.org/src/core/pin.rs.html#918)### impl<P, U> DispatchFromDyn<Pin<U>> for Pin<P>where P: [DispatchFromDyn](../ops/trait.dispatchfromdyn "trait std::ops::DispatchFromDyn")<U>,
[source](https://doc.rust-lang.org/src/core/pin.rs.html#440)1.41.0 · ### impl<P> Eq for Pin<P>where P: [Deref](../ops/trait.deref "trait std::ops::Deref"), <P as [Deref](../ops/trait.deref "trait std::ops::Deref")>::[Target](../ops/trait.deref#associatedtype.Target "type std::ops::Deref::Target"): [Eq](../cmp/trait.eq "trait std::cmp::Eq"),
Auto Trait Implementations
--------------------------
### impl<P> RefUnwindSafe for Pin<P>where P: [RefUnwindSafe](../panic/trait.refunwindsafe "trait std::panic::RefUnwindSafe"),
### impl<P> Send for Pin<P>where P: [Send](../marker/trait.send "trait std::marker::Send"),
### impl<P> Sync for Pin<P>where P: [Sync](../marker/trait.sync "trait std::marker::Sync"),
### impl<P> Unpin for Pin<P>where P: [Unpin](../marker/trait.unpin "trait std::marker::Unpin"),
### impl<P> UnwindSafe for Pin<P>where P: [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/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/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 Macro std::pin::pin Macro std::pin::pin
===================
```
pub macro pin($value:expr $(,)?) {
...
}
```
🔬This is a nightly-only experimental API. (`pin_macro` [#93178](https://github.com/rust-lang/rust/issues/93178))
Constructs a `[Pin](struct.pin "Pin")<[&mut](../primitive.reference "&mut") T>`, by pinning[1](#fn1) a `value: T` *locally*[2](#fn2).
Unlike [`Box::pin`](../boxed/struct.box#method.pin), this does not involve a heap allocation.
### Examples
#### Basic usage
```
#![feature(pin_macro)]
use core::pin::{pin, Pin};
fn stuff(foo: Pin<&mut Foo>) {
// …
}
let pinned_foo = pin!(Foo { /* … */ });
stuff(pinned_foo);
// or, directly:
stuff(pin!(Foo { /* … */ }));
```
#### Manually polling a `Future` (without `Unpin` bounds)
```
#![feature(pin_macro)]
use std::{
future::Future,
pin::pin,
task::{Context, Poll},
thread,
};
/// Runs a future to completion.
fn block_on<Fut: Future>(fut: Fut) -> Fut::Output {
let waker_that_unparks_thread = // …
let mut cx = Context::from_waker(&waker_that_unparks_thread);
// Pin the future so it can be polled.
let mut pinned_fut = pin!(fut);
loop {
match pinned_fut.as_mut().poll(&mut cx) {
Poll::Pending => thread::park(),
Poll::Ready(res) => return res,
}
}
}
```
#### With `Generator`s
```
#![feature(generators, generator_trait, pin_macro)]
use core::{
ops::{Generator, GeneratorState},
pin::pin,
};
fn generator_fn() -> impl Generator<Yield = usize, Return = ()> /* not Unpin */ {
// Allow generator to be self-referential (not `Unpin`)
// vvvvvv so that locals can cross yield points.
static || {
let foo = String::from("foo");
let foo_ref = &foo; // ------+
yield 0; // | <- crosses yield point!
println!("{foo_ref}"); // <--+
yield foo.len();
}
}
fn main() {
let mut generator = pin!(generator_fn());
match generator.as_mut().resume(()) {
GeneratorState::Yielded(0) => {},
_ => unreachable!(),
}
match generator.as_mut().resume(()) {
GeneratorState::Yielded(3) => {},
_ => unreachable!(),
}
match generator.resume(()) {
GeneratorState::Yielded(_) => unreachable!(),
GeneratorState::Complete(()) => {},
}
}
```
### Remarks
Precisely because a value is pinned to local storage, the resulting `[Pin](struct.pin "Pin")<[&mut](../primitive.reference "&mut") T>` reference ends up borrowing a local tied to that block: it can’t escape it.
The following, for instance, fails to compile:
ⓘ
```
#![feature(pin_macro)]
use core::pin::{pin, Pin};
let x: Pin<&mut Foo> = {
let x: Pin<&mut Foo> = pin!(Foo { /* … */ });
x
}; // <- Foo is dropped
stuff(x); // Error: use of dropped value
```
Error message
```
error[E0716]: temporary value dropped while borrowed
--> src/main.rs:9:28
|
8 | let x: Pin<&mut Foo> = {
| - borrow later stored here
9 | let x: Pin<&mut Foo> = pin!(Foo { /* … */ });
| ^^^^^^^^^^^^^^^^^^^^^ creates a temporary which is freed while still in use
10 | x
11 | }; // <- Foo is dropped
| - temporary value is freed at the end of this statement
|
= note: consider using a `let` binding to create a longer lived value
```
This makes [`pin!`](macro.pin "pin!") **unsuitable to pin values when intending to *return* them**. Instead, the value is expected to be passed around *unpinned* until the point where it is to be consumed, where it is then useful and even sensible to pin the value locally using [`pin!`](macro.pin "pin!").
If you really need to return a pinned value, consider using [`Box::pin`](../boxed/struct.box#method.pin) instead.
On the other hand, pinning to the stack[2](#fn2) using [`pin!`](macro.pin "pin!") is likely to be cheaper than pinning into a fresh heap allocation using [`Box::pin`](../boxed/struct.box#method.pin). Moreover, by virtue of not even needing an allocator, [`pin!`](macro.pin "pin!") is the main non-`unsafe` `#![no_std]`-compatible [`Pin`](struct.pin "Pin") constructor.
1. If the (type `T` of the) given value does not implement [`Unpin`](../marker/trait.unpin "Unpin"), then this effectively pins the `value` in memory, where it will be unable to be moved. Otherwise, `[Pin](struct.pin "Pin")<[&mut](../primitive.reference "&mut") T>` behaves like `[&mut](../primitive.reference "&mut") T`, and operations such as [`mem::replace()`](../mem/fn.replace "crate::mem::replace") will allow extracting that value, and therefore, moving it. See [the `Unpin` section of the `pin` module](index#unpin "self") for more info. [↩](#fnref1)
2. This is usually dubbed “stack”-pinning. And whilst local values are almost always located in the stack (*e.g.*, when within the body of a non-`async` function), the truth is that inside the body of an `async fn` or block —more generally, the body of a generator— any locals crossing an `.await` point —a `yield` point— end up being part of the state captured by the `Future` —by the `Generator`—, and thus will be stored wherever that one is. [↩](#fnref2)
rust Module std::i64 Module std::i64
===============
👎Deprecating in a future Rust version: all constants in this module replaced by associated constants on `i64`
Constants for the 64-bit signed integer type.
*[See also the `i64` primitive type](../primitive.i64 "i64").*
New code should use the associated constants directly on the primitive type.
Constants
---------
[MAX](constant.max "std::i64::MAX constant")Deprecation planned
The largest value that can be represented by this integer type. Use [`i64::MAX`](../primitive.i64#associatedconstant.MAX "i64::MAX") instead.
[MIN](constant.min "std::i64::MIN constant")Deprecation planned
The smallest value that can be represented by this integer type. Use [`i64::MIN`](../primitive.i64#associatedconstant.MIN "i64::MIN") instead.
rust Constant std::i64::MAX Constant std::i64::MAX
======================
```
pub const MAX: i64 = i64::MAX; // 9_223_372_036_854_775_807i64
```
👎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 [`i64::MAX`](../primitive.i64#associatedconstant.MAX "i64::MAX") instead.
Examples
--------
```
// deprecated way
let max = std::i64::MAX;
// intended way
let max = i64::MAX;
```
rust Constant std::i64::MIN Constant std::i64::MIN
======================
```
pub const MIN: i64 = i64::MIN; // -9_223_372_036_854_775_808i64
```
👎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 [`i64::MIN`](../primitive.i64#associatedconstant.MIN "i64::MIN") instead.
Examples
--------
```
// deprecated way
let min = std::i64::MIN;
// intended way
let min = i64::MIN;
```
rust Module std::result Module std::result
==================
Error handling with the `Result` type.
[`Result<T, E>`](enum.result "Result") is the type used for returning and propagating errors. It is an enum with the variants, [`Ok(T)`](enum.result#variant.Ok), representing success and containing a value, and [`Err(E)`](enum.result#variant.Err), representing error and containing an error value.
```
enum Result<T, E> {
Ok(T),
Err(E),
}
```
Functions return [`Result`](enum.result "Result") whenever errors are expected and recoverable. In the `std` crate, [`Result`](enum.result "Result") is most prominently used for [I/O](../io/index).
A simple function returning [`Result`](enum.result "Result") might be defined and used like so:
```
#[derive(Debug)]
enum Version { Version1, Version2 }
fn parse_version(header: &[u8]) -> Result<Version, &'static str> {
match header.get(0) {
None => Err("invalid header length"),
Some(&1) => Ok(Version::Version1),
Some(&2) => Ok(Version::Version2),
Some(_) => Err("invalid version"),
}
}
let version = parse_version(&[1, 2, 3, 4]);
match version {
Ok(v) => println!("working with version: {v:?}"),
Err(e) => println!("error parsing header: {e:?}"),
}
```
Pattern matching on [`Result`](enum.result "Result")s is clear and straightforward for simple cases, but [`Result`](enum.result "Result") comes with some convenience methods that make working with it more succinct.
```
let good_result: Result<i32, i32> = Ok(10);
let bad_result: Result<i32, i32> = Err(10);
// The `is_ok` and `is_err` methods do what they say.
assert!(good_result.is_ok() && !good_result.is_err());
assert!(bad_result.is_err() && !bad_result.is_ok());
// `map` consumes the `Result` and produces another.
let good_result: Result<i32, i32> = good_result.map(|i| i + 1);
let bad_result: Result<i32, i32> = bad_result.map(|i| i - 1);
// Use `and_then` to continue the computation.
let good_result: Result<bool, i32> = good_result.and_then(|i| Ok(i == 11));
// Use `or_else` to handle the error.
let bad_result: Result<i32, i32> = bad_result.or_else(|i| Ok(i + 20));
// Consume the result and return the contents with `unwrap`.
let final_awesome_result = good_result.unwrap();
```
Results must be used
--------------------
A common problem with using return values to indicate errors is that it is easy to ignore the return value, thus failing to handle the error. [`Result`](enum.result "Result") is annotated with the `#[must_use]` attribute, which will cause the compiler to issue a warning when a Result value is ignored. This makes [`Result`](enum.result "Result") especially useful with functions that may encounter errors but don’t otherwise return a useful value.
Consider the [`write_all`](../io/trait.write#method.write_all "io::Write::write_all") method defined for I/O types by the [`Write`](../io/trait.write "io::Write") trait:
```
use std::io;
trait Write {
fn write_all(&mut self, bytes: &[u8]) -> Result<(), io::Error>;
}
```
*Note: The actual definition of [`Write`](../io/trait.write "io::Write") uses [`io::Result`](../io/type.result "io::Result"), which is just a synonym for `[Result](enum.result "Result")<T, [io::Error](../io/struct.error "io::Error")>`.*
This method doesn’t produce a value, but the write may fail. It’s crucial to handle the error case, and *not* write something like this:
```
use std::fs::File;
use std::io::prelude::*;
let mut file = File::create("valuable_data.txt").unwrap();
// If `write_all` errors, then we'll never know, because the return
// value is ignored.
file.write_all(b"important message");
```
If you *do* write that in Rust, the compiler will give you a warning (by default, controlled by the `unused_must_use` lint).
You might instead, if you don’t want to handle the error, simply assert success with [`expect`](enum.result#method.expect). This will panic if the write fails, providing a marginally useful message indicating why:
```
use std::fs::File;
use std::io::prelude::*;
let mut file = File::create("valuable_data.txt").unwrap();
file.write_all(b"important message").expect("failed to write message");
```
You might also simply assert success:
```
assert!(file.write_all(b"important message").is_ok());
```
Or propagate the error up the call stack with [`?`](../ops/trait.try):
```
fn write_message() -> io::Result<()> {
let mut file = File::create("valuable_data.txt")?;
file.write_all(b"important message")?;
Ok(())
}
```
The question mark operator, `?`
-------------------------------
When writing code that calls many functions that return the [`Result`](enum.result "Result") type, the error handling can be tedious. The question mark operator, [`?`](../ops/trait.try), hides some of the boilerplate of propagating errors up the call stack.
It replaces this:
```
use std::fs::File;
use std::io::prelude::*;
use std::io;
struct Info {
name: String,
age: i32,
rating: i32,
}
fn write_info(info: &Info) -> io::Result<()> {
// Early return on error
let mut file = match File::create("my_best_friends.txt") {
Err(e) => return Err(e),
Ok(f) => f,
};
if let Err(e) = file.write_all(format!("name: {}\n", info.name).as_bytes()) {
return Err(e)
}
if let Err(e) = file.write_all(format!("age: {}\n", info.age).as_bytes()) {
return Err(e)
}
if let Err(e) = file.write_all(format!("rating: {}\n", info.rating).as_bytes()) {
return Err(e)
}
Ok(())
}
```
With this:
```
use std::fs::File;
use std::io::prelude::*;
use std::io;
struct Info {
name: String,
age: i32,
rating: i32,
}
fn write_info(info: &Info) -> io::Result<()> {
let mut file = File::create("my_best_friends.txt")?;
// Early return on error
file.write_all(format!("name: {}\n", info.name).as_bytes())?;
file.write_all(format!("age: {}\n", info.age).as_bytes())?;
file.write_all(format!("rating: {}\n", info.rating).as_bytes())?;
Ok(())
}
```
*It’s much nicer!*
Ending the expression with [`?`](../ops/trait.try) will result in the unwrapped success ([`Ok`](enum.result#variant.Ok "Ok")) value, unless the result is [`Err`](enum.result#variant.Err "Err"), in which case [`Err`](enum.result#variant.Err "Err") is returned early from the enclosing function.
[`?`](../ops/trait.try) can only be used in functions that return [`Result`](enum.result "Result") because of the early return of [`Err`](enum.result#variant.Err "Err") that it provides.
Method overview
---------------
In addition to working with pattern matching, [`Result`](enum.result "Result") provides a wide variety of different methods.
### Querying the variant
The [`is_ok`](enum.result#method.is_ok) and [`is_err`](enum.result#method.is_err) methods return [`true`](../primitive.bool "true") if the [`Result`](enum.result "Result") is [`Ok`](enum.result#variant.Ok "Ok") or [`Err`](enum.result#variant.Err "Err"), respectively.
### Adapters for working with references
* [`as_ref`](enum.result#method.as_ref) converts from `&Result<T, E>` to `Result<&T, &E>`
* [`as_mut`](enum.result#method.as_mut) converts from `&mut Result<T, E>` to `Result<&mut T, &mut E>`
* [`as_deref`](enum.result#method.as_deref) converts from `&Result<T, E>` to `Result<&T::Target, &E>`
* [`as_deref_mut`](enum.result#method.as_deref_mut) converts from `&mut Result<T, E>` to `Result<&mut T::Target, &mut E>`
### Extracting contained values
These methods extract the contained value in a [`Result<T, E>`](enum.result "Result<T, E>") when it is the [`Ok`](enum.result#variant.Ok "Ok") variant. If the [`Result`](enum.result "Result") is [`Err`](enum.result#variant.Err "Err"):
* [`expect`](enum.result#method.expect) panics with a provided custom message
* [`unwrap`](enum.result#method.unwrap) panics with a generic message
* [`unwrap_or`](enum.result#method.unwrap_or) returns the provided default value
* [`unwrap_or_default`](enum.result#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.result#method.unwrap_or_else) returns the result of evaluating the provided function
The panicking methods [`expect`](enum.result#method.expect) and [`unwrap`](enum.result#method.unwrap) require `E` to implement the [`Debug`](../fmt/trait.debug) trait.
These methods extract the contained value in a [`Result<T, E>`](enum.result "Result<T, E>") when it is the [`Err`](enum.result#variant.Err "Err") variant. They require `T` to implement the [`Debug`](../fmt/trait.debug) trait. If the [`Result`](enum.result "Result") is [`Ok`](enum.result#variant.Ok "Ok"):
* [`expect_err`](enum.result#method.expect_err) panics with a provided custom message
* [`unwrap_err`](enum.result#method.unwrap_err) panics with a generic message
### Transforming contained values
These methods transform [`Result`](enum.result "Result") to [`Option`](../option/enum.option "Option"):
* [`err`](enum.result#method.err "Result::err") transforms [`Result<T, E>`](enum.result "Result<T, E>") into [`Option<E>`](../option/enum.option "Option<E>"), mapping [`Err(e)`](enum.result#variant.Err) to [`Some(e)`](../option/enum.option#variant.Some) and [`Ok(v)`](enum.result#variant.Ok) to [`None`](../option/enum.option#variant.None "None")
* [`ok`](enum.result#method.ok "Result::ok") transforms [`Result<T, E>`](enum.result "Result<T, E>") into [`Option<T>`](../option/enum.option "Option<T>"), mapping [`Ok(v)`](enum.result#variant.Ok) to [`Some(v)`](../option/enum.option#variant.Some) and [`Err(e)`](enum.result#variant.Err) to [`None`](../option/enum.option#variant.None "None")
* [`transpose`](enum.result#method.transpose) transposes a [`Result`](enum.result "Result") of an [`Option`](../option/enum.option "Option") into an [`Option`](../option/enum.option "Option") of a [`Result`](enum.result "Result")
This method transforms the contained value of the [`Ok`](enum.result#variant.Ok "Ok") variant:
* [`map`](enum.result#method.map) transforms [`Result<T, E>`](enum.result "Result<T, E>") into [`Result<U, E>`](enum.result "Result<U, E>") by applying the provided function to the contained value of [`Ok`](enum.result#variant.Ok "Ok") and leaving [`Err`](enum.result#variant.Err "Err") values unchanged
This method transforms the contained value of the [`Err`](enum.result#variant.Err "Err") variant:
* [`map_err`](enum.result#method.map_err) transforms [`Result<T, E>`](enum.result "Result<T, E>") into [`Result<T, F>`](enum.result "Result<T, F>") by applying the provided function to the contained value of [`Err`](enum.result#variant.Err "Err") and leaving [`Ok`](enum.result#variant.Ok "Ok") values unchanged
These methods transform a [`Result<T, E>`](enum.result "Result<T, E>") into a value of a possibly different type `U`:
* [`map_or`](enum.result#method.map_or) applies the provided function to the contained value of [`Ok`](enum.result#variant.Ok "Ok"), or returns the provided default value if the [`Result`](enum.result "Result") is [`Err`](enum.result#variant.Err "Err")
* [`map_or_else`](enum.result#method.map_or_else) applies the provided function to the contained value of [`Ok`](enum.result#variant.Ok "Ok"), or applies the provided default fallback function to the contained value of [`Err`](enum.result#variant.Err "Err")
### Boolean operators
These methods treat the [`Result`](enum.result "Result") as a boolean value, where [`Ok`](enum.result#variant.Ok "Ok") acts like [`true`](../primitive.bool "true") and [`Err`](enum.result#variant.Err "Err") acts like [`false`](../primitive.bool "false"). There are two categories of these methods: ones that take a [`Result`](enum.result "Result") as input, and ones that take a function as input (to be lazily evaluated).
The [`and`](enum.result#method.and) and [`or`](enum.result#method.or) methods take another [`Result`](enum.result "Result") as input, and produce a [`Result`](enum.result "Result") as output. The [`and`](enum.result#method.and) method can produce a [`Result<U, E>`](enum.result "Result<U, E>") value having a different inner type `U` than [`Result<T, E>`](enum.result "Result<T, E>"). The [`or`](enum.result#method.or) method can produce a [`Result<T, F>`](enum.result "Result<T, F>") value having a different error type `F` than [`Result<T, E>`](enum.result "Result<T, E>").
| method | self | input | output |
| --- | --- | --- | --- |
| [`and`](enum.result#method.and) | `Err(e)` | (ignored) | `Err(e)` |
| [`and`](enum.result#method.and) | `Ok(x)` | `Err(d)` | `Err(d)` |
| [`and`](enum.result#method.and) | `Ok(x)` | `Ok(y)` | `Ok(y)` |
| [`or`](enum.result#method.or) | `Err(e)` | `Err(d)` | `Err(d)` |
| [`or`](enum.result#method.or) | `Err(e)` | `Ok(y)` | `Ok(y)` |
| [`or`](enum.result#method.or) | `Ok(x)` | (ignored) | `Ok(x)` |
The [`and_then`](enum.result#method.and_then) and [`or_else`](enum.result#method.or_else) methods take a function as input, and only evaluate the function when they need to produce a new value. The [`and_then`](enum.result#method.and_then) method can produce a [`Result<U, E>`](enum.result "Result<U, E>") value having a different inner type `U` than [`Result<T, E>`](enum.result "Result<T, E>"). The [`or_else`](enum.result#method.or_else) method can produce a [`Result<T, F>`](enum.result "Result<T, F>") value having a different error type `F` than [`Result<T, E>`](enum.result "Result<T, E>").
| method | self | function input | function result | output |
| --- | --- | --- | --- | --- |
| [`and_then`](enum.result#method.and_then) | `Err(e)` | (not provided) | (not evaluated) | `Err(e)` |
| [`and_then`](enum.result#method.and_then) | `Ok(x)` | `x` | `Err(d)` | `Err(d)` |
| [`and_then`](enum.result#method.and_then) | `Ok(x)` | `x` | `Ok(y)` | `Ok(y)` |
| [`or_else`](enum.result#method.or_else) | `Err(e)` | `e` | `Err(d)` | `Err(d)` |
| [`or_else`](enum.result#method.or_else) | `Err(e)` | `e` | `Ok(y)` | `Ok(y)` |
| [`or_else`](enum.result#method.or_else) | `Ok(x)` | (not provided) | (not evaluated) | `Ok(x)` |
### Comparison operators
If `T` and `E` both implement [`PartialOrd`](../cmp/trait.partialord "PartialOrd") then [`Result<T, E>`](enum.result "Result<T, E>") will derive its [`PartialOrd`](../cmp/trait.partialord "PartialOrd") implementation. With this order, an [`Ok`](enum.result#variant.Ok "Ok") compares as less than any [`Err`](enum.result#variant.Err "Err"), while two [`Ok`](enum.result#variant.Ok "Ok") or two [`Err`](enum.result#variant.Err "Err") compare as their contained values would in `T` or `E` respectively. If `T` and `E` both also implement [`Ord`](../cmp/trait.ord "Ord"), then so does [`Result<T, E>`](enum.result "Result<T, E>").
```
assert!(Ok(1) < Err(0));
let x: Result<i32, ()> = Ok(0);
let y = Ok(1);
assert!(x < y);
let x: Result<(), i32> = Err(0);
let y = Err(1);
assert!(x < y);
```
### Iterating over `Result`
A [`Result`](enum.result "Result") 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 [`Result`](enum.result "Result") is [`Ok`](enum.result#variant.Ok "Ok")), or produce no values (when the [`Result`](enum.result "Result") is [`Err`](enum.result#variant.Err "Err")). For example, [`into_iter`](enum.result#method.into_iter) acts like [`once(v)`](../iter/fn.once) if the [`Result`](enum.result "Result") is [`Ok(v)`](enum.result#variant.Ok), and like [`empty()`](../iter/fn.empty) if the [`Result`](enum.result "Result") is [`Err`](enum.result#variant.Err "Err").
Iterators over [`Result<T, E>`](enum.result "Result<T, E>") come in three types:
* [`into_iter`](enum.result#method.into_iter) consumes the [`Result`](enum.result "Result") and produces the contained value
* [`iter`](enum.result#method.iter) produces an immutable reference of type `&T` to the contained value
* [`iter_mut`](enum.result#method.iter_mut) produces a mutable reference of type `&mut T` to the contained value
See [Iterating over `Option`](../option/index#iterating-over-option) for examples of how this can be useful.
You might want to use an iterator chain to do multiple instances of an operation that can fail, but would like to ignore failures while continuing to process the successful results. In this example, we take advantage of the iterable nature of [`Result`](enum.result "Result") to select only the [`Ok`](enum.result#variant.Ok "Ok") values using [`flatten`](../iter/trait.iterator#method.flatten "Iterator::flatten").
```
let mut results = vec![];
let mut errs = vec![];
let nums: Vec<_> = ["17", "not a number", "99", "-27", "768"]
.into_iter()
.map(u8::from_str)
// Save clones of the raw `Result` values to inspect
.inspect(|x| results.push(x.clone()))
// Challenge: explain how this captures only the `Err` values
.inspect(|x| errs.extend(x.clone().err()))
.flatten()
.collect();
assert_eq!(errs.len(), 3);
assert_eq!(nums, [17, 99]);
println!("results {results:?}");
println!("errs {errs:?}");
println!("nums {nums:?}");
```
### Collecting into `Result`
[`Result`](enum.result "Result") implements the [`FromIterator`](enum.result#impl-FromIterator%3CResult%3CA%2C%20E%3E%3E-for-Result%3CV%2C%20E%3E) trait, which allows an iterator over [`Result`](enum.result "Result") values to be collected into a [`Result`](enum.result "Result") of a collection of each contained value of the original [`Result`](enum.result "Result") values, or [`Err`](enum.result#variant.Err "Err") if any of the elements was [`Err`](enum.result#variant.Err "Err").
```
let v = [Ok(2), Ok(4), Err("err!"), Ok(8)];
let res: Result<Vec<_>, &str> = v.into_iter().collect();
assert_eq!(res, Err("err!"));
let v = [Ok(2), Ok(4), Ok(8)];
let res: Result<Vec<_>, &str> = v.into_iter().collect();
assert_eq!(res, Ok(vec![2, 4, 8]));
```
[`Result`](enum.result "Result") also implements the [`Product`](enum.result#impl-Product%3CResult%3CU%2C%20E%3E%3E-for-Result%3CT%2C%20E%3E) and [`Sum`](enum.result#impl-Sum%3CResult%3CU%2C%20E%3E%3E-for-Result%3CT%2C%20E%3E) traits, allowing an iterator over [`Result`](enum.result "Result") values to provide the [`product`](../iter/trait.iterator#method.product "Iterator::product") and [`sum`](../iter/trait.iterator#method.sum "Iterator::sum") methods.
```
let v = [Err("error!"), Ok(1), Ok(2), Ok(3), Err("foo")];
let res: Result<i32, &str> = v.into_iter().sum();
assert_eq!(res, Err("error!"));
let v = [Ok(1), Ok(2), Ok(21)];
let res: Result<i32, &str> = v.into_iter().product();
assert_eq!(res, Ok(42));
```
Structs
-------
[IntoIter](struct.intoiter "std::result::IntoIter struct")
An iterator over the value in a [`Ok`](enum.result#variant.Ok "Ok") variant of a [`Result`](enum.result "Result").
[Iter](struct.iter "std::result::Iter struct")
An iterator over a reference to the [`Ok`](enum.result#variant.Ok "Ok") variant of a [`Result`](enum.result "Result").
[IterMut](struct.itermut "std::result::IterMut struct")
An iterator over a mutable reference to the [`Ok`](enum.result#variant.Ok "Ok") variant of a [`Result`](enum.result "Result").
Enums
-----
[Result](enum.result "std::result::Result enum")
`Result` is a type that represents either success ([`Ok`](enum.result#variant.Ok "Ok")) or failure ([`Err`](enum.result#variant.Err "Err")).
| programming_docs |
rust Struct std::result::IterMut Struct std::result::IterMut
===========================
```
pub struct IterMut<'a, T>where T: 'a,{ /* private fields */ }
```
An iterator over a mutable reference to the [`Ok`](enum.result#variant.Ok "Ok") variant of a [`Result`](enum.result "Result").
Created by [`Result::iter_mut`](enum.result#method.iter_mut "Result::iter_mut").
Trait Implementations
---------------------
[source](https://doc.rust-lang.org/src/core/result.rs.html#1935)### impl<'a, T> Debug for IterMut<'a, T>where T: 'a + [Debug](../fmt/trait.debug "trait std::fmt::Debug"),
[source](https://doc.rust-lang.org/src/core/result.rs.html#1935)#### 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/result.rs.html#1957)### impl<'a, T> DoubleEndedIterator for IterMut<'a, T>
[source](https://doc.rust-lang.org/src/core/result.rs.html#1959)#### fn next\_back(&mut self) -> Option<&'a mut 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/core/result.rs.html#1965)### impl<T> ExactSizeIterator for IterMut<'\_, T>
[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/result.rs.html#1942)### impl<'a, T> Iterator for IterMut<'a, T>
#### type Item = &'a mut T
The type of the elements being iterated over.
[source](https://doc.rust-lang.org/src/core/result.rs.html#1946)#### fn next(&mut self) -> Option<&'a mut T>
Advances the iterator and returns the next value. [Read more](../iter/trait.iterator#tymethod.next)
[source](https://doc.rust-lang.org/src/core/result.rs.html#1950)#### 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/core/result.rs.html#1968)1.26.0 · ### impl<T> FusedIterator for IterMut<'\_, T>
[source](https://doc.rust-lang.org/src/core/result.rs.html#1971)### impl<A> TrustedLen for IterMut<'\_, A>
Auto Trait Implementations
--------------------------
### impl<'a, T> RefUnwindSafe for IterMut<'a, T>where T: [RefUnwindSafe](../panic/trait.refunwindsafe "trait std::panic::RefUnwindSafe"),
### impl<'a, T> Send for IterMut<'a, T>where T: [Send](../marker/trait.send "trait std::marker::Send"),
### impl<'a, T> Sync for IterMut<'a, T>where T: [Sync](../marker/trait.sync "trait std::marker::Sync"),
### impl<'a, T> Unpin for IterMut<'a, T>
### impl<'a, T> !UnwindSafe for IterMut<'a, 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/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::result::IntoIter Struct std::result::IntoIter
============================
```
pub struct IntoIter<T> { /* private fields */ }
```
An iterator over the value in a [`Ok`](enum.result#variant.Ok "Ok") variant of a [`Result`](enum.result "Result").
The iterator yields one value if the result is [`Ok`](enum.result#variant.Ok "Ok"), otherwise none.
This struct is created by the [`into_iter`](../iter/trait.intoiterator#tymethod.into_iter) method on [`Result`](enum.result "Result") (provided by the [`IntoIterator`](../iter/trait.intoiterator "IntoIterator") trait).
Trait Implementations
---------------------
[source](https://doc.rust-lang.org/src/core/result.rs.html#1981)### impl<T> Clone for IntoIter<T>where T: [Clone](../clone/trait.clone "trait std::clone::Clone"),
[source](https://doc.rust-lang.org/src/core/result.rs.html#1981)#### fn clone(&self) -> IntoIter<T>
Notable traits for [IntoIter](struct.intoiter "struct std::result::IntoIter")<T>
```
impl<T> Iterator for IntoIter<T>
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/core/result.rs.html#1981)### impl<T> Debug for IntoIter<T>where T: [Debug](../fmt/trait.debug "trait std::fmt::Debug"),
[source](https://doc.rust-lang.org/src/core/result.rs.html#1981)#### 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/result.rs.html#2003)### impl<T> DoubleEndedIterator for IntoIter<T>
[source](https://doc.rust-lang.org/src/core/result.rs.html#2005)#### 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/core/result.rs.html#2011)### impl<T> ExactSizeIterator for IntoIter<T>
[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/result.rs.html#1988)### impl<T> Iterator for IntoIter<T>
#### type Item = T
The type of the elements being iterated over.
[source](https://doc.rust-lang.org/src/core/result.rs.html#1992)#### 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/core/result.rs.html#1996)#### 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/core/result.rs.html#2014)1.26.0 · ### impl<T> FusedIterator for IntoIter<T>
[source](https://doc.rust-lang.org/src/core/result.rs.html#2017)### impl<A> TrustedLen for IntoIter<A>
Auto Trait Implementations
--------------------------
### impl<T> RefUnwindSafe for IntoIter<T>where T: [RefUnwindSafe](../panic/trait.refunwindsafe "trait std::panic::RefUnwindSafe"),
### impl<T> Send for IntoIter<T>where T: [Send](../marker/trait.send "trait std::marker::Send"),
### impl<T> Sync for IntoIter<T>where T: [Sync](../marker/trait.sync "trait std::marker::Sync"),
### impl<T> Unpin for IntoIter<T>where T: [Unpin](../marker/trait.unpin "trait std::marker::Unpin"),
### impl<T> UnwindSafe for IntoIter<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/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::result::Iter Struct std::result::Iter
========================
```
pub struct Iter<'a, T>where T: 'a,{ /* private fields */ }
```
An iterator over a reference to the [`Ok`](enum.result#variant.Ok "Ok") variant of a [`Result`](enum.result "Result").
The iterator yields one value if the result is [`Ok`](enum.result#variant.Ok "Ok"), otherwise none.
Created by [`Result::iter`](enum.result#method.iter "Result::iter").
Trait Implementations
---------------------
[source](https://doc.rust-lang.org/src/core/result.rs.html#1925)### impl<T> Clone for Iter<'\_, T>
[source](https://doc.rust-lang.org/src/core/result.rs.html#1927)#### fn clone(&self) -> Iter<'\_, T>
Notable traits for [Iter](struct.iter "struct std::result::Iter")<'a, T>
```
impl<'a, T> Iterator for Iter<'a, T>
type Item = &'a 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/result.rs.html#1886)### impl<'a, T> Debug for Iter<'a, T>where T: 'a + [Debug](../fmt/trait.debug "trait std::fmt::Debug"),
[source](https://doc.rust-lang.org/src/core/result.rs.html#1886)#### 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/result.rs.html#1908)### impl<'a, T> DoubleEndedIterator for Iter<'a, T>
[source](https://doc.rust-lang.org/src/core/result.rs.html#1910)#### fn next\_back(&mut self) -> Option<&'a 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/core/result.rs.html#1916)### impl<T> ExactSizeIterator for Iter<'\_, T>
[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/result.rs.html#1893)### impl<'a, T> Iterator for Iter<'a, T>
#### type Item = &'a T
The type of the elements being iterated over.
[source](https://doc.rust-lang.org/src/core/result.rs.html#1897)#### fn next(&mut self) -> Option<&'a T>
Advances the iterator and returns the next value. [Read more](../iter/trait.iterator#tymethod.next)
[source](https://doc.rust-lang.org/src/core/result.rs.html#1901)#### 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#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](../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/core/result.rs.html#1919)1.26.0 · ### impl<T> FusedIterator for Iter<'\_, T>
[source](https://doc.rust-lang.org/src/core/result.rs.html#1922)### impl<A> TrustedLen for Iter<'\_, A>
Auto Trait Implementations
--------------------------
### impl<'a, T> RefUnwindSafe for Iter<'a, T>where T: [RefUnwindSafe](../panic/trait.refunwindsafe "trait std::panic::RefUnwindSafe"),
### impl<'a, T> Send for Iter<'a, T>where T: [Sync](../marker/trait.sync "trait std::marker::Sync"),
### impl<'a, T> Sync for Iter<'a, T>where T: [Sync](../marker/trait.sync "trait std::marker::Sync"),
### impl<'a, T> Unpin for Iter<'a, T>
### impl<'a, T> UnwindSafe for Iter<'a, T>where 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/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::result::Result Enum std::result::Result
========================
```
pub enum Result<T, E> {
Ok(T),
Err(E),
}
```
`Result` is a type that represents either success ([`Ok`](enum.result#variant.Ok "Ok")) or failure ([`Err`](enum.result#variant.Err "Err")).
See the [module documentation](index) for details.
Variants
--------
### `Ok(T)`
Contains the success value
### `Err(E)`
Contains the error value
Implementations
---------------
[source](https://doc.rust-lang.org/src/core/result.rs.html#520)### impl<T, E> Result<T, E>
[source](https://doc.rust-lang.org/src/core/result.rs.html#542)const: 1.48.0 · #### pub const fn is\_ok(&self) -> bool
Returns `true` if the result is [`Ok`](enum.result#variant.Ok "Ok").
##### Examples
Basic usage:
```
let x: Result<i32, &str> = Ok(-3);
assert_eq!(x.is_ok(), true);
let x: Result<i32, &str> = Err("Some error message");
assert_eq!(x.is_ok(), false);
```
[source](https://doc.rust-lang.org/src/core/result.rs.html#565)#### pub fn is\_ok\_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 result is [`Ok`](enum.result#variant.Ok "Ok") and the value inside of it matches a predicate.
##### Examples
```
#![feature(is_some_with)]
let x: Result<u32, &str> = Ok(2);
assert_eq!(x.is_ok_and(|&x| x > 1), true);
let x: Result<u32, &str> = Ok(0);
assert_eq!(x.is_ok_and(|&x| x > 1), false);
let x: Result<u32, &str> = Err("hey");
assert_eq!(x.is_ok_and(|&x| x > 1), false);
```
[source](https://doc.rust-lang.org/src/core/result.rs.html#586)const: 1.48.0 · #### pub const fn is\_err(&self) -> bool
Returns `true` if the result is [`Err`](enum.result#variant.Err "Err").
##### Examples
Basic usage:
```
let x: Result<i32, &str> = Ok(-3);
assert_eq!(x.is_err(), false);
let x: Result<i32, &str> = Err("Some error message");
assert_eq!(x.is_err(), true);
```
[source](https://doc.rust-lang.org/src/core/result.rs.html#610)#### pub fn is\_err\_and(&self, f: impl FnOnce(&E) -> 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 result is [`Err`](enum.result#variant.Err "Err") and the value inside of it matches a predicate.
##### Examples
```
#![feature(is_some_with)]
use std::io::{Error, ErrorKind};
let x: Result<u32, Error> = Err(Error::new(ErrorKind::NotFound, "!"));
assert_eq!(x.is_err_and(|x| x.kind() == ErrorKind::NotFound), true);
let x: Result<u32, Error> = Err(Error::new(ErrorKind::PermissionDenied, "!"));
assert_eq!(x.is_err_and(|x| x.kind() == ErrorKind::NotFound), false);
let x: Result<u32, Error> = Ok(123);
assert_eq!(x.is_err_and(|x| x.kind() == ErrorKind::NotFound), false);
```
[source](https://doc.rust-lang.org/src/core/result.rs.html#637-639)const: [unstable](https://github.com/rust-lang/rust/issues/92384 "Tracking issue for const_result_drop") · #### pub fn ok(self) -> Option<T>
Converts from `Result<T, E>` to [`Option<T>`](../option/enum.option "Option<T>").
Converts `self` into an [`Option<T>`](../option/enum.option "Option<T>"), consuming `self`, and discarding the error, if any.
##### Examples
Basic usage:
```
let x: Result<u32, &str> = Ok(2);
assert_eq!(x.ok(), Some(2));
let x: Result<u32, &str> = Err("Nothing here");
assert_eq!(x.ok(), None);
```
[source](https://doc.rust-lang.org/src/core/result.rs.html#668-670)const: [unstable](https://github.com/rust-lang/rust/issues/92384 "Tracking issue for const_result_drop") · #### pub fn err(self) -> Option<E>
Converts from `Result<T, E>` to [`Option<E>`](../option/enum.option "Option<E>").
Converts `self` into an [`Option<E>`](../option/enum.option "Option<E>"), consuming `self`, and discarding the success value, if any.
##### Examples
Basic usage:
```
let x: Result<u32, &str> = Ok(2);
assert_eq!(x.err(), None);
let x: Result<u32, &str> = Err("Nothing here");
assert_eq!(x.err(), Some("Nothing here"));
```
[source](https://doc.rust-lang.org/src/core/result.rs.html#703)const: 1.48.0 · #### pub const fn as\_ref(&self) -> Result<&T, &E>
Converts from `&Result<T, E>` to `Result<&T, &E>`.
Produces a new `Result`, containing a reference into the original, leaving the original in place.
##### Examples
Basic usage:
```
let x: Result<u32, &str> = Ok(2);
assert_eq!(x.as_ref(), Ok(&2));
let x: Result<u32, &str> = Err("Error");
assert_eq!(x.as_ref(), Err(&"Error"));
```
[source](https://doc.rust-lang.org/src/core/result.rs.html#735)const: [unstable](https://github.com/rust-lang/rust/issues/82814 "Tracking issue for const_result") · #### pub fn as\_mut(&mut self) -> Result<&mut T, &mut E>
Converts from `&mut Result<T, E>` to `Result<&mut T, &mut E>`.
##### Examples
Basic usage:
```
fn mutate(r: &mut Result<i32, i32>) {
match r.as_mut() {
Ok(v) => *v = 42,
Err(e) => *e = 0,
}
}
let mut x: Result<i32, i32> = Ok(2);
mutate(&mut x);
assert_eq!(x.unwrap(), 42);
let mut x: Result<i32, i32> = Err(13);
mutate(&mut x);
assert_eq!(x.unwrap_err(), 0);
```
[source](https://doc.rust-lang.org/src/core/result.rs.html#767)#### pub fn map<U, F>(self, op: F) -> Result<U, E>where F: [FnOnce](../ops/trait.fnonce "trait std::ops::FnOnce")(T) -> U,
Maps a `Result<T, E>` to `Result<U, E>` by applying a function to a contained [`Ok`](enum.result#variant.Ok "Ok") value, leaving an [`Err`](enum.result#variant.Err "Err") value untouched.
This function can be used to compose the results of two functions.
##### Examples
Print the numbers on each line of a string multiplied by two.
```
let line = "1\n2\n3\n4\n";
for num in line.lines() {
match num.parse::<i32>().map(|i| i * 2) {
Ok(n) => println!("{n}"),
Err(..) => {}
}
}
```
[source](https://doc.rust-lang.org/src/core/result.rs.html#794)1.41.0 · #### 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 (if [`Err`](enum.result#variant.Err "Err")), or applies a function to the contained value (if [`Ok`](enum.result#variant.Ok "Ok")),
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.result#method.map_or_else), which is lazily evaluated.
##### Examples
```
let x: Result<_, &str> = Ok("foo");
assert_eq!(x.map_or(42, |v| v.len()), 3);
let x: Result<&str, _> = Err("bar");
assert_eq!(x.map_or(42, |v| v.len()), 42);
```
[source](https://doc.rust-lang.org/src/core/result.rs.html#823)1.41.0 · #### pub fn map\_or\_else<U, D, F>(self, default: D, f: F) -> Uwhere D: [FnOnce](../ops/trait.fnonce "trait std::ops::FnOnce")(E) -> U, F: [FnOnce](../ops/trait.fnonce "trait std::ops::FnOnce")(T) -> U,
Maps a `Result<T, E>` to `U` by applying fallback function `default` to a contained [`Err`](enum.result#variant.Err "Err") value, or function `f` to a contained [`Ok`](enum.result#variant.Ok "Ok") value.
This function can be used to unpack a successful result while handling an error.
##### Examples
Basic usage:
```
let k = 21;
let x : Result<_, &str> = Ok("foo");
assert_eq!(x.map_or_else(|e| k * 2, |v| v.len()), 3);
let x : Result<&str, _> = Err("bar");
assert_eq!(x.map_or_else(|e| k * 2, |v| v.len()), 42);
```
[source](https://doc.rust-lang.org/src/core/result.rs.html#852)#### pub fn map\_err<F, O>(self, op: O) -> Result<T, F>where O: [FnOnce](../ops/trait.fnonce "trait std::ops::FnOnce")(E) -> F,
Maps a `Result<T, E>` to `Result<T, F>` by applying a function to a contained [`Err`](enum.result#variant.Err "Err") value, leaving an [`Ok`](enum.result#variant.Ok "Ok") value untouched.
This function can be used to pass through a successful result while handling an error.
##### Examples
Basic usage:
```
fn stringify(x: u32) -> String { format!("error code: {x}") }
let x: Result<u32, u32> = Ok(2);
assert_eq!(x.map_err(stringify), Ok(2));
let x: Result<u32, u32> = Err(13);
assert_eq!(x.map_err(stringify), Err("error code: 13".to_string()));
```
[source](https://doc.rust-lang.org/src/core/result.rs.html#874)#### pub fn inspect<F>(self, f: F) -> Result<T, E>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 [`Ok`](enum.result#variant.Ok "Ok")).
##### Examples
```
#![feature(result_option_inspect)]
let x: u8 = "4"
.parse::<u8>()
.inspect(|x| println!("original: {x}"))
.map(|x| x.pow(3))
.expect("failed to parse number");
```
[source](https://doc.rust-lang.org/src/core/result.rs.html#898)#### pub fn inspect\_err<F>(self, f: F) -> Result<T, E>where F: [FnOnce](../ops/trait.fnonce "trait std::ops::FnOnce")([&](../primitive.reference)E),
🔬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 error (if [`Err`](enum.result#variant.Err "Err")).
##### Examples
```
#![feature(result_option_inspect)]
use std::{fs, io};
fn read() -> io::Result<String> {
fs::read_to_string("address.txt")
.inspect_err(|e| eprintln!("failed to read file: {e}"))
}
```
[source](https://doc.rust-lang.org/src/core/result.rs.html#923-925)1.47.0 · #### pub fn as\_deref(&self) -> Result<&<T as Deref>::Target, &E>where T: [Deref](../ops/trait.deref "trait std::ops::Deref"),
Converts from `Result<T, E>` (or `&Result<T, E>`) to `Result<&<T as Deref>::Target, &E>`.
Coerces the [`Ok`](enum.result#variant.Ok "Ok") variant of the original [`Result`](enum.result "Result") via [`Deref`](../ops/trait.deref) and returns the new [`Result`](enum.result "Result").
##### Examples
```
let x: Result<String, u32> = Ok("hello".to_string());
let y: Result<&str, &u32> = Ok("hello");
assert_eq!(x.as_deref(), y);
let x: Result<String, u32> = Err(42);
let y: Result<&str, &u32> = Err(&42);
assert_eq!(x.as_deref(), y);
```
[source](https://doc.rust-lang.org/src/core/result.rs.html#949-951)1.47.0 · #### pub fn as\_deref\_mut(&mut self) -> Result<&mut <T as Deref>::Target, &mut E>where T: [DerefMut](../ops/trait.derefmut "trait std::ops::DerefMut"),
Converts from `Result<T, E>` (or `&mut Result<T, E>`) to `Result<&mut <T as DerefMut>::Target, &mut E>`.
Coerces the [`Ok`](enum.result#variant.Ok "Ok") variant of the original [`Result`](enum.result "Result") via [`DerefMut`](../ops/trait.derefmut) and returns the new [`Result`](enum.result "Result").
##### Examples
```
let mut s = "HELLO".to_string();
let mut x: Result<String, u32> = Ok("hello".to_string());
let y: Result<&mut str, &mut u32> = Ok(&mut s);
assert_eq!(x.as_deref_mut().map(|x| { x.make_ascii_uppercase(); x }), y);
let mut i = 42;
let mut x: Result<String, u32> = Err(42);
let y: Result<&mut str, &mut u32> = Err(&mut i);
assert_eq!(x.as_deref_mut().map(|x| { x.make_ascii_uppercase(); x }), y);
```
[source](https://doc.rust-lang.org/src/core/result.rs.html#977)#### pub fn iter(&self) -> Iter<'\_, T>
Notable traits for [Iter](struct.iter "struct std::result::Iter")<'a, T>
```
impl<'a, T> Iterator for Iter<'a, T>
type Item = &'a T;
```
Returns an iterator over the possibly contained value.
The iterator yields one value if the result is [`Result::Ok`](enum.result#variant.Ok "Result::Ok"), otherwise none.
##### Examples
Basic usage:
```
let x: Result<u32, &str> = Ok(7);
assert_eq!(x.iter().next(), Some(&7));
let x: Result<u32, &str> = Err("nothing!");
assert_eq!(x.iter().next(), None);
```
[source](https://doc.rust-lang.org/src/core/result.rs.html#1002)#### pub fn iter\_mut(&mut self) -> IterMut<'\_, T>
Notable traits for [IterMut](struct.itermut "struct std::result::IterMut")<'a, T>
```
impl<'a, T> Iterator for IterMut<'a, T>
type Item = &'a mut T;
```
Returns a mutable iterator over the possibly contained value.
The iterator yields one value if the result is [`Result::Ok`](enum.result#variant.Ok "Result::Ok"), otherwise none.
##### Examples
Basic usage:
```
let mut x: Result<u32, &str> = Ok(7);
match x.iter_mut().next() {
Some(v) => *v = 40,
None => {},
}
assert_eq!(x, Ok(40));
let mut x: Result<u32, &str> = Err("nothing!");
assert_eq!(x.iter_mut().next(), None);
```
[source](https://doc.rust-lang.org/src/core/result.rs.html#1058-1060)1.4.0 · #### pub fn expect(self, msg: &str) -> Twhere E: [Debug](../fmt/trait.debug "trait std::fmt::Debug"),
Returns the contained [`Ok`](enum.result#variant.Ok "Ok") value, consuming the `self` value.
Because this function may panic, its use is generally discouraged. Instead, prefer to use pattern matching and handle the [`Err`](enum.result#variant.Err "Err") case explicitly, or call [`unwrap_or`](enum.result#method.unwrap_or), [`unwrap_or_else`](enum.result#method.unwrap_or_else), or [`unwrap_or_default`](enum.result#method.unwrap_or_default).
##### Panics
Panics if the value is an [`Err`](enum.result#variant.Err "Err"), with a panic message including the passed message, and the content of the [`Err`](enum.result#variant.Err "Err").
##### Examples
Basic usage:
ⓘ
```
let x: Result<u32, &str> = Err("emergency failure");
x.expect("Testing expect"); // panics with `Testing expect: emergency failure`
```
##### Recommended Message Style
We recommend that `expect` messages are used to describe the reason you *expect* the `Result` should be `Ok`.
ⓘ
```
let path = std::env::var("IMPORTANT_PATH")
.expect("env variable `IMPORTANT_PATH` should be set by `wrapper_script.sh`");
```
**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/result.rs.html#1101-1103)#### pub fn unwrap(self) -> Twhere E: [Debug](../fmt/trait.debug "trait std::fmt::Debug"),
Returns the contained [`Ok`](enum.result#variant.Ok "Ok") value, consuming the `self` value.
Because this function may panic, its use is generally discouraged. Instead, prefer to use pattern matching and handle the [`Err`](enum.result#variant.Err "Err") case explicitly, or call [`unwrap_or`](enum.result#method.unwrap_or), [`unwrap_or_else`](enum.result#method.unwrap_or_else), or [`unwrap_or_default`](enum.result#method.unwrap_or_default).
##### Panics
Panics if the value is an [`Err`](enum.result#variant.Err "Err"), with a panic message provided by the [`Err`](enum.result#variant.Err "Err")’s value.
##### Examples
Basic usage:
```
let x: Result<u32, &str> = Ok(2);
assert_eq!(x.unwrap(), 2);
```
ⓘ
```
let x: Result<u32, &str> = Err("emergency failure");
x.unwrap(); // panics with `emergency failure`
```
[source](https://doc.rust-lang.org/src/core/result.rs.html#1138-1140)1.16.0 · #### pub fn unwrap\_or\_default(self) -> Twhere T: [Default](../default/trait.default "trait std::default::Default"),
Returns the contained [`Ok`](enum.result#variant.Ok "Ok") value or a default
Consumes the `self` argument then, if [`Ok`](enum.result#variant.Ok "Ok"), returns the contained value, otherwise if [`Err`](enum.result#variant.Err "Err"), returns the default value 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 an [`Err`](enum.result#variant.Err "Err") on error.
```
let good_year_from_input = "1909";
let bad_year_from_input = "190blarg";
let good_year = good_year_from_input.parse().unwrap_or_default();
let bad_year = bad_year_from_input.parse().unwrap_or_default();
assert_eq!(1909, good_year);
assert_eq!(0, bad_year);
```
[source](https://doc.rust-lang.org/src/core/result.rs.html#1167-1169)1.17.0 · #### pub fn expect\_err(self, msg: &str) -> Ewhere T: [Debug](../fmt/trait.debug "trait std::fmt::Debug"),
Returns the contained [`Err`](enum.result#variant.Err "Err") value, consuming the `self` value.
##### Panics
Panics if the value is an [`Ok`](enum.result#variant.Ok "Ok"), with a panic message including the passed message, and the content of the [`Ok`](enum.result#variant.Ok "Ok").
##### Examples
Basic usage:
ⓘ
```
let x: Result<u32, &str> = Ok(10);
x.expect_err("Testing expect_err"); // panics with `Testing expect_err: 10`
```
[source](https://doc.rust-lang.org/src/core/result.rs.html#1198-1200)#### pub fn unwrap\_err(self) -> Ewhere T: [Debug](../fmt/trait.debug "trait std::fmt::Debug"),
Returns the contained [`Err`](enum.result#variant.Err "Err") value, consuming the `self` value.
##### Panics
Panics if the value is an [`Ok`](enum.result#variant.Ok "Ok"), with a custom panic message provided by the [`Ok`](enum.result#variant.Ok "Ok")’s value.
##### Examples
ⓘ
```
let x: Result<u32, &str> = Ok(2);
x.unwrap_err(); // panics with `2`
```
```
let x: Result<u32, &str> = Err("emergency failure");
assert_eq!(x.unwrap_err(), "emergency failure");
```
[source](https://doc.rust-lang.org/src/core/result.rs.html#1235-1237)#### pub fn into\_ok(self) -> Twhere E: [Into](../convert/trait.into "trait std::convert::Into")<[!](../primitive.never)>,
🔬This is a nightly-only experimental API. (`unwrap_infallible` [#61695](https://github.com/rust-lang/rust/issues/61695))
Returns the contained [`Ok`](enum.result#variant.Ok "Ok") value, but never panics.
Unlike [`unwrap`](enum.result#method.unwrap), this method is known to never panic on the result types it is implemented for. Therefore, it can be used instead of `unwrap` as a maintainability safeguard that will fail to compile if the error type of the `Result` is later changed to an error that can actually occur.
##### Examples
Basic usage:
```
fn only_good_news() -> Result<String, !> {
Ok("this is fine".into())
}
let s: String = only_good_news().into_ok();
println!("{s}");
```
[source](https://doc.rust-lang.org/src/core/result.rs.html#1272-1274)#### pub fn into\_err(self) -> Ewhere T: [Into](../convert/trait.into "trait std::convert::Into")<[!](../primitive.never)>,
🔬This is a nightly-only experimental API. (`unwrap_infallible` [#61695](https://github.com/rust-lang/rust/issues/61695))
Returns the contained [`Err`](enum.result#variant.Err "Err") value, but never panics.
Unlike [`unwrap_err`](enum.result#method.unwrap_err), this method is known to never panic on the result types it is implemented for. Therefore, it can be used instead of `unwrap_err` as a maintainability safeguard that will fail to compile if the ok type of the `Result` is later changed to a type that can actually occur.
##### Examples
Basic usage:
```
fn only_bad_news() -> Result<!, String> {
Err("Oops, it failed".into())
}
let error: String = only_bad_news().into_err();
println!("{error}");
```
[source](https://doc.rust-lang.org/src/core/result.rs.html#1318-1322)const: [unstable](https://github.com/rust-lang/rust/issues/92384 "Tracking issue for const_result_drop") · #### pub fn and<U>(self, res: Result<U, E>) -> Result<U, E>
Returns `res` if the result is [`Ok`](enum.result#variant.Ok "Ok"), otherwise returns the [`Err`](enum.result#variant.Err "Err") value of `self`.
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.result#method.and_then), which is lazily evaluated.
##### Examples
Basic usage:
```
let x: Result<u32, &str> = Ok(2);
let y: Result<&str, &str> = Err("late error");
assert_eq!(x.and(y), Err("late error"));
let x: Result<u32, &str> = Err("early error");
let y: Result<&str, &str> = Ok("foo");
assert_eq!(x.and(y), Err("early error"));
let x: Result<u32, &str> = Err("not a 2");
let y: Result<&str, &str> = Err("late error");
assert_eq!(x.and(y), Err("not a 2"));
let x: Result<u32, &str> = Ok(2);
let y: Result<&str, &str> = Ok("different result type");
assert_eq!(x.and(y), Ok("different result type"));
```
[source](https://doc.rust-lang.org/src/core/result.rs.html#1364)#### pub fn and\_then<U, F>(self, op: F) -> Result<U, E>where F: [FnOnce](../ops/trait.fnonce "trait std::ops::FnOnce")(T) -> [Result](enum.result "enum std::result::Result")<U, E>,
Calls `op` if the result is [`Ok`](enum.result#variant.Ok "Ok"), otherwise returns the [`Err`](enum.result#variant.Err "Err") value of `self`.
This function can be used for control flow based on `Result` values.
##### Examples
```
fn sq_then_to_string(x: u32) -> Result<String, &'static str> {
x.checked_mul(x).map(|sq| sq.to_string()).ok_or("overflowed")
}
assert_eq!(Ok(2).and_then(sq_then_to_string), Ok(4.to_string()));
assert_eq!(Ok(1_000_000).and_then(sq_then_to_string), Err("overflowed"));
assert_eq!(Err("not a number").and_then(sq_then_to_string), Err("not a number"));
```
Often used to chain fallible operations that may return [`Err`](enum.result#variant.Err "Err").
```
use std::{io::ErrorKind, path::Path};
// Note: on Windows "/" maps to "C:\"
let root_modified_time = Path::new("/").metadata().and_then(|md| md.modified());
assert!(root_modified_time.is_ok());
let should_fail = Path::new("/bad/path").metadata().and_then(|md| md.modified());
assert!(should_fail.is_err());
assert_eq!(should_fail.unwrap_err().kind(), ErrorKind::NotFound);
```
[source](https://doc.rust-lang.org/src/core/result.rs.html#1403-1407)const: [unstable](https://github.com/rust-lang/rust/issues/92384 "Tracking issue for const_result_drop") · #### pub fn or<F>(self, res: Result<T, F>) -> Result<T, F>
Returns `res` if the result is [`Err`](enum.result#variant.Err "Err"), otherwise returns the [`Ok`](enum.result#variant.Ok "Ok") value of `self`.
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.result#method.or_else), which is lazily evaluated.
##### Examples
Basic usage:
```
let x: Result<u32, &str> = Ok(2);
let y: Result<u32, &str> = Err("late error");
assert_eq!(x.or(y), Ok(2));
let x: Result<u32, &str> = Err("early error");
let y: Result<u32, &str> = Ok(2);
assert_eq!(x.or(y), Ok(2));
let x: Result<u32, &str> = Err("not a 2");
let y: Result<u32, &str> = Err("late error");
assert_eq!(x.or(y), Err("late error"));
let x: Result<u32, &str> = Ok(2);
let y: Result<u32, &str> = Ok(100);
assert_eq!(x.or(y), Ok(2));
```
[source](https://doc.rust-lang.org/src/core/result.rs.html#1437)#### pub fn or\_else<F, O>(self, op: O) -> Result<T, F>where O: [FnOnce](../ops/trait.fnonce "trait std::ops::FnOnce")(E) -> [Result](enum.result "enum std::result::Result")<T, F>,
Calls `op` if the result is [`Err`](enum.result#variant.Err "Err"), otherwise returns the [`Ok`](enum.result#variant.Ok "Ok") value of `self`.
This function can be used for control flow based on result values.
##### Examples
Basic usage:
```
fn sq(x: u32) -> Result<u32, u32> { Ok(x * x) }
fn err(x: u32) -> Result<u32, u32> { Err(x) }
assert_eq!(Ok(2).or_else(sq).or_else(sq), Ok(2));
assert_eq!(Ok(2).or_else(err).or_else(sq), Ok(2));
assert_eq!(Err(3).or_else(sq).or_else(err), Ok(9));
assert_eq!(Err(3).or_else(err).or_else(err), Err(3));
```
[source](https://doc.rust-lang.org/src/core/result.rs.html#1467-1470)const: [unstable](https://github.com/rust-lang/rust/issues/92384 "Tracking issue for const_result_drop") · #### pub fn unwrap\_or(self, default: T) -> T
Returns the contained [`Ok`](enum.result#variant.Ok "Ok") 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.result#method.unwrap_or_else), which is lazily evaluated.
##### Examples
Basic usage:
```
let default = 2;
let x: Result<u32, &str> = Ok(9);
assert_eq!(x.unwrap_or(default), 9);
let x: Result<u32, &str> = Err("error");
assert_eq!(x.unwrap_or(default), default);
```
[source](https://doc.rust-lang.org/src/core/result.rs.html#1495)#### pub fn unwrap\_or\_else<F>(self, op: F) -> Twhere F: [FnOnce](../ops/trait.fnonce "trait std::ops::FnOnce")(E) -> T,
Returns the contained [`Ok`](enum.result#variant.Ok "Ok") value or computes it from a closure.
##### Examples
Basic usage:
```
fn count(x: &str) -> usize { x.len() }
assert_eq!(Ok(2).unwrap_or_else(count), 2);
assert_eq!(Err("foo").unwrap_or_else(count), 3);
```
[source](https://doc.rust-lang.org/src/core/result.rs.html#1525)1.58.0 · #### pub unsafe fn unwrap\_unchecked(self) -> T
Returns the contained [`Ok`](enum.result#variant.Ok "Ok") value, consuming the `self` value, without checking that the value is not an [`Err`](enum.result#variant.Err "Err").
##### Safety
Calling this method on an [`Err`](enum.result#variant.Err "Err") is *[undefined behavior](../../reference/behavior-considered-undefined)*.
##### Examples
```
let x: Result<u32, &str> = Ok(2);
assert_eq!(unsafe { x.unwrap_unchecked() }, 2);
```
```
let x: Result<u32, &str> = Err("emergency failure");
unsafe { x.unwrap_unchecked(); } // Undefined behavior!
```
[source](https://doc.rust-lang.org/src/core/result.rs.html#1557)1.58.0 · #### pub unsafe fn unwrap\_err\_unchecked(self) -> E
Returns the contained [`Err`](enum.result#variant.Err "Err") value, consuming the `self` value, without checking that the value is not an [`Ok`](enum.result#variant.Ok "Ok").
##### Safety
Calling this method on an [`Ok`](enum.result#variant.Ok "Ok") is *[undefined behavior](../../reference/behavior-considered-undefined)*.
##### Examples
```
let x: Result<u32, &str> = Ok(2);
unsafe { x.unwrap_err_unchecked() }; // Undefined behavior!
```
```
let x: Result<u32, &str> = Err("emergency failure");
assert_eq!(unsafe { x.unwrap_err_unchecked() }, "emergency failure");
```
[source](https://doc.rust-lang.org/src/core/result.rs.html#1589-1591)#### 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 result is an [`Ok`](enum.result#variant.Ok "Ok") value containing the given value.
##### Examples
```
#![feature(option_result_contains)]
let x: Result<u32, &str> = Ok(2);
assert_eq!(x.contains(&2), true);
let x: Result<u32, &str> = Ok(3);
assert_eq!(x.contains(&2), false);
let x: Result<u32, &str> = Err("Some error message");
assert_eq!(x.contains(&2), false);
```
[source](https://doc.rust-lang.org/src/core/result.rs.html#1618-1620)#### pub fn contains\_err<F>(&self, f: &F) -> boolwhere F: [PartialEq](../cmp/trait.partialeq "trait std::cmp::PartialEq")<E>,
🔬This is a nightly-only experimental API. (`result_contains_err` [#62358](https://github.com/rust-lang/rust/issues/62358))
Returns `true` if the result is an [`Err`](enum.result#variant.Err "Err") value containing the given value.
##### Examples
```
#![feature(result_contains_err)]
let x: Result<u32, &str> = Ok(2);
assert_eq!(x.contains_err(&"Some error message"), false);
let x: Result<u32, &str> = Err("Some error message");
assert_eq!(x.contains_err(&"Some error message"), true);
let x: Result<u32, &str> = Err("Some other error message");
assert_eq!(x.contains_err(&"Some error message"), false);
```
[source](https://doc.rust-lang.org/src/core/result.rs.html#1629)### impl<T, E> Result<&T, E>
[source](https://doc.rust-lang.org/src/core/result.rs.html#1644-1646)1.59.0 · #### pub fn copied(self) -> Result<T, E>where T: [Copy](../marker/trait.copy "trait std::marker::Copy"),
Maps a `Result<&T, E>` to a `Result<T, E>` by copying the contents of the `Ok` part.
##### Examples
```
let val = 12;
let x: Result<&i32, i32> = Ok(&val);
assert_eq!(x, Ok(&12));
let copied = x.copied();
assert_eq!(copied, Ok(12));
```
[source](https://doc.rust-lang.org/src/core/result.rs.html#1665-1667)1.59.0 · #### pub fn cloned(self) -> Result<T, E>where T: [Clone](../clone/trait.clone "trait std::clone::Clone"),
Maps a `Result<&T, E>` to a `Result<T, E>` by cloning the contents of the `Ok` part.
##### Examples
```
let val = 12;
let x: Result<&i32, i32> = Ok(&val);
assert_eq!(x, Ok(&12));
let cloned = x.cloned();
assert_eq!(cloned, Ok(12));
```
[source](https://doc.rust-lang.org/src/core/result.rs.html#1673)### impl<T, E> Result<&mut T, E>
[source](https://doc.rust-lang.org/src/core/result.rs.html#1688-1690)1.59.0 · #### pub fn copied(self) -> Result<T, E>where T: [Copy](../marker/trait.copy "trait std::marker::Copy"),
Maps a `Result<&mut T, E>` to a `Result<T, E>` by copying the contents of the `Ok` part.
##### Examples
```
let mut val = 12;
let x: Result<&mut i32, i32> = Ok(&mut val);
assert_eq!(x, Ok(&mut 12));
let copied = x.copied();
assert_eq!(copied, Ok(12));
```
[source](https://doc.rust-lang.org/src/core/result.rs.html#1709-1711)1.59.0 · #### pub fn cloned(self) -> Result<T, E>where T: [Clone](../clone/trait.clone "trait std::clone::Clone"),
Maps a `Result<&mut T, E>` to a `Result<T, E>` by cloning the contents of the `Ok` part.
##### Examples
```
let mut val = 12;
let x: Result<&mut i32, i32> = Ok(&mut val);
assert_eq!(x, Ok(&mut 12));
let cloned = x.cloned();
assert_eq!(cloned, Ok(12));
```
[source](https://doc.rust-lang.org/src/core/result.rs.html#1717)### impl<T, E> Result<Option<T>, E>
[source](https://doc.rust-lang.org/src/core/result.rs.html#1736)1.33.0 (const: [unstable](https://github.com/rust-lang/rust/issues/82814 "Tracking issue for const_result")) · #### pub fn transpose(self) -> Option<Result<T, E>>
Transposes a `Result` of an `Option` into an `Option` of a `Result`.
`Ok(None)` will be mapped to `None`. `Ok(Some(_))` and `Err(_)` will be mapped to `Some(Ok(_))` and `Some(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.transpose(), y);
```
[source](https://doc.rust-lang.org/src/core/result.rs.html#1745)### impl<T, E> Result<Result<T, E>, E>
[source](https://doc.rust-lang.org/src/core/result.rs.html#1774)#### pub fn flatten(self) -> Result<T, E>
🔬This is a nightly-only experimental API. (`result_flattening` [#70142](https://github.com/rust-lang/rust/issues/70142))
Converts from `Result<Result<T, E>, E>` to `Result<T, E>`
##### Examples
Basic usage:
```
#![feature(result_flattening)]
let x: Result<Result<&'static str, u32>, u32> = Ok(Ok("hello"));
assert_eq!(Ok("hello"), x.flatten());
let x: Result<Result<&'static str, u32>, u32> = Ok(Err(6));
assert_eq!(Err(6), x.flatten());
let x: Result<Result<&'static str, u32>, u32> = Err(6);
assert_eq!(Err(6), x.flatten());
```
Flattening only removes one level of nesting at a time:
```
#![feature(result_flattening)]
let x: Result<Result<Result<&'static str, u32>, u32>, u32> = Ok(Ok(Ok("hello")));
assert_eq!(Ok(Ok("hello")), x.flatten());
assert_eq!(Ok("hello"), x.flatten().flatten());
```
Trait Implementations
---------------------
[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](../clone/trait.clone "trait std::clone::Clone"), E: [Clone](../clone/trait.clone "trait std::clone::Clone"),
[source](https://doc.rust-lang.org/src/core/result.rs.html#1812)const: [unstable](https://github.com/rust-lang/rust/issues/91805 "Tracking issue for const_clone") · #### fn clone(&self) -> Result<T, E>
Returns a copy of the value. [Read more](../clone/trait.clone#tymethod.clone)
[source](https://doc.rust-lang.org/src/core/result.rs.html#1820)const: [unstable](https://github.com/rust-lang/rust/issues/91805 "Tracking issue for const_clone") · #### fn clone\_from(&mut self, source: &Result<T, E>)
Performs copy-assignment from `source`. [Read more](../clone/trait.clone#method.clone_from)
[source](https://doc.rust-lang.org/src/core/result.rs.html#500)### impl<T, E> Debug for Result<T, E>where T: [Debug](../fmt/trait.debug "trait std::fmt::Debug"), E: [Debug](../fmt/trait.debug "trait std::fmt::Debug"),
[source](https://doc.rust-lang.org/src/core/result.rs.html#500)#### 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/result.rs.html#2024)### impl<A, E, V> FromIterator<Result<A, E>> for Result<V, E>where V: [FromIterator](../iter/trait.fromiterator "trait std::iter::FromIterator")<A>,
[source](https://doc.rust-lang.org/src/core/result.rs.html#2068)#### fn from\_iter<I>(iter: I) -> Result<V, E>where I: [IntoIterator](../iter/trait.intoiterator "trait std::iter::IntoIterator")<Item = [Result](enum.result "enum std::result::Result")<A, E>>,
Takes each element in the `Iterator`: if it is an `Err`, no further elements are taken, and the `Err` is returned. Should no `Err` occur, a container with the values of each `Result` is returned.
Here is an example which increments every integer in a vector, checking for overflow:
```
let v = vec![1, 2];
let res: Result<Vec<u32>, &'static str> = v.iter().map(|x: &u32|
x.checked_add(1).ok_or("Overflow!")
).collect();
assert_eq!(res, Ok(vec![2, 3]));
```
Here is another example that tries to subtract one from another list of integers, this time checking for underflow:
```
let v = vec![1, 2, 0];
let res: Result<Vec<u32>, &'static str> = v.iter().map(|x: &u32|
x.checked_sub(1).ok_or("Underflow!")
).collect();
assert_eq!(res, Err("Underflow!"));
```
Here is a variation on the previous example, showing that no further elements are taken from `iter` after the first `Err`.
```
let v = vec![3, 2, 1, 10];
let mut shared = 0;
let res: Result<Vec<u32>, &'static str> = v.iter().map(|x: &u32| {
shared += x;
x.checked_sub(2).ok_or("Underflow!")
}).collect();
assert_eq!(res, Err("Underflow!"));
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/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/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/result.rs.html#2103)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn from\_residual(residual: Result<Infallible, 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](../ops/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](../ops/trait.fromresidual#tymethod.from_residual)
[source](https://doc.rust-lang.org/src/core/result.rs.html#500)### impl<T, E> Hash for Result<T, E>where T: [Hash](../hash/trait.hash "trait std::hash::Hash"), E: [Hash](../hash/trait.hash "trait std::hash::Hash"),
[source](https://doc.rust-lang.org/src/core/result.rs.html#500)#### 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/result.rs.html#1858)1.4.0 · ### impl<'a, T, E> IntoIterator for &'a Result<T, E>
#### 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/result.rs.html#1862)#### fn into\_iter(self) -> Iter<'a, T>
Notable traits for [Iter](struct.iter "struct std::result::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/core/result.rs.html#1868)1.4.0 · ### impl<'a, T, E> IntoIterator for &'a mut Result<T, E>
#### 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/result.rs.html#1872)#### fn into\_iter(self) -> IterMut<'a, T>
Notable traits for [IterMut](struct.itermut "struct std::result::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/core/result.rs.html#1830)### impl<T, E> IntoIterator for Result<T, E>
[source](https://doc.rust-lang.org/src/core/result.rs.html#1852)#### fn into\_iter(self) -> IntoIter<T>
Notable traits for [IntoIter](struct.intoiter "struct std::result::IntoIter")<T>
```
impl<T> Iterator for IntoIter<T>
type Item = T;
```
Returns a consuming iterator over the possibly contained value.
The iterator yields one value if the result is [`Result::Ok`](enum.result#variant.Ok "Result::Ok"), otherwise none.
##### Examples
Basic usage:
```
let x: Result<u32, &str> = Ok(5);
let v: Vec<u32> = x.into_iter().collect();
assert_eq!(v, [5]);
let x: Result<u32, &str> = Err("nothing!");
let v: Vec<u32> = x.into_iter().collect();
assert_eq!(v, []);
```
#### 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/result.rs.html#500)### impl<T, E> Ord for Result<T, E>where T: [Ord](../cmp/trait.ord "trait std::cmp::Ord"), E: [Ord](../cmp/trait.ord "trait std::cmp::Ord"),
[source](https://doc.rust-lang.org/src/core/result.rs.html#500)#### fn cmp(&self, other: &Result<T, E>) -> 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/result.rs.html#500)### impl<T, E> PartialEq<Result<T, E>> for Result<T, E>where T: [PartialEq](../cmp/trait.partialeq "trait std::cmp::PartialEq")<T>, E: [PartialEq](../cmp/trait.partialeq "trait std::cmp::PartialEq")<E>,
[source](https://doc.rust-lang.org/src/core/result.rs.html#500)#### fn eq(&self, other: &Result<T, E>) -> 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/result.rs.html#500)### impl<T, E> PartialOrd<Result<T, E>> for Result<T, E>where T: [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<T>, E: [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<E>,
[source](https://doc.rust-lang.org/src/core/result.rs.html#500)#### fn partial\_cmp(&self, other: &Result<T, E>) -> 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#175)1.16.0 · ### impl<T, U, E> Product<Result<U, E>> for Result<T, E>where T: [Product](../iter/trait.product "trait std::iter::Product")<U>,
[source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#182-184)#### fn product<I>(iter: I) -> Result<T, E>where I: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = [Result](enum.result "enum std::result::Result")<U, E>>,
Takes each element in the [`Iterator`](../iter/trait.iterator "Iterator"): if it is an [`Err`](enum.result#variant.Err "Err"), no further elements are taken, and the [`Err`](enum.result#variant.Err "Err") is returned. Should no [`Err`](enum.result#variant.Err "Err") occur, the product of all elements is returned.
[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>
🔬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#145)1.16.0 · ### impl<T, U, E> Sum<Result<U, E>> for Result<T, E>where T: [Sum](../iter/trait.sum "trait std::iter::Sum")<U>,
[source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#166-168)#### fn sum<I>(iter: I) -> Result<T, E>where I: [Iterator](../iter/trait.iterator "trait std::iter::Iterator")<Item = [Result](enum.result "enum std::result::Result")<U, E>>,
Takes each element in the [`Iterator`](../iter/trait.iterator "Iterator"): if it is an [`Err`](enum.result#variant.Err "Err"), no further elements are taken, and the [`Err`](enum.result#variant.Err "Err") is returned. Should no [`Err`](enum.result#variant.Err "Err") occur, the sum of all elements is returned.
##### Examples
This sums up every integer in a vector, rejecting the sum if a negative element is encountered:
```
let v = vec![1, 2];
let res: Result<i32, &'static str> = v.iter().map(|&x: &i32|
if x < 0 { Err("Negative element found") }
else { Ok(x) }
).sum();
assert_eq!(res, Ok(3));
```
[source](https://doc.rust-lang.org/src/std/process.rs.html#2198-2210)1.61.0 · ### impl<T: Termination, E: Debug> Termination for Result<T, E>
[source](https://doc.rust-lang.org/src/std/process.rs.html#2199-2209)#### fn report(self) -> ExitCode
Is called to get the representation of the value as status code. This status code is returned to the operating system. [Read more](../process/trait.termination#tymethod.report)
[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
🔬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/result.rs.html#2083)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn from\_output(output: <Result<T, E> as Try>::Output) -> 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/result.rs.html#2088)const: [unstable](https://github.com/rust-lang/rust/issues/88674 "Tracking issue for const_convert") · #### fn branch( self) -> ControlFlow<<Result<T, E> as Try>::Residual, <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/result.rs.html#500)### impl<T, E> Copy for Result<T, E>where T: [Copy](../marker/trait.copy "trait std::marker::Copy"), E: [Copy](../marker/trait.copy "trait std::marker::Copy"),
[source](https://doc.rust-lang.org/src/core/result.rs.html#500)### impl<T, E> Eq for Result<T, E>where T: [Eq](../cmp/trait.eq "trait std::cmp::Eq"), E: [Eq](../cmp/trait.eq "trait std::cmp::Eq"),
[source](https://doc.rust-lang.org/src/core/result.rs.html#500)### impl<T, E> StructuralEq for Result<T, E>
[source](https://doc.rust-lang.org/src/core/result.rs.html#500)### impl<T, E> StructuralPartialEq for Result<T, E>
Auto Trait Implementations
--------------------------
### impl<T, E> RefUnwindSafe for Result<T, E>where E: [RefUnwindSafe](../panic/trait.refunwindsafe "trait std::panic::RefUnwindSafe"), T: [RefUnwindSafe](../panic/trait.refunwindsafe "trait std::panic::RefUnwindSafe"),
### impl<T, E> Send for Result<T, E>where E: [Send](../marker/trait.send "trait std::marker::Send"), T: [Send](../marker/trait.send "trait std::marker::Send"),
### impl<T, E> Sync for Result<T, E>where E: [Sync](../marker/trait.sync "trait std::marker::Sync"), T: [Sync](../marker/trait.sync "trait std::marker::Sync"),
### impl<T, E> Unpin for Result<T, E>where E: [Unpin](../marker/trait.unpin "trait std::marker::Unpin"), T: [Unpin](../marker/trait.unpin "trait std::marker::Unpin"),
### impl<T, E> UnwindSafe for Result<T, E>where E: [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 Struct std::net::SocketAddrV6 Struct std::net::SocketAddrV6
=============================
```
pub struct SocketAddrV6 { /* private fields */ }
```
An IPv6 socket address.
IPv6 socket addresses consist of an [`IPv6` address](struct.ipv6addr), a 16-bit port number, as well as fields containing the traffic class, the flow label, and a scope identifier (see [IETF RFC 2553, Section 3.3](https://tools.ietf.org/html/rfc2553#section-3.3) for more details).
See [`SocketAddr`](enum.socketaddr "SocketAddr") for a type encompassing both IPv4 and IPv6 socket addresses.
The size of a `SocketAddrV6` struct may vary depending on the target operating system. Do not assume that this type has the same memory layout as the underlying system representation.
Examples
--------
```
use std::net::{Ipv6Addr, SocketAddrV6};
let socket = SocketAddrV6::new(Ipv6Addr::new(0x2001, 0xdb8, 0, 0, 0, 0, 0, 1), 8080, 0, 0);
assert_eq!("[2001:db8::1]:8080".parse(), Ok(socket));
assert_eq!(socket.ip(), &Ipv6Addr::new(0x2001, 0xdb8, 0, 0, 0, 0, 0, 1));
assert_eq!(socket.port(), 8080);
```
Implementations
---------------
[source](https://doc.rust-lang.org/src/std/net/parser.rs.html#387-403)### impl SocketAddrV6
[source](https://doc.rust-lang.org/src/std/net/parser.rs.html#400-402)#### pub fn parse\_ascii(b: &[u8]) -> Result<Self, AddrParseError>
🔬This is a nightly-only experimental API. (`addr_parse_ascii` [#101035](https://github.com/rust-lang/rust/issues/101035))
Parse an IPv6 socket address from a slice of bytes.
```
#![feature(addr_parse_ascii)]
use std::net::{Ipv6Addr, SocketAddrV6};
let socket = SocketAddrV6::new(Ipv6Addr::new(0x2001, 0xdb8, 0, 0, 0, 0, 0, 1), 8080, 0, 0);
assert_eq!(SocketAddrV6::parse_ascii(b"[2001:db8::1]:8080"), Ok(socket));
```
[source](https://doc.rust-lang.org/src/std/net/socket_addr.rs.html#355-529)### impl SocketAddrV6
[source](https://doc.rust-lang.org/src/std/net/socket_addr.rs.html#375-377)const: [unstable](https://github.com/rust-lang/rust/issues/82485 "Tracking issue for const_socketaddr") · #### pub fn new(ip: Ipv6Addr, port: u16, flowinfo: u32, scope\_id: u32) -> SocketAddrV6
Creates a new socket address from an [`IPv6` address](struct.ipv6addr), a 16-bit port number, and the `flowinfo` and `scope_id` fields.
For more information on the meaning and layout of the `flowinfo` and `scope_id` parameters, see [IETF RFC 2553, Section 3.3](https://tools.ietf.org/html/rfc2553#section-3.3).
##### Examples
```
use std::net::{SocketAddrV6, Ipv6Addr};
let socket = SocketAddrV6::new(Ipv6Addr::new(0, 0, 0, 0, 0, 0, 0, 1), 8080, 0, 0);
```
[source](https://doc.rust-lang.org/src/std/net/socket_addr.rs.html#392-394)const: [unstable](https://github.com/rust-lang/rust/issues/82485 "Tracking issue for const_socketaddr") · #### pub fn ip(&self) -> &Ipv6Addr
Returns the IP address associated with this socket address.
##### Examples
```
use std::net::{SocketAddrV6, Ipv6Addr};
let socket = SocketAddrV6::new(Ipv6Addr::new(0, 0, 0, 0, 0, 0, 0, 1), 8080, 0, 0);
assert_eq!(socket.ip(), &Ipv6Addr::new(0, 0, 0, 0, 0, 0, 0, 1));
```
[source](https://doc.rust-lang.org/src/std/net/socket_addr.rs.html#408-410)1.9.0 · #### pub fn set\_ip(&mut self, new\_ip: Ipv6Addr)
Changes the IP address associated with this socket address.
##### Examples
```
use std::net::{SocketAddrV6, Ipv6Addr};
let mut socket = SocketAddrV6::new(Ipv6Addr::new(0, 0, 0, 0, 0, 0, 0, 1), 8080, 0, 0);
socket.set_ip(Ipv6Addr::new(76, 45, 0, 0, 0, 0, 0, 0));
assert_eq!(socket.ip(), &Ipv6Addr::new(76, 45, 0, 0, 0, 0, 0, 0));
```
[source](https://doc.rust-lang.org/src/std/net/socket_addr.rs.html#425-427)const: [unstable](https://github.com/rust-lang/rust/issues/82485 "Tracking issue for const_socketaddr") · #### pub fn port(&self) -> u16
Returns the port number associated with this socket address.
##### Examples
```
use std::net::{SocketAddrV6, Ipv6Addr};
let socket = SocketAddrV6::new(Ipv6Addr::new(0, 0, 0, 0, 0, 0, 0, 1), 8080, 0, 0);
assert_eq!(socket.port(), 8080);
```
[source](https://doc.rust-lang.org/src/std/net/socket_addr.rs.html#441-443)1.9.0 · #### pub fn set\_port(&mut self, new\_port: u16)
Changes the port number associated with this socket address.
##### Examples
```
use std::net::{SocketAddrV6, Ipv6Addr};
let mut socket = SocketAddrV6::new(Ipv6Addr::new(0, 0, 0, 0, 0, 0, 0, 1), 8080, 0, 0);
socket.set_port(4242);
assert_eq!(socket.port(), 4242);
```
[source](https://doc.rust-lang.org/src/std/net/socket_addr.rs.html#468-470)const: [unstable](https://github.com/rust-lang/rust/issues/82485 "Tracking issue for const_socketaddr") · #### pub fn flowinfo(&self) -> u32
Returns the flow information associated with this address.
This information corresponds to the `sin6_flowinfo` field in C’s `netinet/in.h`, as specified in [IETF RFC 2553, Section 3.3](https://tools.ietf.org/html/rfc2553#section-3.3). It combines information about the flow label and the traffic class as specified in [IETF RFC 2460](https://tools.ietf.org/html/rfc2460), respectively [Section 6](https://tools.ietf.org/html/rfc2460#section-6) and [Section 7](https://tools.ietf.org/html/rfc2460#section-7).
##### Examples
```
use std::net::{SocketAddrV6, Ipv6Addr};
let socket = SocketAddrV6::new(Ipv6Addr::new(0, 0, 0, 0, 0, 0, 0, 1), 8080, 10, 0);
assert_eq!(socket.flowinfo(), 10);
```
[source](https://doc.rust-lang.org/src/std/net/socket_addr.rs.html#486-488)1.9.0 · #### pub fn set\_flowinfo(&mut self, new\_flowinfo: u32)
Changes the flow information associated with this socket address.
See [`SocketAddrV6::flowinfo`](struct.socketaddrv6#method.flowinfo "SocketAddrV6::flowinfo")’s documentation for more details.
##### Examples
```
use std::net::{SocketAddrV6, Ipv6Addr};
let mut socket = SocketAddrV6::new(Ipv6Addr::new(0, 0, 0, 0, 0, 0, 0, 1), 8080, 10, 0);
socket.set_flowinfo(56);
assert_eq!(socket.flowinfo(), 56);
```
[source](https://doc.rust-lang.org/src/std/net/socket_addr.rs.html#508-510)const: [unstable](https://github.com/rust-lang/rust/issues/82485 "Tracking issue for const_socketaddr") · #### pub fn scope\_id(&self) -> u32
Returns the scope ID associated with this address.
This information corresponds to the `sin6_scope_id` field in C’s `netinet/in.h`, as specified in [IETF RFC 2553, Section 3.3](https://tools.ietf.org/html/rfc2553#section-3.3).
##### Examples
```
use std::net::{SocketAddrV6, Ipv6Addr};
let socket = SocketAddrV6::new(Ipv6Addr::new(0, 0, 0, 0, 0, 0, 0, 1), 8080, 0, 78);
assert_eq!(socket.scope_id(), 78);
```
[source](https://doc.rust-lang.org/src/std/net/socket_addr.rs.html#526-528)1.9.0 · #### pub fn set\_scope\_id(&mut self, new\_scope\_id: u32)
Changes the scope ID associated with this socket address.
See [`SocketAddrV6::scope_id`](struct.socketaddrv6#method.scope_id "SocketAddrV6::scope_id")’s documentation for more details.
##### Examples
```
use std::net::{SocketAddrV6, Ipv6Addr};
let mut socket = SocketAddrV6::new(Ipv6Addr::new(0, 0, 0, 0, 0, 0, 0, 1), 8080, 0, 78);
socket.set_scope_id(42);
assert_eq!(socket.scope_id(), 42);
```
Trait Implementations
---------------------
[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/std/net/socket_addr.rs.html#111)#### fn clone(&self) -> SocketAddrV6
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/net/socket_addr.rs.html#672-676)### impl Debug for SocketAddrV6
[source](https://doc.rust-lang.org/src/std/net/socket_addr.rs.html#673-675)#### 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/net/socket_addr.rs.html#645-669)### impl Display for SocketAddrV6
[source](https://doc.rust-lang.org/src/std/net/socket_addr.rs.html#646-668)#### 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/net/socket_addr.rs.html#581-586)1.16.0 · ### impl From<SocketAddrV6> for SocketAddr
[source](https://doc.rust-lang.org/src/std/net/socket_addr.rs.html#583-585)#### fn from(sock6: SocketAddrV6) -> SocketAddr
Converts a [`SocketAddrV6`](struct.socketaddrv6 "SocketAddrV6") into a [`SocketAddr::V6`](enum.socketaddr#variant.V6 "SocketAddr::V6").
[source](https://doc.rust-lang.org/src/std/net/parser.rs.html#406-411)1.5.0 · ### impl FromStr for SocketAddrV6
#### type Err = AddrParseError
The associated error which can be returned from parsing.
[source](https://doc.rust-lang.org/src/std/net/parser.rs.html#408-410)#### fn from\_str(s: &str) -> Result<SocketAddrV6, AddrParseError>
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/net/socket_addr.rs.html#713-717)### impl Hash for SocketAddrV6
[source](https://doc.rust-lang.org/src/std/net/socket_addr.rs.html#714-716)#### fn hash<H: Hasher>(&self, s: &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/net/socket_addr.rs.html#700-704)1.45.0 · ### impl Ord for SocketAddrV6
[source](https://doc.rust-lang.org/src/std/net/socket_addr.rs.html#701-703)#### fn cmp(&self, other: &SocketAddrV6) -> 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/net/socket_addr.rs.html#111)### impl PartialEq<SocketAddrV6> for SocketAddrV6
[source](https://doc.rust-lang.org/src/std/net/socket_addr.rs.html#111)#### fn eq(&self, other: &SocketAddrV6) -> 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/net/socket_addr.rs.html#686-690)1.45.0 · ### impl PartialOrd<SocketAddrV6> for SocketAddrV6
[source](https://doc.rust-lang.org/src/std/net/socket_addr.rs.html#687-689)#### fn partial\_cmp(&self, other: &SocketAddrV6) -> 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/net/socket_addr.rs.html#861-866)### impl ToSocketAddrs for SocketAddrV6
#### type Iter = IntoIter<SocketAddr>
Returned iterator over socket addresses which this type may correspond to. [Read more](trait.tosocketaddrs#associatedtype.Iter)
[source](https://doc.rust-lang.org/src/std/net/socket_addr.rs.html#863-865)#### fn to\_socket\_addrs(&self) -> Result<IntoIter<SocketAddr>>
Converts this object to an iterator of resolved [`SocketAddr`](enum.socketaddr "SocketAddr")s. [Read more](trait.tosocketaddrs#tymethod.to_socket_addrs)
[source](https://doc.rust-lang.org/src/std/net/socket_addr.rs.html#111)### impl Copy for SocketAddrV6
[source](https://doc.rust-lang.org/src/std/net/socket_addr.rs.html#111)### impl Eq for SocketAddrV6
[source](https://doc.rust-lang.org/src/std/net/socket_addr.rs.html#111)### impl StructuralEq for SocketAddrV6
[source](https://doc.rust-lang.org/src/std/net/socket_addr.rs.html#111)### impl StructuralPartialEq for SocketAddrV6
Auto Trait Implementations
--------------------------
### impl RefUnwindSafe for SocketAddrV6
### impl Send for SocketAddrV6
### impl Sync for SocketAddrV6
### impl Unpin for SocketAddrV6
### impl UnwindSafe for SocketAddrV6
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.
rust Enum std::net::SocketAddr Enum std::net::SocketAddr
=========================
```
pub enum SocketAddr {
V4(SocketAddrV4),
V6(SocketAddrV6),
}
```
An internet socket address, either IPv4 or IPv6.
Internet socket addresses consist of an [IP address](enum.ipaddr), a 16-bit port number, as well as possibly some version-dependent additional information. See [`SocketAddrV4`](struct.socketaddrv4 "SocketAddrV4")’s and [`SocketAddrV6`](struct.socketaddrv6 "SocketAddrV6")’s respective documentation for more details.
The size of a `SocketAddr` instance may vary depending on the target operating system.
Examples
--------
```
use std::net::{IpAddr, Ipv4Addr, SocketAddr};
let socket = SocketAddr::new(IpAddr::V4(Ipv4Addr::new(127, 0, 0, 1)), 8080);
assert_eq!("127.0.0.1:8080".parse(), Ok(socket));
assert_eq!(socket.port(), 8080);
assert_eq!(socket.is_ipv4(), true);
```
Variants
--------
### `V4([SocketAddrV4](struct.socketaddrv4 "struct std::net::SocketAddrV4"))`
An IPv4 socket address.
### `V6([SocketAddrV6](struct.socketaddrv6 "struct std::net::SocketAddrV6"))`
An IPv6 socket address.
Implementations
---------------
[source](https://doc.rust-lang.org/src/std/net/parser.rs.html#413-431)### impl SocketAddr
[source](https://doc.rust-lang.org/src/std/net/parser.rs.html#428-430)#### pub fn parse\_ascii(b: &[u8]) -> Result<Self, AddrParseError>
🔬This is a nightly-only experimental API. (`addr_parse_ascii` [#101035](https://github.com/rust-lang/rust/issues/101035))
Parse a socket address from a slice of bytes.
```
#![feature(addr_parse_ascii)]
use std::net::{IpAddr, Ipv4Addr, Ipv6Addr, SocketAddr};
let socket_v4 = SocketAddr::new(IpAddr::V4(Ipv4Addr::new(127, 0, 0, 1)), 8080);
let socket_v6 = SocketAddr::new(IpAddr::V6(Ipv6Addr::new(0, 0, 0, 0, 0, 0, 0, 1)), 8080);
assert_eq!(SocketAddr::parse_ascii(b"127.0.0.1:8080"), Ok(socket_v4));
assert_eq!(SocketAddr::parse_ascii(b"[::1]:8080"), Ok(socket_v6));
```
[source](https://doc.rust-lang.org/src/std/net/socket_addr.rs.html#120-267)### impl SocketAddr
[source](https://doc.rust-lang.org/src/std/net/socket_addr.rs.html#137-142)1.7.0 (const: [unstable](https://github.com/rust-lang/rust/issues/82485 "Tracking issue for const_socketaddr")) · #### pub fn new(ip: IpAddr, port: u16) -> SocketAddr
Creates a new socket address from an [IP address](enum.ipaddr) and a port number.
##### Examples
```
use std::net::{IpAddr, Ipv4Addr, SocketAddr};
let socket = SocketAddr::new(IpAddr::V4(Ipv4Addr::new(127, 0, 0, 1)), 8080);
assert_eq!(socket.ip(), IpAddr::V4(Ipv4Addr::new(127, 0, 0, 1)));
assert_eq!(socket.port(), 8080);
```
[source](https://doc.rust-lang.org/src/std/net/socket_addr.rs.html#157-162)1.7.0 (const: [unstable](https://github.com/rust-lang/rust/issues/82485 "Tracking issue for const_socketaddr")) · #### pub fn ip(&self) -> IpAddr
Returns the IP address associated with this socket address.
##### Examples
```
use std::net::{IpAddr, Ipv4Addr, SocketAddr};
let socket = SocketAddr::new(IpAddr::V4(Ipv4Addr::new(127, 0, 0, 1)), 8080);
assert_eq!(socket.ip(), IpAddr::V4(Ipv4Addr::new(127, 0, 0, 1)));
```
[source](https://doc.rust-lang.org/src/std/net/socket_addr.rs.html#176-183)1.9.0 · #### pub fn set\_ip(&mut self, new\_ip: IpAddr)
Changes the IP address associated with this socket address.
##### Examples
```
use std::net::{IpAddr, Ipv4Addr, SocketAddr};
let mut socket = SocketAddr::new(IpAddr::V4(Ipv4Addr::new(127, 0, 0, 1)), 8080);
socket.set_ip(IpAddr::V4(Ipv4Addr::new(10, 10, 0, 1)));
assert_eq!(socket.ip(), IpAddr::V4(Ipv4Addr::new(10, 10, 0, 1)));
```
[source](https://doc.rust-lang.org/src/std/net/socket_addr.rs.html#198-203)const: [unstable](https://github.com/rust-lang/rust/issues/82485 "Tracking issue for const_socketaddr") · #### pub fn port(&self) -> u16
Returns the port number associated with this socket address.
##### Examples
```
use std::net::{IpAddr, Ipv4Addr, SocketAddr};
let socket = SocketAddr::new(IpAddr::V4(Ipv4Addr::new(127, 0, 0, 1)), 8080);
assert_eq!(socket.port(), 8080);
```
[source](https://doc.rust-lang.org/src/std/net/socket_addr.rs.html#217-222)1.9.0 · #### pub fn set\_port(&mut self, new\_port: u16)
Changes the port number associated with this socket address.
##### Examples
```
use std::net::{IpAddr, Ipv4Addr, SocketAddr};
let mut socket = SocketAddr::new(IpAddr::V4(Ipv4Addr::new(127, 0, 0, 1)), 8080);
socket.set_port(1025);
assert_eq!(socket.port(), 1025);
```
[source](https://doc.rust-lang.org/src/std/net/socket_addr.rs.html#242-244)1.16.0 (const: [unstable](https://github.com/rust-lang/rust/issues/82485 "Tracking issue for const_socketaddr")) · #### pub fn is\_ipv4(&self) -> bool
Returns [`true`](../primitive.bool "true") if the [IP address](enum.ipaddr) in this `SocketAddr` is an [`IPv4` address](enum.ipaddr#variant.V4), and [`false`](../primitive.bool "false") otherwise.
##### Examples
```
use std::net::{IpAddr, Ipv4Addr, SocketAddr};
let socket = SocketAddr::new(IpAddr::V4(Ipv4Addr::new(127, 0, 0, 1)), 8080);
assert_eq!(socket.is_ipv4(), true);
assert_eq!(socket.is_ipv6(), false);
```
[source](https://doc.rust-lang.org/src/std/net/socket_addr.rs.html#264-266)1.16.0 (const: [unstable](https://github.com/rust-lang/rust/issues/82485 "Tracking issue for const_socketaddr")) · #### pub fn is\_ipv6(&self) -> bool
Returns [`true`](../primitive.bool "true") if the [IP address](enum.ipaddr) in this `SocketAddr` is an [`IPv6` address](enum.ipaddr#variant.V6), and [`false`](../primitive.bool "false") otherwise.
##### Examples
```
use std::net::{IpAddr, Ipv6Addr, SocketAddr};
let socket = SocketAddr::new(IpAddr::V6(Ipv6Addr::new(0, 0, 0, 0, 0, 65535, 0, 1)), 8080);
assert_eq!(socket.is_ipv4(), false);
assert_eq!(socket.is_ipv6(), true);
```
Trait Implementations
---------------------
[source](https://doc.rust-lang.org/src/std/net/socket_addr.rs.html#42)### impl Clone for SocketAddr
[source](https://doc.rust-lang.org/src/std/net/socket_addr.rs.html#42)#### 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)#### 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/net/socket_addr.rs.html#612-616)### impl Debug for SocketAddr
[source](https://doc.rust-lang.org/src/std/net/socket_addr.rs.html#613-615)#### 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/net/socket_addr.rs.html#602-609)### impl Display for SocketAddr
[source](https://doc.rust-lang.org/src/std/net/socket_addr.rs.html#603-608)#### 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/net/socket_addr.rs.html#589-599)1.17.0 · ### impl<I: Into<IpAddr>> From<(I, u16)> for SocketAddr
[source](https://doc.rust-lang.org/src/std/net/socket_addr.rs.html#596-598)#### fn from(pieces: (I, u16)) -> SocketAddr
Converts a tuple struct (Into<[`IpAddr`](enum.ipaddr "IpAddr")>, `u16`) into a [`SocketAddr`](enum.socketaddr "SocketAddr").
This conversion creates a [`SocketAddr::V4`](enum.socketaddr#variant.V4 "SocketAddr::V4") for an [`IpAddr::V4`](enum.ipaddr#variant.V4 "IpAddr::V4") and creates a [`SocketAddr::V6`](enum.socketaddr#variant.V6 "SocketAddr::V6") for an [`IpAddr::V6`](enum.ipaddr#variant.V6 "IpAddr::V6").
`u16` is treated as port of the newly created [`SocketAddr`](enum.socketaddr "SocketAddr").
[source](https://doc.rust-lang.org/src/std/net/socket_addr.rs.html#573-578)1.16.0 · ### impl From<SocketAddrV4> for SocketAddr
[source](https://doc.rust-lang.org/src/std/net/socket_addr.rs.html#575-577)#### fn from(sock4: SocketAddrV4) -> SocketAddr
Converts a [`SocketAddrV4`](struct.socketaddrv4 "SocketAddrV4") into a [`SocketAddr::V4`](enum.socketaddr#variant.V4 "SocketAddr::V4").
[source](https://doc.rust-lang.org/src/std/net/socket_addr.rs.html#581-586)1.16.0 · ### impl From<SocketAddrV6> for SocketAddr
[source](https://doc.rust-lang.org/src/std/net/socket_addr.rs.html#583-585)#### fn from(sock6: SocketAddrV6) -> SocketAddr
Converts a [`SocketAddrV6`](struct.socketaddrv6 "SocketAddrV6") into a [`SocketAddr::V6`](enum.socketaddr#variant.V6 "SocketAddr::V6").
[source](https://doc.rust-lang.org/src/std/net/parser.rs.html#434-439)### impl FromStr for SocketAddr
#### type Err = AddrParseError
The associated error which can be returned from parsing.
[source](https://doc.rust-lang.org/src/std/net/parser.rs.html#436-438)#### fn from\_str(s: &str) -> Result<SocketAddr, AddrParseError>
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/net/socket_addr.rs.html#42)### impl Hash for SocketAddr
[source](https://doc.rust-lang.org/src/std/net/socket_addr.rs.html#42)#### 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/net/socket_addr.rs.html#42)### impl Ord for SocketAddr
[source](https://doc.rust-lang.org/src/std/net/socket_addr.rs.html#42)#### fn cmp(&self, other: &SocketAddr) -> 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/net/socket_addr.rs.html#42)### impl PartialEq<SocketAddr> for SocketAddr
[source](https://doc.rust-lang.org/src/std/net/socket_addr.rs.html#42)#### fn eq(&self, other: &SocketAddr) -> 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/net/socket_addr.rs.html#42)### impl PartialOrd<SocketAddr> for SocketAddr
[source](https://doc.rust-lang.org/src/std/net/socket_addr.rs.html#42)#### fn partial\_cmp(&self, other: &SocketAddr) -> 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/net/socket_addr.rs.html#845-850)### impl ToSocketAddrs for SocketAddr
#### type Iter = IntoIter<SocketAddr>
Returned iterator over socket addresses which this type may correspond to. [Read more](trait.tosocketaddrs#associatedtype.Iter)
[source](https://doc.rust-lang.org/src/std/net/socket_addr.rs.html#847-849)#### fn to\_socket\_addrs(&self) -> Result<IntoIter<SocketAddr>>
Converts this object to an iterator of resolved [`SocketAddr`](enum.socketaddr "SocketAddr")s. [Read more](trait.tosocketaddrs#tymethod.to_socket_addrs)
[source](https://doc.rust-lang.org/src/std/net/socket_addr.rs.html#42)### impl Copy for SocketAddr
[source](https://doc.rust-lang.org/src/std/net/socket_addr.rs.html#42)### impl Eq for SocketAddr
[source](https://doc.rust-lang.org/src/std/net/socket_addr.rs.html#42)### impl StructuralEq for SocketAddr
[source](https://doc.rust-lang.org/src/std/net/socket_addr.rs.html#42)### impl StructuralPartialEq for SocketAddr
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/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::net Module std::net
===============
Networking primitives for TCP/UDP communication.
This module provides networking functionality for the Transmission Control and User Datagram Protocols, as well as types for IP and socket addresses.
Organization
------------
* [`TcpListener`](struct.tcplistener "TcpListener") and [`TcpStream`](struct.tcpstream "TcpStream") provide functionality for communication over TCP
* [`UdpSocket`](struct.udpsocket "UdpSocket") provides functionality for communication over UDP
* [`IpAddr`](enum.ipaddr "IpAddr") represents IP addresses of either IPv4 or IPv6; [`Ipv4Addr`](struct.ipv4addr "Ipv4Addr") and [`Ipv6Addr`](struct.ipv6addr "Ipv6Addr") are respectively IPv4 and IPv6 addresses
* [`SocketAddr`](enum.socketaddr "SocketAddr") represents socket addresses of either IPv4 or IPv6; [`SocketAddrV4`](struct.socketaddrv4 "SocketAddrV4") and [`SocketAddrV6`](struct.socketaddrv6 "SocketAddrV6") are respectively IPv4 and IPv6 socket addresses
* [`ToSocketAddrs`](trait.tosocketaddrs "ToSocketAddrs") is a trait that used for generic address resolution when interacting with networking objects like [`TcpListener`](struct.tcplistener "TcpListener"), [`TcpStream`](struct.tcpstream "TcpStream") or [`UdpSocket`](struct.udpsocket "UdpSocket")
* Other types are return or parameter types for various methods in this module
Rust disables inheritance of socket objects to child processes by default when possible. For example, through the use of the `CLOEXEC` flag in UNIX systems or the `HANDLE_FLAG_INHERIT` flag on Windows.
Structs
-------
[IntoIncoming](struct.intoincoming "std::net::IntoIncoming struct")Experimental
An iterator that infinitely [`accept`](struct.tcplistener#method.accept)s connections on a [`TcpListener`](struct.tcplistener "TcpListener").
[AddrParseError](struct.addrparseerror "std::net::AddrParseError struct")
An error which can be returned when parsing an IP address or a socket address.
[Incoming](struct.incoming "std::net::Incoming struct")
An iterator that infinitely [`accept`](struct.tcplistener#method.accept)s connections on a [`TcpListener`](struct.tcplistener "TcpListener").
[Ipv4Addr](struct.ipv4addr "std::net::Ipv4Addr struct")
An IPv4 address.
[Ipv6Addr](struct.ipv6addr "std::net::Ipv6Addr struct")
An IPv6 address.
[SocketAddrV4](struct.socketaddrv4 "std::net::SocketAddrV4 struct")
An IPv4 socket address.
[SocketAddrV6](struct.socketaddrv6 "std::net::SocketAddrV6 struct")
An IPv6 socket address.
[TcpListener](struct.tcplistener "std::net::TcpListener struct")
A TCP socket server, listening for connections.
[TcpStream](struct.tcpstream "std::net::TcpStream struct")
A TCP stream between a local and a remote socket.
[UdpSocket](struct.udpsocket "std::net::UdpSocket struct")
A UDP socket.
Enums
-----
[Ipv6MulticastScope](enum.ipv6multicastscope "std::net::Ipv6MulticastScope enum")Experimental
Scope of an [IPv6 multicast address](struct.ipv6addr) as defined in [IETF RFC 7346 section 2](https://tools.ietf.org/html/rfc7346#section-2).
[IpAddr](enum.ipaddr "std::net::IpAddr enum")
An IP address, either IPv4 or IPv6.
[Shutdown](enum.shutdown "std::net::Shutdown enum")
Possible values which can be passed to the [`TcpStream::shutdown`](struct.tcpstream#method.shutdown "TcpStream::shutdown") method.
[SocketAddr](enum.socketaddr "std::net::SocketAddr enum")
An internet socket address, either IPv4 or IPv6.
Traits
------
[ToSocketAddrs](trait.tosocketaddrs "std::net::ToSocketAddrs trait")
A trait for objects which can be converted or resolved to one or more [`SocketAddr`](enum.socketaddr "SocketAddr") values.
rust Struct std::net::Ipv4Addr Struct std::net::Ipv4Addr
=========================
```
pub struct Ipv4Addr { /* private fields */ }
```
An IPv4 address.
IPv4 addresses are defined as 32-bit integers in [IETF RFC 791](https://tools.ietf.org/html/rfc791). They are usually represented as four octets.
See [`IpAddr`](enum.ipaddr "IpAddr") for a type encompassing both IPv4 and IPv6 addresses.
Textual representation
----------------------
`Ipv4Addr` provides a [`FromStr`](../str/trait.fromstr) implementation. The four octets are in decimal notation, divided by `.` (this is called “dot-decimal notation”). Notably, octal numbers (which are indicated with a leading `0`) and hexadecimal numbers (which are indicated with a leading `0x`) are not allowed per [IETF RFC 6943](https://tools.ietf.org/html/rfc6943#section-3.1.1).
Examples
--------
```
use std::net::Ipv4Addr;
let localhost = Ipv4Addr::new(127, 0, 0, 1);
assert_eq!("127.0.0.1".parse(), Ok(localhost));
assert_eq!(localhost.is_loopback(), true);
assert!("012.004.002.000".parse::<Ipv4Addr>().is_err()); // all octets are in octal
assert!("0000000.0.0.0".parse::<Ipv4Addr>().is_err()); // first octet is a zero in octal
assert!("0xcb.0x0.0x71.0x00".parse::<Ipv4Addr>().is_err()); // all octets are in hex
```
Implementations
---------------
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#441-927)### impl Ipv4Addr
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#457-459)const: 1.32.0 · #### pub const fn new(a: u8, b: u8, c: u8, d: u8) -> Ipv4Addr
Creates a new IPv4 address from four eight-bit octets.
The result will represent the IP address `a`.`b`.`c`.`d`.
##### Examples
```
use std::net::Ipv4Addr;
let addr = Ipv4Addr::new(127, 0, 0, 1);
```
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#472)1.30.0 · #### pub const LOCALHOST: Self = \_
An IPv4 address with the address pointing to localhost: `127.0.0.1`
##### Examples
```
use std::net::Ipv4Addr;
let addr = Ipv4Addr::LOCALHOST;
assert_eq!(addr, Ipv4Addr::new(127, 0, 0, 1));
```
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#488)1.30.0 · #### pub const UNSPECIFIED: Self = \_
An IPv4 address representing an unspecified address: `0.0.0.0`
This corresponds to the constant `INADDR_ANY` in other languages.
##### Examples
```
use std::net::Ipv4Addr;
let addr = Ipv4Addr::UNSPECIFIED;
assert_eq!(addr, Ipv4Addr::new(0, 0, 0, 0));
```
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#501)1.30.0 · #### pub const BROADCAST: Self = \_
An IPv4 address representing the broadcast address: `255.255.255.255`
##### Examples
```
use std::net::Ipv4Addr;
let addr = Ipv4Addr::BROADCAST;
assert_eq!(addr, Ipv4Addr::new(255, 255, 255, 255));
```
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#517-519)const: 1.50.0 · #### pub const fn octets(&self) -> [u8; 4]
Returns the four eight-bit integers that make up this address.
##### Examples
```
use std::net::Ipv4Addr;
let addr = Ipv4Addr::new(127, 0, 0, 1);
assert_eq!(addr.octets(), [127, 0, 0, 1]);
```
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#540-542)1.12.0 (const: 1.32.0) · #### pub const fn is\_unspecified(&self) -> bool
Returns [`true`](../primitive.bool "true") for the special ‘unspecified’ address (`0.0.0.0`).
This property is defined in *UNIX Network Programming, Second Edition*, W. Richard Stevens, p. 891; see also [ip7](https://man7.org/linux/man-pages/man7/ip.7.html).
##### Examples
```
use std::net::Ipv4Addr;
assert_eq!(Ipv4Addr::new(0, 0, 0, 0).is_unspecified(), true);
assert_eq!(Ipv4Addr::new(45, 22, 13, 197).is_unspecified(), false);
```
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#562-564)1.7.0 (const: 1.50.0) · #### pub const fn is\_loopback(&self) -> bool
Returns [`true`](../primitive.bool "true") if this is a loopback address (`127.0.0.0/8`).
This property is defined by [IETF RFC 1122](https://tools.ietf.org/html/rfc1122).
##### Examples
```
use std::net::Ipv4Addr;
assert_eq!(Ipv4Addr::new(127, 0, 0, 1).is_loopback(), true);
assert_eq!(Ipv4Addr::new(45, 22, 13, 197).is_loopback(), false);
```
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#593-600)1.7.0 (const: 1.50.0) · #### pub const fn is\_private(&self) -> bool
Returns [`true`](../primitive.bool "true") if this is a private address.
The private address ranges are defined in [IETF RFC 1918](https://tools.ietf.org/html/rfc1918) and include:
* `10.0.0.0/8`
* `172.16.0.0/12`
* `192.168.0.0/16`
##### Examples
```
use std::net::Ipv4Addr;
assert_eq!(Ipv4Addr::new(10, 0, 0, 1).is_private(), true);
assert_eq!(Ipv4Addr::new(10, 10, 10, 10).is_private(), true);
assert_eq!(Ipv4Addr::new(172, 16, 10, 10).is_private(), true);
assert_eq!(Ipv4Addr::new(172, 29, 45, 14).is_private(), true);
assert_eq!(Ipv4Addr::new(172, 32, 0, 2).is_private(), false);
assert_eq!(Ipv4Addr::new(192, 168, 0, 2).is_private(), true);
assert_eq!(Ipv4Addr::new(192, 169, 0, 2).is_private(), false);
```
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#621-623)1.7.0 (const: 1.50.0) · #### pub const fn is\_link\_local(&self) -> bool
Returns [`true`](../primitive.bool "true") if the address is link-local (`169.254.0.0/16`).
This property is defined by [IETF RFC 3927](https://tools.ietf.org/html/rfc3927).
##### Examples
```
use std::net::Ipv4Addr;
assert_eq!(Ipv4Addr::new(169, 254, 0, 0).is_link_local(), true);
assert_eq!(Ipv4Addr::new(169, 254, 10, 65).is_link_local(), true);
assert_eq!(Ipv4Addr::new(16, 89, 10, 65).is_link_local(), false);
```
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#701-713)const: [unstable](https://github.com/rust-lang/rust/issues/76205 "Tracking issue for const_ipv4") · #### pub fn is\_global(&self) -> bool
🔬This is a nightly-only experimental API. (`ip` [#27709](https://github.com/rust-lang/rust/issues/27709))
Returns [`true`](../primitive.bool "true") if the address appears to be globally reachable as specified by the [IANA IPv4 Special-Purpose Address Registry](https://www.iana.org/assignments/iana-ipv4-special-registry/iana-ipv4-special-registry.xhtml). Whether or not an address is practically reachable will depend on your network configuration.
Most IPv4 addresses are globally reachable; unless they are specifically defined as *not* globally reachable.
Non-exhaustive list of notable addresses that are not globally reachable:
* The [unspecified address](struct.ipv4addr#associatedconstant.UNSPECIFIED) ([`is_unspecified`](struct.ipv4addr#method.is_unspecified))
* Addresses reserved for private use ([`is_private`](struct.ipv4addr#method.is_private))
* Addresses in the shared address space ([`is_shared`](struct.ipv4addr#method.is_shared))
* Loopback addresses ([`is_loopback`](struct.ipv4addr#method.is_loopback))
* Link-local addresses ([`is_link_local`](struct.ipv4addr#method.is_link_local))
* Addresses reserved for documentation ([`is_documentation`](struct.ipv4addr#method.is_documentation))
* Addresses reserved for benchmarking ([`is_benchmarking`](struct.ipv4addr#method.is_benchmarking))
* Reserved addresses ([`is_reserved`](struct.ipv4addr#method.is_reserved))
* The [broadcast address](struct.ipv4addr#associatedconstant.BROADCAST) ([`is_broadcast`](struct.ipv4addr#method.is_broadcast))
For the complete overview of which addresses are globally reachable, see the table at the [IANA IPv4 Special-Purpose Address Registry](https://www.iana.org/assignments/iana-ipv4-special-registry/iana-ipv4-special-registry.xhtml).
##### Examples
```
#![feature(ip)]
use std::net::Ipv4Addr;
// Most IPv4 addresses are globally reachable:
assert_eq!(Ipv4Addr::new(80, 9, 12, 3).is_global(), true);
// However some addresses have been assigned a special meaning
// that makes them not globally reachable. Some examples are:
// The unspecified address (`0.0.0.0`)
assert_eq!(Ipv4Addr::UNSPECIFIED.is_global(), false);
// Addresses reserved for private use (`10.0.0.0/8`, `172.16.0.0/12`, 192.168.0.0/16)
assert_eq!(Ipv4Addr::new(10, 254, 0, 0).is_global(), false);
assert_eq!(Ipv4Addr::new(192, 168, 10, 65).is_global(), false);
assert_eq!(Ipv4Addr::new(172, 16, 10, 65).is_global(), false);
// Addresses in the shared address space (`100.64.0.0/10`)
assert_eq!(Ipv4Addr::new(100, 100, 0, 0).is_global(), false);
// The loopback addresses (`127.0.0.0/8`)
assert_eq!(Ipv4Addr::LOCALHOST.is_global(), false);
// Link-local addresses (`169.254.0.0/16`)
assert_eq!(Ipv4Addr::new(169, 254, 45, 1).is_global(), false);
// Addresses reserved for documentation (`192.0.2.0/24`, `198.51.100.0/24`, `203.0.113.0/24`)
assert_eq!(Ipv4Addr::new(192, 0, 2, 255).is_global(), false);
assert_eq!(Ipv4Addr::new(198, 51, 100, 65).is_global(), false);
assert_eq!(Ipv4Addr::new(203, 0, 113, 6).is_global(), false);
// Addresses reserved for benchmarking (`198.18.0.0/15`)
assert_eq!(Ipv4Addr::new(198, 18, 0, 0).is_global(), false);
// Reserved addresses (`240.0.0.0/4`)
assert_eq!(Ipv4Addr::new(250, 10, 20, 30).is_global(), false);
// The broadcast address (`255.255.255.255`)
assert_eq!(Ipv4Addr::BROADCAST.is_global(), false);
// For a complete overview see the IANA IPv4 Special-Purpose Address Registry.
```
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#734-736)const: [unstable](https://github.com/rust-lang/rust/issues/76205 "Tracking issue for const_ipv4") · #### pub fn is\_shared(&self) -> bool
🔬This is a nightly-only experimental API. (`ip` [#27709](https://github.com/rust-lang/rust/issues/27709))
Returns [`true`](../primitive.bool "true") if this address is part of the Shared Address Space defined in [IETF RFC 6598](https://tools.ietf.org/html/rfc6598) (`100.64.0.0/10`).
##### Examples
```
#![feature(ip)]
use std::net::Ipv4Addr;
assert_eq!(Ipv4Addr::new(100, 64, 0, 0).is_shared(), true);
assert_eq!(Ipv4Addr::new(100, 127, 255, 255).is_shared(), true);
assert_eq!(Ipv4Addr::new(100, 128, 0, 0).is_shared(), false);
```
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#760-762)const: [unstable](https://github.com/rust-lang/rust/issues/76205 "Tracking issue for const_ipv4") · #### pub fn is\_benchmarking(&self) -> bool
🔬This is a nightly-only experimental API. (`ip` [#27709](https://github.com/rust-lang/rust/issues/27709))
Returns [`true`](../primitive.bool "true") if this address part of the `198.18.0.0/15` range, which is reserved for network devices benchmarking. This range is defined in [IETF RFC 2544](https://tools.ietf.org/html/rfc2544) as `192.18.0.0` through `198.19.255.255` but [errata 423](https://www.rfc-editor.org/errata/eid423) corrects it to `198.18.0.0/15`.
##### Examples
```
#![feature(ip)]
use std::net::Ipv4Addr;
assert_eq!(Ipv4Addr::new(198, 17, 255, 255).is_benchmarking(), false);
assert_eq!(Ipv4Addr::new(198, 18, 0, 0).is_benchmarking(), true);
assert_eq!(Ipv4Addr::new(198, 19, 255, 255).is_benchmarking(), true);
assert_eq!(Ipv4Addr::new(198, 20, 0, 0).is_benchmarking(), false);
```
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#795-797)const: [unstable](https://github.com/rust-lang/rust/issues/76205 "Tracking issue for const_ipv4") · #### pub fn is\_reserved(&self) -> bool
🔬This is a nightly-only experimental API. (`ip` [#27709](https://github.com/rust-lang/rust/issues/27709))
Returns [`true`](../primitive.bool "true") if this address is reserved by IANA for future use. [IETF RFC 1112](https://tools.ietf.org/html/rfc1112) defines the block of reserved addresses as `240.0.0.0/4`. This range normally includes the broadcast address `255.255.255.255`, but this implementation explicitly excludes it, since it is obviously not reserved for future use.
##### Warning
As IANA assigns new addresses, this method will be updated. This may result in non-reserved addresses being treated as reserved in code that relies on an outdated version of this method.
##### Examples
```
#![feature(ip)]
use std::net::Ipv4Addr;
assert_eq!(Ipv4Addr::new(240, 0, 0, 0).is_reserved(), true);
assert_eq!(Ipv4Addr::new(255, 255, 255, 254).is_reserved(), true);
assert_eq!(Ipv4Addr::new(239, 255, 255, 255).is_reserved(), false);
// The broadcast address is not considered as reserved for future use by this implementation
assert_eq!(Ipv4Addr::new(255, 255, 255, 255).is_reserved(), false);
```
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#819-821)1.7.0 (const: 1.50.0) · #### pub const fn is\_multicast(&self) -> bool
Returns [`true`](../primitive.bool "true") if this is a multicast address (`224.0.0.0/4`).
Multicast addresses have a most significant octet between `224` and `239`, and is defined by [IETF RFC 5771](https://tools.ietf.org/html/rfc5771).
##### Examples
```
use std::net::Ipv4Addr;
assert_eq!(Ipv4Addr::new(224, 254, 0, 0).is_multicast(), true);
assert_eq!(Ipv4Addr::new(236, 168, 10, 65).is_multicast(), true);
assert_eq!(Ipv4Addr::new(172, 16, 10, 65).is_multicast(), false);
```
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#841-843)1.7.0 (const: 1.50.0) · #### pub const fn is\_broadcast(&self) -> bool
Returns [`true`](../primitive.bool "true") if this is a broadcast address (`255.255.255.255`).
A broadcast address has all octets set to `255` as defined in [IETF RFC 919](https://tools.ietf.org/html/rfc919).
##### Examples
```
use std::net::Ipv4Addr;
assert_eq!(Ipv4Addr::new(255, 255, 255, 255).is_broadcast(), true);
assert_eq!(Ipv4Addr::new(236, 168, 10, 65).is_broadcast(), false);
```
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#869-871)1.7.0 (const: 1.50.0) · #### pub const fn is\_documentation(&self) -> bool
Returns [`true`](../primitive.bool "true") if this address is in a range designated for documentation.
This is defined in [IETF RFC 5737](https://tools.ietf.org/html/rfc5737):
* `192.0.2.0/24` (TEST-NET-1)
* `198.51.100.0/24` (TEST-NET-2)
* `203.0.113.0/24` (TEST-NET-3)
##### Examples
```
use std::net::Ipv4Addr;
assert_eq!(Ipv4Addr::new(192, 0, 2, 255).is_documentation(), true);
assert_eq!(Ipv4Addr::new(198, 51, 100, 65).is_documentation(), true);
assert_eq!(Ipv4Addr::new(203, 0, 113, 6).is_documentation(), true);
assert_eq!(Ipv4Addr::new(193, 34, 17, 19).is_documentation(), false);
```
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#898-901)const: 1.50.0 · #### pub const fn to\_ipv6\_compatible(&self) -> Ipv6Addr
Converts this address to an [IPv4-compatible](struct.ipv6addr#ipv4-compatible-ipv6-addresses) [`IPv6` address](struct.ipv6addr).
`a.b.c.d` becomes `::a.b.c.d`
Note that IPv4-compatible addresses have been officially deprecated. If you don’t explicitly need an IPv4-compatible address for legacy reasons, consider using `to_ipv6_mapped` instead.
##### Examples
```
use std::net::{Ipv4Addr, Ipv6Addr};
assert_eq!(
Ipv4Addr::new(192, 0, 2, 255).to_ipv6_compatible(),
Ipv6Addr::new(0, 0, 0, 0, 0, 0, 0xc000, 0x2ff)
);
```
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#923-926)const: 1.50.0 · #### pub const fn to\_ipv6\_mapped(&self) -> Ipv6Addr
Converts this address to an [IPv4-mapped](struct.ipv6addr#ipv4-mapped-ipv6-addresses) [`IPv6` address](struct.ipv6addr).
`a.b.c.d` becomes `::ffff:a.b.c.d`
##### Examples
```
use std::net::{Ipv4Addr, Ipv6Addr};
assert_eq!(Ipv4Addr::new(192, 0, 2, 255).to_ipv6_mapped(),
Ipv6Addr::new(0, 0, 0, 0, 0, 0xffff, 0xc000, 0x2ff));
```
[source](https://doc.rust-lang.org/src/std/net/parser.rs.html#304-325)### impl Ipv4Addr
[source](https://doc.rust-lang.org/src/std/net/parser.rs.html#317-324)#### pub fn parse\_ascii(b: &[u8]) -> Result<Self, AddrParseError>
🔬This is a nightly-only experimental API. (`addr_parse_ascii` [#101035](https://github.com/rust-lang/rust/issues/101035))
Parse an IPv4 address from a slice of bytes.
```
#![feature(addr_parse_ascii)]
use std::net::Ipv4Addr;
let localhost = Ipv4Addr::new(127, 0, 0, 1);
assert_eq!(Ipv4Addr::parse_ascii(b"127.0.0.1"), Ok(localhost));
```
Trait Implementations
---------------------
[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#75)#### fn clone(&self) -> Ipv4Addr
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/net/ip_addr.rs.html#1012-1016)### impl Debug for Ipv4Addr
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#1013-1015)#### 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/net/ip_addr.rs.html#991-1009)### impl Display for Ipv4Addr
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#992-1008)#### fn fmt(&self, fmt: &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/net/ip_addr.rs.html#1129-1144)1.9.0 · ### impl From<[u8; 4]> for Ipv4Addr
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#1141-1143)#### fn from(octets: [u8; 4]) -> Ipv4Addr
Creates an `Ipv4Addr` from a four element byte array.
##### Examples
```
use std::net::Ipv4Addr;
let addr = Ipv4Addr::from([13u8, 12u8, 11u8, 10u8]);
assert_eq!(Ipv4Addr::new(13, 12, 11, 10), addr);
```
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#947-966)1.16.0 · ### impl From<Ipv4Addr> for IpAddr
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#963-965)#### fn from(ipv4: Ipv4Addr) -> IpAddr
Copies this address to a new `IpAddr::V4`.
##### Examples
```
use std::net::{IpAddr, Ipv4Addr};
let addr = Ipv4Addr::new(127, 0, 0, 1);
assert_eq!(
IpAddr::V4(addr),
IpAddr::from(addr)
)
```
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#1093-1108)1.1.0 · ### impl From<Ipv4Addr> for u32
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#1105-1107)#### fn from(ip: Ipv4Addr) -> u32
Converts an `Ipv4Addr` into a host byte order `u32`.
##### Examples
```
use std::net::Ipv4Addr;
let addr = Ipv4Addr::new(0x12, 0x34, 0x56, 0x78);
assert_eq!(0x12345678, u32::from(addr));
```
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#1111-1126)1.1.0 · ### impl From<u32> for Ipv4Addr
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#1123-1125)#### fn from(ip: u32) -> Ipv4Addr
Converts a host byte order `u32` into an `Ipv4Addr`.
##### Examples
```
use std::net::Ipv4Addr;
let addr = Ipv4Addr::from(0x12345678);
assert_eq!(Ipv4Addr::new(0x12, 0x34, 0x56, 0x78), addr);
```
[source](https://doc.rust-lang.org/src/std/net/parser.rs.html#328-333)### impl FromStr for Ipv4Addr
#### type Err = AddrParseError
The associated error which can be returned from parsing.
[source](https://doc.rust-lang.org/src/std/net/parser.rs.html#330-332)#### fn from\_str(s: &str) -> Result<Ipv4Addr, AddrParseError>
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/net/ip_addr.rs.html#75)### impl Hash for Ipv4Addr
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#75)#### 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/net/ip_addr.rs.html#1071-1076)### impl Ord for Ipv4Addr
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#1073-1075)#### fn cmp(&self, other: &Ipv4Addr) -> 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/net/ip_addr.rs.html#1030-1038)1.16.0 · ### impl PartialEq<IpAddr> for Ipv4Addr
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#1032-1037)#### fn eq(&self, other: &IpAddr) -> 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/net/ip_addr.rs.html#1019-1027)1.16.0 · ### impl PartialEq<Ipv4Addr> for IpAddr
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#1021-1026)#### fn eq(&self, other: &Ipv4Addr) -> 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/net/ip_addr.rs.html#75)### impl PartialEq<Ipv4Addr> for Ipv4Addr
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#75)#### fn eq(&self, other: &Ipv4Addr) -> 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/net/ip_addr.rs.html#1060-1068)1.16.0 · ### impl PartialOrd<IpAddr> for Ipv4Addr
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#1062-1067)#### fn partial\_cmp(&self, other: &IpAddr) -> 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/net/ip_addr.rs.html#1049-1057)1.16.0 · ### impl PartialOrd<Ipv4Addr> for IpAddr
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#1051-1056)#### fn partial\_cmp(&self, other: &Ipv4Addr) -> 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/net/ip_addr.rs.html#1041-1046)### impl PartialOrd<Ipv4Addr> for Ipv4Addr
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#1043-1045)#### fn partial\_cmp(&self, other: &Ipv4Addr) -> 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/net/ip_addr.rs.html#75)### impl Copy for Ipv4Addr
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#75)### impl Eq for Ipv4Addr
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#75)### impl StructuralEq for Ipv4Addr
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#75)### impl StructuralPartialEq for Ipv4Addr
Auto Trait Implementations
--------------------------
### impl RefUnwindSafe for Ipv4Addr
### impl Send for Ipv4Addr
### impl Sync for Ipv4Addr
### impl Unpin for Ipv4Addr
### impl UnwindSafe for Ipv4Addr
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::net::Incoming Struct std::net::Incoming
=========================
```
pub struct Incoming<'a> { /* private fields */ }
```
An iterator that infinitely [`accept`](struct.tcplistener#method.accept)s connections on a [`TcpListener`](struct.tcplistener "TcpListener").
This `struct` is created by the [`TcpListener::incoming`](struct.tcplistener#method.incoming "TcpListener::incoming") method. See its documentation for more.
Trait Implementations
---------------------
[source](https://doc.rust-lang.org/src/std/net/tcp.rs.html#96)### impl<'a> Debug for Incoming<'a>
[source](https://doc.rust-lang.org/src/std/net/tcp.rs.html#96)#### 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/net/tcp.rs.html#1006-1011)### impl<'a> Iterator for Incoming<'a>
#### type Item = Result<TcpStream, Error>
The type of the elements being iterated over.
[source](https://doc.rust-lang.org/src/std/net/tcp.rs.html#1008-1010)#### fn next(&mut self) -> Option<Result<TcpStream>>
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)#### 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)#### 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)
[source](https://doc.rust-lang.org/src/std/net/tcp.rs.html#1014)1.64.0 · ### impl FusedIterator for Incoming<'\_>
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::net::AddrParseError Struct std::net::AddrParseError
===============================
```
pub struct AddrParseError(_);
```
An error which can be returned when parsing an IP address or a socket address.
This error is used as the error type for the [`FromStr`](../str/trait.fromstr "FromStr") implementation for [`IpAddr`](enum.ipaddr "IpAddr"), [`Ipv4Addr`](struct.ipv4addr "Ipv4Addr"), [`Ipv6Addr`](struct.ipv6addr "Ipv6Addr"), [`SocketAddr`](enum.socketaddr "SocketAddr"), [`SocketAddrV4`](struct.socketaddrv4 "SocketAddrV4"), and [`SocketAddrV6`](struct.socketaddrv6 "SocketAddrV6").
Potential causes
----------------
`AddrParseError` may be thrown because the provided string does not parse as the given type, often because it includes information only handled by a different address type.
ⓘ
```
use std::net::IpAddr;
let _foo: IpAddr = "127.0.0.1:8080".parse().expect("Cannot handle the socket port");
```
[`IpAddr`](enum.ipaddr "IpAddr") doesn’t handle the port. Use [`SocketAddr`](enum.socketaddr "SocketAddr") instead.
```
use std::net::SocketAddr;
// No problem, the `panic!` message has disappeared.
let _foo: SocketAddr = "127.0.0.1:8080".parse().expect("unreachable panic");
```
Trait Implementations
---------------------
[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/parser.rs.html#476)#### fn clone(&self) -> AddrParseError
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/net/parser.rs.html#476)### impl Debug for AddrParseError
[source](https://doc.rust-lang.org/src/std/net/parser.rs.html#476)#### 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/net/parser.rs.html#480-485)1.4.0 · ### impl Display for AddrParseError
[source](https://doc.rust-lang.org/src/std/net/parser.rs.html#482-484)#### fn fmt(&self, fmt: &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/net/parser.rs.html#488-500)1.4.0 · ### impl Error for AddrParseError
[source](https://doc.rust-lang.org/src/std/net/parser.rs.html#490-499)#### 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/net/parser.rs.html#476)### impl PartialEq<AddrParseError> for AddrParseError
[source](https://doc.rust-lang.org/src/std/net/parser.rs.html#476)#### fn eq(&self, other: &AddrParseError) -> 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/net/parser.rs.html#476)### impl Eq for AddrParseError
[source](https://doc.rust-lang.org/src/std/net/parser.rs.html#476)### impl StructuralEq for AddrParseError
[source](https://doc.rust-lang.org/src/std/net/parser.rs.html#476)### impl StructuralPartialEq for AddrParseError
Auto Trait Implementations
--------------------------
### impl RefUnwindSafe for AddrParseError
### impl Send for AddrParseError
### impl Sync for AddrParseError
### impl Unpin for AddrParseError
### impl UnwindSafe for AddrParseError
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::net::UdpSocket Struct std::net::UdpSocket
==========================
```
pub struct UdpSocket(_);
```
A UDP socket.
After creating a `UdpSocket` by [`bind`](struct.udpsocket#method.bind)ing it to a socket address, data can be [sent to](struct.udpsocket#method.send_to) and [received from](struct.udpsocket#method.recv_from) any other socket address.
Although UDP is a connectionless protocol, this implementation provides an interface to set an address where data should be sent and received from. After setting a remote address with [`connect`](struct.udpsocket#method.connect), data can be sent to and received from that address with [`send`](struct.udpsocket#method.send) and [`recv`](struct.udpsocket#method.recv).
As stated in the User Datagram Protocol’s specification in [IETF RFC 768](https://tools.ietf.org/html/rfc768), UDP is an unordered, unreliable protocol; refer to [`TcpListener`](struct.tcplistener) and [`TcpStream`](struct.tcpstream) for TCP primitives.
Examples
--------
```
use std::net::UdpSocket;
fn main() -> std::io::Result<()> {
{
let socket = UdpSocket::bind("127.0.0.1:34254")?;
// Receives a single datagram message on the socket. If `buf` is too small to hold
// the message, it will be cut off.
let mut buf = [0; 10];
let (amt, src) = socket.recv_from(&mut buf)?;
// Redeclare `buf` as slice of the received data and send reverse data back to origin.
let buf = &mut buf[..amt];
buf.reverse();
socket.send_to(buf, &src)?;
} // the socket is closed here
Ok(())
}
```
Implementations
---------------
[source](https://doc.rust-lang.org/src/std/net/udp.rs.html#60-782)### impl UdpSocket
[source](https://doc.rust-lang.org/src/std/net/udp.rs.html#94-96)#### pub fn bind<A: ToSocketAddrs>(addr: A) -> Result<UdpSocket>
Creates a UDP socket from the given address.
The address type can be any implementor of [`ToSocketAddrs`](trait.tosocketaddrs "ToSocketAddrs") trait. See its documentation for concrete examples.
If `addr` yields multiple addresses, `bind` will be attempted with each of the addresses until one succeeds and returns the socket. If none of the addresses succeed in creating a socket, the error returned from the last attempt (the last address) is returned.
##### Examples
Creates a UDP socket bound to `127.0.0.1:3400`:
```
use std::net::UdpSocket;
let socket = UdpSocket::bind("127.0.0.1:3400").expect("couldn't bind to address");
```
Creates a UDP socket bound to `127.0.0.1:3400`. If the socket cannot be bound to that address, create a UDP socket bound to `127.0.0.1:3401`:
```
use std::net::{SocketAddr, UdpSocket};
let addrs = [
SocketAddr::from(([127, 0, 0, 1], 3400)),
SocketAddr::from(([127, 0, 0, 1], 3401)),
];
let socket = UdpSocket::bind(&addrs[..]).expect("couldn't bind to address");
```
[source](https://doc.rust-lang.org/src/std/net/udp.rs.html#117-119)#### pub fn recv\_from(&self, buf: &mut [u8]) -> Result<(usize, SocketAddr)>
Receives a single datagram message on the socket. On success, returns the number of bytes read and the origin.
The function must be called with valid byte array `buf` of sufficient size to hold the message bytes. If a message is too long to fit in the supplied buffer, excess bytes may be discarded.
##### Examples
```
use std::net::UdpSocket;
let socket = UdpSocket::bind("127.0.0.1:34254").expect("couldn't bind to address");
let mut buf = [0; 10];
let (number_of_bytes, src_addr) = socket.recv_from(&mut buf)
.expect("Didn't receive data");
let filled_buf = &mut buf[..number_of_bytes];
```
[source](https://doc.rust-lang.org/src/std/net/udp.rs.html#146-148)1.18.0 · #### pub fn peek\_from(&self, buf: &mut [u8]) -> Result<(usize, SocketAddr)>
Receives a single datagram message on the socket, without removing it from the queue. On success, returns the number of bytes read and the origin.
The function must be called with valid byte array `buf` of sufficient size to hold the message bytes. If a message is too long to fit in the supplied buffer, excess bytes may be discarded.
Successive calls return the same data. This is accomplished by passing `MSG_PEEK` as a flag to the underlying `recvfrom` system call.
Do not use this function to implement busy waiting, instead use `libc::poll` to synchronize IO events on one or more sockets.
##### Examples
```
use std::net::UdpSocket;
let socket = UdpSocket::bind("127.0.0.1:34254").expect("couldn't bind to address");
let mut buf = [0; 10];
let (number_of_bytes, src_addr) = socket.peek_from(&mut buf)
.expect("Didn't receive data");
let filled_buf = &mut buf[..number_of_bytes];
```
[source](https://doc.rust-lang.org/src/std/net/udp.rs.html#175-182)#### pub fn send\_to<A: ToSocketAddrs>(&self, buf: &[u8], addr: A) -> Result<usize>
Sends data on the socket to the given address. On success, returns the number of bytes written.
Address type can be any implementor of [`ToSocketAddrs`](trait.tosocketaddrs "ToSocketAddrs") trait. See its documentation for concrete examples.
It is possible for `addr` to yield multiple addresses, but `send_to` will only send data to the first address yielded by `addr`.
This will return an error when the IP version of the local socket does not match that returned from [`ToSocketAddrs`](trait.tosocketaddrs "ToSocketAddrs").
See [Issue #34202](https://github.com/rust-lang/rust/issues/34202) for more details.
##### Examples
```
use std::net::UdpSocket;
let socket = UdpSocket::bind("127.0.0.1:34254").expect("couldn't bind to address");
socket.send_to(&[0; 10], "127.0.0.1:4242").expect("couldn't send data");
```
[source](https://doc.rust-lang.org/src/std/net/udp.rs.html#209-211)1.40.0 · #### pub fn peer\_addr(&self) -> Result<SocketAddr>
Returns the socket address of the remote peer this socket was connected to.
##### Examples
```
use std::net::{Ipv4Addr, SocketAddr, SocketAddrV4, UdpSocket};
let socket = UdpSocket::bind("127.0.0.1:34254").expect("couldn't bind to address");
socket.connect("192.168.0.1:41203").expect("couldn't connect to address");
assert_eq!(socket.peer_addr().unwrap(),
SocketAddr::V4(SocketAddrV4::new(Ipv4Addr::new(192, 168, 0, 1), 41203)));
```
If the socket isn’t connected, it will return a [`NotConnected`](../io/enum.errorkind#variant.NotConnected) error.
```
use std::net::UdpSocket;
let socket = UdpSocket::bind("127.0.0.1:34254").expect("couldn't bind to address");
assert_eq!(socket.peer_addr().unwrap_err().kind(),
std::io::ErrorKind::NotConnected);
```
[source](https://doc.rust-lang.org/src/std/net/udp.rs.html#225-227)#### pub fn local\_addr(&self) -> Result<SocketAddr>
Returns the socket address that this socket was created from.
##### Examples
```
use std::net::{Ipv4Addr, SocketAddr, SocketAddrV4, UdpSocket};
let socket = UdpSocket::bind("127.0.0.1:34254").expect("couldn't bind to address");
assert_eq!(socket.local_addr().unwrap(),
SocketAddr::V4(SocketAddrV4::new(Ipv4Addr::new(127, 0, 0, 1), 34254)));
```
[source](https://doc.rust-lang.org/src/std/net/udp.rs.html#244-246)#### pub fn try\_clone(&self) -> Result<UdpSocket>
Creates a new independently owned handle to the underlying socket.
The returned `UdpSocket` is a reference to the same socket that this object references. Both handles will read and write the same port, and options set on one socket will be propagated to the other.
##### Examples
```
use std::net::UdpSocket;
let socket = UdpSocket::bind("127.0.0.1:34254").expect("couldn't bind to address");
let socket_clone = socket.try_clone().expect("couldn't clone the socket");
```
[source](https://doc.rust-lang.org/src/std/net/udp.rs.html#287-289)1.4.0 · #### pub fn set\_read\_timeout(&self, dur: Option<Duration>) -> Result<()>
Sets the read timeout to the timeout specified.
If the value specified 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.
##### Platform-specific behavior
Platforms may return a different error code whenever a read times out as a result of setting this option. For example Unix typically returns an error of the kind [`WouldBlock`](../io/enum.errorkind#variant.WouldBlock), but Windows may return [`TimedOut`](../io/enum.errorkind#variant.TimedOut).
##### Examples
```
use std::net::UdpSocket;
let socket = UdpSocket::bind("127.0.0.1:34254").expect("couldn't bind to address");
socket.set_read_timeout(None).expect("set_read_timeout call failed");
```
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;
let socket = UdpSocket::bind("127.0.0.1:34254").unwrap();
let result = socket.set_read_timeout(Some(Duration::new(0, 0)));
let err = result.unwrap_err();
assert_eq!(err.kind(), io::ErrorKind::InvalidInput)
```
[source](https://doc.rust-lang.org/src/std/net/udp.rs.html#330-332)1.4.0 · #### pub fn set\_write\_timeout(&self, dur: Option<Duration>) -> Result<()>
Sets the write timeout to the timeout specified.
If the value specified is [`None`](../option/enum.option#variant.None "None"), then [`write`](../io/trait.write#tymethod.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.
##### Platform-specific behavior
Platforms may return a different error code whenever a write times out as a result of setting this option. For example Unix typically returns an error of the kind [`WouldBlock`](../io/enum.errorkind#variant.WouldBlock), but Windows may return [`TimedOut`](../io/enum.errorkind#variant.TimedOut).
##### Examples
```
use std::net::UdpSocket;
let socket = UdpSocket::bind("127.0.0.1:34254").expect("couldn't bind to address");
socket.set_write_timeout(None).expect("set_write_timeout call failed");
```
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;
let socket = UdpSocket::bind("127.0.0.1:34254").unwrap();
let result = socket.set_write_timeout(Some(Duration::new(0, 0)));
let err = result.unwrap_err();
assert_eq!(err.kind(), io::ErrorKind::InvalidInput)
```
[source](https://doc.rust-lang.org/src/std/net/udp.rs.html#350-352)1.4.0 · #### pub fn read\_timeout(&self) -> Result<Option<Duration>>
Returns the read timeout of this socket.
If the timeout is [`None`](../option/enum.option#variant.None "None"), then [`read`](../io/trait.read#tymethod.read) calls will block indefinitely.
##### Examples
```
use std::net::UdpSocket;
let socket = UdpSocket::bind("127.0.0.1:34254").expect("couldn't bind to address");
socket.set_read_timeout(None).expect("set_read_timeout call failed");
assert_eq!(socket.read_timeout().unwrap(), None);
```
[source](https://doc.rust-lang.org/src/std/net/udp.rs.html#370-372)1.4.0 · #### pub fn write\_timeout(&self) -> Result<Option<Duration>>
Returns the write timeout of this socket.
If the timeout is [`None`](../option/enum.option#variant.None "None"), then [`write`](../io/trait.write#tymethod.write) calls will block indefinitely.
##### Examples
```
use std::net::UdpSocket;
let socket = UdpSocket::bind("127.0.0.1:34254").expect("couldn't bind to address");
socket.set_write_timeout(None).expect("set_write_timeout call failed");
assert_eq!(socket.write_timeout().unwrap(), None);
```
[source](https://doc.rust-lang.org/src/std/net/udp.rs.html#388-390)1.9.0 · #### pub fn set\_broadcast(&self, broadcast: bool) -> Result<()>
Sets the value of the `SO_BROADCAST` option for this socket.
When enabled, this socket is allowed to send packets to a broadcast address.
##### Examples
```
use std::net::UdpSocket;
let socket = UdpSocket::bind("127.0.0.1:34254").expect("couldn't bind to address");
socket.set_broadcast(false).expect("set_broadcast call failed");
```
[source](https://doc.rust-lang.org/src/std/net/udp.rs.html#406-408)1.9.0 · #### pub fn broadcast(&self) -> Result<bool>
Gets the value of the `SO_BROADCAST` option for this socket.
For more information about this option, see [`UdpSocket::set_broadcast`](struct.udpsocket#method.set_broadcast "UdpSocket::set_broadcast").
##### Examples
```
use std::net::UdpSocket;
let socket = UdpSocket::bind("127.0.0.1:34254").expect("couldn't bind to address");
socket.set_broadcast(false).expect("set_broadcast call failed");
assert_eq!(socket.broadcast().unwrap(), false);
```
[source](https://doc.rust-lang.org/src/std/net/udp.rs.html#424-426)1.9.0 · #### pub fn set\_multicast\_loop\_v4(&self, multicast\_loop\_v4: bool) -> Result<()>
Sets the value of the `IP_MULTICAST_LOOP` option for this socket.
If enabled, multicast packets will be looped back to the local socket. Note that this might not have any effect on IPv6 sockets.
##### Examples
```
use std::net::UdpSocket;
let socket = UdpSocket::bind("127.0.0.1:34254").expect("couldn't bind to address");
socket.set_multicast_loop_v4(false).expect("set_multicast_loop_v4 call failed");
```
[source](https://doc.rust-lang.org/src/std/net/udp.rs.html#442-444)1.9.0 · #### pub fn multicast\_loop\_v4(&self) -> Result<bool>
Gets the value of the `IP_MULTICAST_LOOP` option for this socket.
For more information about this option, see [`UdpSocket::set_multicast_loop_v4`](struct.udpsocket#method.set_multicast_loop_v4 "UdpSocket::set_multicast_loop_v4").
##### Examples
```
use std::net::UdpSocket;
let socket = UdpSocket::bind("127.0.0.1:34254").expect("couldn't bind to address");
socket.set_multicast_loop_v4(false).expect("set_multicast_loop_v4 call failed");
assert_eq!(socket.multicast_loop_v4().unwrap(), false);
```
[source](https://doc.rust-lang.org/src/std/net/udp.rs.html#463-465)1.9.0 · #### pub fn set\_multicast\_ttl\_v4(&self, multicast\_ttl\_v4: u32) -> Result<()>
Sets the value of the `IP_MULTICAST_TTL` option for this socket.
Indicates the time-to-live value of outgoing multicast packets for this socket. The default value is 1 which means that multicast packets don’t leave the local network unless explicitly requested.
Note that this might not have any effect on IPv6 sockets.
##### Examples
```
use std::net::UdpSocket;
let socket = UdpSocket::bind("127.0.0.1:34254").expect("couldn't bind to address");
socket.set_multicast_ttl_v4(42).expect("set_multicast_ttl_v4 call failed");
```
[source](https://doc.rust-lang.org/src/std/net/udp.rs.html#481-483)1.9.0 · #### pub fn multicast\_ttl\_v4(&self) -> Result<u32>
Gets the value of the `IP_MULTICAST_TTL` option for this socket.
For more information about this option, see [`UdpSocket::set_multicast_ttl_v4`](struct.udpsocket#method.set_multicast_ttl_v4 "UdpSocket::set_multicast_ttl_v4").
##### Examples
```
use std::net::UdpSocket;
let socket = UdpSocket::bind("127.0.0.1:34254").expect("couldn't bind to address");
socket.set_multicast_ttl_v4(42).expect("set_multicast_ttl_v4 call failed");
assert_eq!(socket.multicast_ttl_v4().unwrap(), 42);
```
[source](https://doc.rust-lang.org/src/std/net/udp.rs.html#499-501)1.9.0 · #### pub fn set\_multicast\_loop\_v6(&self, multicast\_loop\_v6: bool) -> Result<()>
Sets the value of the `IPV6_MULTICAST_LOOP` option for this socket.
Controls whether this socket sees the multicast packets it sends itself. Note that this might not have any affect on IPv4 sockets.
##### Examples
```
use std::net::UdpSocket;
let socket = UdpSocket::bind("127.0.0.1:34254").expect("couldn't bind to address");
socket.set_multicast_loop_v6(false).expect("set_multicast_loop_v6 call failed");
```
[source](https://doc.rust-lang.org/src/std/net/udp.rs.html#517-519)1.9.0 · #### pub fn multicast\_loop\_v6(&self) -> Result<bool>
Gets the value of the `IPV6_MULTICAST_LOOP` option for this socket.
For more information about this option, see [`UdpSocket::set_multicast_loop_v6`](struct.udpsocket#method.set_multicast_loop_v6 "UdpSocket::set_multicast_loop_v6").
##### Examples
```
use std::net::UdpSocket;
let socket = UdpSocket::bind("127.0.0.1:34254").expect("couldn't bind to address");
socket.set_multicast_loop_v6(false).expect("set_multicast_loop_v6 call failed");
assert_eq!(socket.multicast_loop_v6().unwrap(), false);
```
[source](https://doc.rust-lang.org/src/std/net/udp.rs.html#535-537)1.9.0 · #### pub fn set\_ttl(&self, ttl: u32) -> Result<()>
Sets the value for the `IP_TTL` option on this socket.
This value sets the time-to-live field that is used in every packet sent from this socket.
##### Examples
```
use std::net::UdpSocket;
let socket = UdpSocket::bind("127.0.0.1:34254").expect("couldn't bind to address");
socket.set_ttl(42).expect("set_ttl call failed");
```
[source](https://doc.rust-lang.org/src/std/net/udp.rs.html#553-555)1.9.0 · #### pub fn ttl(&self) -> Result<u32>
Gets the value of the `IP_TTL` option for this socket.
For more information about this option, see [`UdpSocket::set_ttl`](struct.udpsocket#method.set_ttl "UdpSocket::set_ttl").
##### Examples
```
use std::net::UdpSocket;
let socket = UdpSocket::bind("127.0.0.1:34254").expect("couldn't bind to address");
socket.set_ttl(42).expect("set_ttl call failed");
assert_eq!(socket.ttl().unwrap(), 42);
```
[source](https://doc.rust-lang.org/src/std/net/udp.rs.html#565-567)1.9.0 · #### pub fn join\_multicast\_v4( &self, multiaddr: &Ipv4Addr, interface: &Ipv4Addr) -> Result<()>
Executes an operation of the `IP_ADD_MEMBERSHIP` type.
This function specifies a new multicast group for this socket to join. The address must be a valid multicast address, and `interface` is the address of the local interface with which the system should join the multicast group. If it’s equal to `INADDR_ANY` then an appropriate interface is chosen by the system.
[source](https://doc.rust-lang.org/src/std/net/udp.rs.html#575-577)1.9.0 · #### pub fn join\_multicast\_v6( &self, multiaddr: &Ipv6Addr, interface: u32) -> Result<()>
Executes an operation of the `IPV6_ADD_MEMBERSHIP` type.
This function specifies a new multicast group for this socket to join. The address must be a valid multicast address, and `interface` is the index of the interface to join/leave (or 0 to indicate any interface).
[source](https://doc.rust-lang.org/src/std/net/udp.rs.html#583-585)1.9.0 · #### pub fn leave\_multicast\_v4( &self, multiaddr: &Ipv4Addr, interface: &Ipv4Addr) -> Result<()>
Executes an operation of the `IP_DROP_MEMBERSHIP` type.
For more information about this option, see [`UdpSocket::join_multicast_v4`](struct.udpsocket#method.join_multicast_v4 "UdpSocket::join_multicast_v4").
[source](https://doc.rust-lang.org/src/std/net/udp.rs.html#591-593)1.9.0 · #### pub fn leave\_multicast\_v6( &self, multiaddr: &Ipv6Addr, interface: u32) -> Result<()>
Executes an operation of the `IPV6_DROP_MEMBERSHIP` type.
For more information about this option, see [`UdpSocket::join_multicast_v6`](struct.udpsocket#method.join_multicast_v6 "UdpSocket::join_multicast_v6").
[source](https://doc.rust-lang.org/src/std/net/udp.rs.html#614-616)1.9.0 · #### pub fn take\_error(&self) -> Result<Option<Error>>
Gets the value of the `SO_ERROR` option on this socket.
This will retrieve the stored error in the underlying socket, clearing the field in the process. This can be useful for checking errors between calls.
##### Examples
```
use std::net::UdpSocket;
let socket = UdpSocket::bind("127.0.0.1:34254").expect("couldn't bind to address");
match socket.take_error() {
Ok(Some(error)) => println!("UdpSocket error: {error:?}"),
Ok(None) => println!("No error"),
Err(error) => println!("UdpSocket.take_error failed: {error:?}"),
}
```
[source](https://doc.rust-lang.org/src/std/net/udp.rs.html#647-649)1.9.0 · #### pub fn connect<A: ToSocketAddrs>(&self, addr: A) -> Result<()>
Connects this UDP socket to a remote address, allowing the `send` and `recv` syscalls to be used to send data and also applies filters to only receive data from the specified address.
If `addr` yields multiple addresses, `connect` will be attempted with each of the addresses until the underlying OS function returns no error. Note that usually, a successful `connect` call does not specify that there is a remote server listening on the port, rather, such an error would only be detected after the first send. If the OS returns an error for each of the specified addresses, the error returned from the last connection attempt (the last address) is returned.
##### Examples
Creates a UDP socket bound to `127.0.0.1:3400` and connect the socket to `127.0.0.1:8080`:
```
use std::net::UdpSocket;
let socket = UdpSocket::bind("127.0.0.1:3400").expect("couldn't bind to address");
socket.connect("127.0.0.1:8080").expect("connect function failed");
```
Unlike in the TCP case, passing an array of addresses to the `connect` function of a UDP socket is not a useful thing to do: The OS will be unable to determine whether something is listening on the remote address without the application sending data.
[source](https://doc.rust-lang.org/src/std/net/udp.rs.html#666-668)1.9.0 · #### pub fn send(&self, buf: &[u8]) -> Result<usize>
Sends data on the socket to the remote address to which it is connected.
[`UdpSocket::connect`](struct.udpsocket#method.connect "UdpSocket::connect") will connect this socket to a remote address. This method will fail if the socket is not connected.
##### Examples
```
use std::net::UdpSocket;
let socket = UdpSocket::bind("127.0.0.1:34254").expect("couldn't bind to address");
socket.connect("127.0.0.1:8080").expect("connect function failed");
socket.send(&[0, 1, 2]).expect("couldn't send message");
```
[source](https://doc.rust-lang.org/src/std/net/udp.rs.html#694-696)1.9.0 · #### pub fn recv(&self, buf: &mut [u8]) -> Result<usize>
Receives a single datagram message on the socket from the remote address to which it is connected. On success, returns the number of bytes read.
The function must be called with valid byte array `buf` of sufficient size to hold the message bytes. If a message is too long to fit in the supplied buffer, excess bytes may be discarded.
[`UdpSocket::connect`](struct.udpsocket#method.connect "UdpSocket::connect") will connect this socket to a remote address. This method will fail if the socket is not connected.
##### Examples
```
use std::net::UdpSocket;
let socket = UdpSocket::bind("127.0.0.1:34254").expect("couldn't bind to address");
socket.connect("127.0.0.1:8080").expect("connect function failed");
let mut buf = [0; 10];
match socket.recv(&mut buf) {
Ok(received) => println!("received {received} bytes {:?}", &buf[..received]),
Err(e) => println!("recv function failed: {e:?}"),
}
```
[source](https://doc.rust-lang.org/src/std/net/udp.rs.html#734-736)1.18.0 · #### pub fn peek(&self, buf: &mut [u8]) -> Result<usize>
Receives single datagram on the socket from the remote address to which it is connected, without removing the message from input queue. On success, returns the number of bytes peeked.
The function must be called with valid byte array `buf` of sufficient size to hold the message bytes. If a message is too long to fit in the supplied buffer, excess bytes may be discarded.
Successive calls return the same data. This is accomplished by passing `MSG_PEEK` as a flag to the underlying `recv` system call.
Do not use this function to implement busy waiting, instead use `libc::poll` to synchronize IO events on one or more sockets.
[`UdpSocket::connect`](struct.udpsocket#method.connect "UdpSocket::connect") will connect this socket to a remote address. This method will fail if the socket is not connected.
##### Errors
This method will fail if the socket is not connected. The `connect` method will connect this socket to a remote address.
##### Examples
```
use std::net::UdpSocket;
let socket = UdpSocket::bind("127.0.0.1:34254").expect("couldn't bind to address");
socket.connect("127.0.0.1:8080").expect("connect function failed");
let mut buf = [0; 10];
match socket.peek(&mut buf) {
Ok(received) => println!("received {received} bytes"),
Err(e) => println!("peek function failed: {e:?}"),
}
```
[source](https://doc.rust-lang.org/src/std/net/udp.rs.html#779-781)1.9.0 · #### pub fn set\_nonblocking(&self, nonblocking: bool) -> Result<()>
Moves this UDP socket into or out of nonblocking mode.
This will result in `recv`, `recv_from`, `send`, and `send_to` operations becoming nonblocking, i.e., immediately returning from their calls. If the IO operation is successful, `Ok` is returned and no further action is required. If the IO operation could not be completed and needs to be retried, an error with kind [`io::ErrorKind::WouldBlock`](../io/enum.errorkind#variant.WouldBlock "io::ErrorKind::WouldBlock") is returned.
On Unix platforms, calling this method corresponds to calling `fcntl` `FIONBIO`. On Windows calling this method corresponds to calling `ioctlsocket` `FIONBIO`.
##### Examples
Creates a UDP socket bound to `127.0.0.1:7878` and read bytes in nonblocking mode:
```
use std::io;
use std::net::UdpSocket;
let socket = UdpSocket::bind("127.0.0.1:7878").unwrap();
socket.set_nonblocking(true).unwrap();
let mut buf = [0; 10];
let (num_bytes_read, _) = loop {
match socket.recv_from(&mut buf) {
Ok(n) => break n,
Err(ref e) if e.kind() == io::ErrorKind::WouldBlock => {
// wait until network socket is ready, typically implemented
// via platform-specific APIs such as epoll or IOCP
wait_for_fd();
}
Err(e) => panic!("encountered IO error: {e}"),
}
};
println!("bytes: {:?}", &buf[..num_bytes_read]);
```
Trait Implementations
---------------------
[source](https://doc.rust-lang.org/src/std/os/fd/owned.rs.html#335-340)1.63.0 · ### impl AsFd for UdpSocket
[source](https://doc.rust-lang.org/src/std/os/fd/owned.rs.html#337-339)#### 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/std/os/fd/net.rs.html#17)### impl AsRawFd for UdpSocket
[source](https://doc.rust-lang.org/src/std/os/fd/net.rs.html#17)#### 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/std/os/windows/io/raw.rs.html#251-256)### impl AsRawSocket for UdpSocket
Available on **Windows** only.
[source](https://doc.rust-lang.org/src/std/os/windows/io/raw.rs.html#253-255)#### fn as\_raw\_socket(&self) -> RawSocket
Extracts the raw socket. [Read more](../os/windows/io/trait.asrawsocket#tymethod.as_raw_socket)
[source](https://doc.rust-lang.org/src/std/os/windows/io/socket.rs.html#317-322)1.63.0 · ### impl AsSocket for UdpSocket
Available on **Windows** only.
[source](https://doc.rust-lang.org/src/std/os/windows/io/socket.rs.html#319-321)#### fn as\_socket(&self) -> BorrowedSocket<'\_>
Borrows the socket.
[source](https://doc.rust-lang.org/src/std/net/udp.rs.html#809-813)### impl Debug for UdpSocket
[source](https://doc.rust-lang.org/src/std/net/udp.rs.html#810-812)#### 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/fd/owned.rs.html#351-358)1.63.0 · ### impl From<OwnedFd> for UdpSocket
[source](https://doc.rust-lang.org/src/std/os/fd/owned.rs.html#353-357)#### fn from(owned\_fd: OwnedFd) -> Self
Converts to this type from the input type.
[source](https://doc.rust-lang.org/src/std/os/windows/io/socket.rs.html#333-338)1.63.0 · ### impl From<OwnedSocket> for UdpSocket
Available on **Windows** only.
[source](https://doc.rust-lang.org/src/std/os/windows/io/socket.rs.html#335-337)#### fn from(owned: OwnedSocket) -> Self
Converts to this type from the input type.
[source](https://doc.rust-lang.org/src/std/os/fd/owned.rs.html#343-348)1.63.0 · ### impl From<UdpSocket> for OwnedFd
[source](https://doc.rust-lang.org/src/std/os/fd/owned.rs.html#345-347)#### fn from(udp\_socket: UdpSocket) -> OwnedFd
Converts to this type from the input type.
[source](https://doc.rust-lang.org/src/std/os/windows/io/socket.rs.html#325-330)1.63.0 · ### impl From<UdpSocket> for OwnedSocket
Available on **Windows** only.
[source](https://doc.rust-lang.org/src/std/os/windows/io/socket.rs.html#327-329)#### fn from(udp\_socket: UdpSocket) -> OwnedSocket
Converts to this type from the input type.
[source](https://doc.rust-lang.org/src/std/os/fd/net.rs.html#33)1.1.0 · ### impl FromRawFd for UdpSocket
[source](https://doc.rust-lang.org/src/std/os/fd/net.rs.html#33)#### unsafe fn from\_raw\_fd(fd: RawFd) -> UdpSocket
Available on **Unix** only.Constructs a new instance of `Self` from the given raw file descriptor. [Read more](../os/unix/io/trait.fromrawfd#tymethod.from_raw_fd)
[source](https://doc.rust-lang.org/src/std/os/windows/io/raw.rs.html#275-281)1.1.0 · ### impl FromRawSocket for UdpSocket
Available on **Windows** only.
[source](https://doc.rust-lang.org/src/std/os/windows/io/raw.rs.html#277-280)#### unsafe fn from\_raw\_socket(sock: RawSocket) -> UdpSocket
Constructs a new I/O object from the specified raw socket. [Read more](../os/windows/io/trait.fromrawsocket#tymethod.from_raw_socket)
[source](https://doc.rust-lang.org/src/std/os/fd/net.rs.html#46)1.4.0 · ### impl IntoRawFd for UdpSocket
[source](https://doc.rust-lang.org/src/std/os/fd/net.rs.html#46)#### fn into\_raw\_fd(self) -> RawFd
Available on **Unix** only.Consumes this object, returning the raw underlying file descriptor. [Read more](../os/unix/io/trait.intorawfd#tymethod.into_raw_fd)
[source](https://doc.rust-lang.org/src/std/os/windows/io/raw.rs.html#300-305)1.4.0 · ### impl IntoRawSocket for UdpSocket
Available on **Windows** only.
[source](https://doc.rust-lang.org/src/std/os/windows/io/raw.rs.html#302-304)#### fn into\_raw\_socket(self) -> RawSocket
Consumes this object, returning the raw underlying socket. [Read more](../os/windows/io/trait.intorawsocket#tymethod.into_raw_socket)
Auto Trait Implementations
--------------------------
### impl RefUnwindSafe for UdpSocket
### impl Send for UdpSocket
### impl Sync for UdpSocket
### impl Unpin for UdpSocket
### impl UnwindSafe for UdpSocket
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::net::TcpListener Struct std::net::TcpListener
============================
```
pub struct TcpListener(_);
```
A TCP socket server, listening for connections.
After creating a `TcpListener` by [`bind`](struct.tcplistener#method.bind)ing it to a socket address, it listens for incoming TCP connections. These can be accepted by calling [`accept`](struct.tcplistener#method.accept) or by iterating over the [`Incoming`](struct.incoming "Incoming") iterator returned by [`incoming`](struct.tcplistener#method.incoming "TcpListener::incoming").
The socket will be closed when the value is dropped.
The Transmission Control Protocol is specified in [IETF RFC 793](https://tools.ietf.org/html/rfc793).
Examples
--------
```
use std::net::{TcpListener, TcpStream};
fn handle_client(stream: TcpStream) {
// ...
}
fn main() -> std::io::Result<()> {
let listener = TcpListener::bind("127.0.0.1:80")?;
// accept connections and process them serially
for stream in listener.incoming() {
handle_client(stream?);
}
Ok(())
}
```
Implementations
---------------
[source](https://doc.rust-lang.org/src/std/net/tcp.rs.html#710-997)### impl TcpListener
[source](https://doc.rust-lang.org/src/std/net/tcp.rs.html#751-753)#### pub fn bind<A: ToSocketAddrs>(addr: A) -> Result<TcpListener>
Creates a new `TcpListener` which will be bound to the specified address.
The returned listener is ready for accepting connections.
Binding with a port number of 0 will request that the OS assigns a port to this listener. The port allocated can be queried via the [`TcpListener::local_addr`](struct.tcplistener#method.local_addr "TcpListener::local_addr") method.
The address type can be any implementor of [`ToSocketAddrs`](trait.tosocketaddrs "ToSocketAddrs") trait. See its documentation for concrete examples.
If `addr` yields multiple addresses, `bind` will be attempted with each of the addresses until one succeeds and returns the listener. If none of the addresses succeed in creating a listener, the error returned from the last attempt (the last address) is returned.
##### Examples
Creates a TCP listener bound to `127.0.0.1:80`:
```
use std::net::TcpListener;
let listener = TcpListener::bind("127.0.0.1:80").unwrap();
```
Creates a TCP listener bound to `127.0.0.1:80`. If that fails, create a TCP listener bound to `127.0.0.1:443`:
```
use std::net::{SocketAddr, TcpListener};
let addrs = [
SocketAddr::from(([127, 0, 0, 1], 80)),
SocketAddr::from(([127, 0, 0, 1], 443)),
];
let listener = TcpListener::bind(&addrs[..]).unwrap();
```
[source](https://doc.rust-lang.org/src/std/net/tcp.rs.html#767-769)#### pub fn local\_addr(&self) -> Result<SocketAddr>
Returns the local socket address of this listener.
##### Examples
```
use std::net::{Ipv4Addr, SocketAddr, SocketAddrV4, TcpListener};
let listener = TcpListener::bind("127.0.0.1:8080").unwrap();
assert_eq!(listener.local_addr().unwrap(),
SocketAddr::V4(SocketAddrV4::new(Ipv4Addr::new(127, 0, 0, 1), 8080)));
```
[source](https://doc.rust-lang.org/src/std/net/tcp.rs.html#786-788)#### pub fn try\_clone(&self) -> Result<TcpListener>
Creates a new independently owned handle to the underlying socket.
The returned [`TcpListener`](struct.tcplistener "TcpListener") is a reference to the same socket that this object references. Both handles can be used to accept incoming connections and options set on one listener will affect the other.
##### Examples
```
use std::net::TcpListener;
let listener = TcpListener::bind("127.0.0.1:8080").unwrap();
let listener_clone = listener.try_clone().unwrap();
```
[source](https://doc.rust-lang.org/src/std/net/tcp.rs.html#808-813)#### pub fn accept(&self) -> Result<(TcpStream, SocketAddr)>
Accept a new incoming connection from this listener.
This function will block the calling thread until a new TCP connection is established. When established, the corresponding [`TcpStream`](struct.tcpstream "TcpStream") and the remote peer’s address will be returned.
##### Examples
```
use std::net::TcpListener;
let listener = TcpListener::bind("127.0.0.1:8080").unwrap();
match listener.accept() {
Ok((_socket, addr)) => println!("new client: {addr:?}"),
Err(e) => println!("couldn't get client: {e:?}"),
}
```
[source](https://doc.rust-lang.org/src/std/net/tcp.rs.html#846-848)#### pub fn incoming(&self) -> Incoming<'\_>
Notable traits for [Incoming](struct.incoming "struct std::net::Incoming")<'a>
```
impl<'a> Iterator for Incoming<'a>
type Item = Result<TcpStream>;
```
Returns an iterator over the connections being received on this listener.
The returned iterator will never return [`None`](../option/enum.option#variant.None "None") and will also not yield the peer’s [`SocketAddr`](enum.socketaddr "SocketAddr") structure. Iterating over it is equivalent to calling [`TcpListener::accept`](struct.tcplistener#method.accept "TcpListener::accept") in a loop.
##### Examples
```
use std::net::{TcpListener, TcpStream};
fn handle_connection(stream: TcpStream) {
//...
}
fn main() -> std::io::Result<()> {
let listener = TcpListener::bind("127.0.0.1:80").unwrap();
for stream in listener.incoming() {
match stream {
Ok(stream) => {
handle_connection(stream);
}
Err(e) => { /* connection failed */ }
}
}
Ok(())
}
```
[source](https://doc.rust-lang.org/src/std/net/tcp.rs.html#878-880)#### pub fn into\_incoming(self) -> IntoIncoming
Notable traits for [IntoIncoming](struct.intoincoming "struct std::net::IntoIncoming")
```
impl Iterator for IntoIncoming
type Item = Result<TcpStream>;
```
🔬This is a nightly-only experimental API. (`tcplistener_into_incoming` [#88339](https://github.com/rust-lang/rust/issues/88339))
Turn this into an iterator over the connections being received on this listener.
The returned iterator will never return [`None`](../option/enum.option#variant.None "None") and will also not yield the peer’s [`SocketAddr`](enum.socketaddr "SocketAddr") structure. Iterating over it is equivalent to calling [`TcpListener::accept`](struct.tcplistener#method.accept "TcpListener::accept") in a loop.
##### Examples
```
#![feature(tcplistener_into_incoming)]
use std::net::{TcpListener, TcpStream};
fn listen_on(port: u16) -> impl Iterator<Item = TcpStream> {
let listener = TcpListener::bind("127.0.0.1:80").unwrap();
listener.into_incoming()
.filter_map(Result::ok) /* Ignore failed connections */
}
fn main() -> std::io::Result<()> {
for stream in listen_on(80) {
/* handle the connection here */
}
Ok(())
}
```
[source](https://doc.rust-lang.org/src/std/net/tcp.rs.html#896-898)1.9.0 · #### pub fn set\_ttl(&self, ttl: u32) -> Result<()>
Sets the value for the `IP_TTL` option on this socket.
This value sets the time-to-live field that is used in every packet sent from this socket.
##### Examples
```
use std::net::TcpListener;
let listener = TcpListener::bind("127.0.0.1:80").unwrap();
listener.set_ttl(100).expect("could not set TTL");
```
[source](https://doc.rust-lang.org/src/std/net/tcp.rs.html#914-916)1.9.0 · #### pub fn ttl(&self) -> Result<u32>
Gets the value of the `IP_TTL` option for this socket.
For more information about this option, see [`TcpListener::set_ttl`](struct.tcplistener#method.set_ttl "TcpListener::set_ttl").
##### Examples
```
use std::net::TcpListener;
let listener = TcpListener::bind("127.0.0.1:80").unwrap();
listener.set_ttl(100).expect("could not set TTL");
assert_eq!(listener.ttl().unwrap_or(0), 100);
```
[source](https://doc.rust-lang.org/src/std/net/tcp.rs.html#921-923)1.9.0 · #### pub fn set\_only\_v6(&self, only\_v6: bool) -> Result<()>
👎Deprecated since 1.16.0: this option can only be set before the socket is bound
[source](https://doc.rust-lang.org/src/std/net/tcp.rs.html#928-930)1.9.0 · #### pub fn only\_v6(&self) -> Result<bool>
👎Deprecated since 1.16.0: this option can only be set before the socket is bound
[source](https://doc.rust-lang.org/src/std/net/tcp.rs.html#947-949)1.9.0 · #### pub fn take\_error(&self) -> Result<Option<Error>>
Gets the value of the `SO_ERROR` option on this socket.
This will retrieve the stored error in the underlying socket, clearing the field in the process. This can be useful for checking errors between calls.
##### Examples
```
use std::net::TcpListener;
let listener = TcpListener::bind("127.0.0.1:80").unwrap();
listener.take_error().expect("No error was expected");
```
[source](https://doc.rust-lang.org/src/std/net/tcp.rs.html#994-996)1.9.0 · #### pub fn set\_nonblocking(&self, nonblocking: bool) -> Result<()>
Moves this TCP stream into or out of nonblocking mode.
This will result in the `accept` operation becoming nonblocking, i.e., immediately returning from their calls. If the IO operation is successful, `Ok` is returned and no further action is required. If the IO operation could not be completed and needs to be retried, an error with kind [`io::ErrorKind::WouldBlock`](../io/enum.errorkind#variant.WouldBlock "io::ErrorKind::WouldBlock") is returned.
On Unix platforms, calling this method corresponds to calling `fcntl` `FIONBIO`. On Windows calling this method corresponds to calling `ioctlsocket` `FIONBIO`.
##### Examples
Bind a TCP listener to an address, listen for connections, and read bytes in nonblocking mode:
```
use std::io;
use std::net::TcpListener;
let listener = TcpListener::bind("127.0.0.1:7878").unwrap();
listener.set_nonblocking(true).expect("Cannot set non-blocking");
for stream in listener.incoming() {
match stream {
Ok(s) => {
// do something with the TcpStream
handle_connection(s);
}
Err(ref e) if e.kind() == io::ErrorKind::WouldBlock => {
// wait until network socket is ready, typically implemented
// via platform-specific APIs such as epoll or IOCP
wait_for_fd();
continue;
}
Err(e) => panic!("encountered IO error: {e}"),
}
}
```
Trait Implementations
---------------------
[source](https://doc.rust-lang.org/src/std/os/fd/owned.rs.html#309-314)1.63.0 · ### impl AsFd for TcpListener
[source](https://doc.rust-lang.org/src/std/os/fd/owned.rs.html#311-313)#### 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/std/os/fd/net.rs.html#17)### impl AsRawFd for TcpListener
[source](https://doc.rust-lang.org/src/std/os/fd/net.rs.html#17)#### 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/std/os/windows/io/raw.rs.html#244-249)### impl AsRawSocket for TcpListener
Available on **Windows** only.
[source](https://doc.rust-lang.org/src/std/os/windows/io/raw.rs.html#246-248)#### fn as\_raw\_socket(&self) -> RawSocket
Extracts the raw socket. [Read more](../os/windows/io/trait.asrawsocket#tymethod.as_raw_socket)
[source](https://doc.rust-lang.org/src/std/os/windows/io/socket.rs.html#293-298)1.63.0 · ### impl AsSocket for TcpListener
Available on **Windows** only.
[source](https://doc.rust-lang.org/src/std/os/windows/io/socket.rs.html#295-297)#### fn as\_socket(&self) -> BorrowedSocket<'\_>
Borrows the socket.
[source](https://doc.rust-lang.org/src/std/net/tcp.rs.html#1046-1050)### impl Debug for TcpListener
[source](https://doc.rust-lang.org/src/std/net/tcp.rs.html#1047-1049)#### 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/fd/owned.rs.html#325-332)1.63.0 · ### impl From<OwnedFd> for TcpListener
[source](https://doc.rust-lang.org/src/std/os/fd/owned.rs.html#327-331)#### fn from(owned\_fd: OwnedFd) -> Self
Converts to this type from the input type.
[source](https://doc.rust-lang.org/src/std/os/windows/io/socket.rs.html#309-314)1.63.0 · ### impl From<OwnedSocket> for TcpListener
Available on **Windows** only.
[source](https://doc.rust-lang.org/src/std/os/windows/io/socket.rs.html#311-313)#### fn from(owned: OwnedSocket) -> Self
Converts to this type from the input type.
[source](https://doc.rust-lang.org/src/std/os/fd/owned.rs.html#317-322)1.63.0 · ### impl From<TcpListener> for OwnedFd
[source](https://doc.rust-lang.org/src/std/os/fd/owned.rs.html#319-321)#### fn from(tcp\_listener: TcpListener) -> OwnedFd
Converts to this type from the input type.
[source](https://doc.rust-lang.org/src/std/os/windows/io/socket.rs.html#301-306)1.63.0 · ### impl From<TcpListener> for OwnedSocket
Available on **Windows** only.
[source](https://doc.rust-lang.org/src/std/os/windows/io/socket.rs.html#303-305)#### fn from(tcp\_listener: TcpListener) -> OwnedSocket
Converts to this type from the input type.
[source](https://doc.rust-lang.org/src/std/os/fd/net.rs.html#33)1.1.0 · ### impl FromRawFd for TcpListener
[source](https://doc.rust-lang.org/src/std/os/fd/net.rs.html#33)#### unsafe fn from\_raw\_fd(fd: RawFd) -> TcpListener
Available on **Unix** only.Constructs a new instance of `Self` from the given raw file descriptor. [Read more](../os/unix/io/trait.fromrawfd#tymethod.from_raw_fd)
[source](https://doc.rust-lang.org/src/std/os/windows/io/raw.rs.html#267-273)1.1.0 · ### impl FromRawSocket for TcpListener
Available on **Windows** only.
[source](https://doc.rust-lang.org/src/std/os/windows/io/raw.rs.html#269-272)#### unsafe fn from\_raw\_socket(sock: RawSocket) -> TcpListener
Constructs a new I/O object from the specified raw socket. [Read more](../os/windows/io/trait.fromrawsocket#tymethod.from_raw_socket)
[source](https://doc.rust-lang.org/src/std/os/fd/net.rs.html#46)1.4.0 · ### impl IntoRawFd for TcpListener
[source](https://doc.rust-lang.org/src/std/os/fd/net.rs.html#46)#### fn into\_raw\_fd(self) -> RawFd
Available on **Unix** only.Consumes this object, returning the raw underlying file descriptor. [Read more](../os/unix/io/trait.intorawfd#tymethod.into_raw_fd)
[source](https://doc.rust-lang.org/src/std/os/windows/io/raw.rs.html#292-297)1.4.0 · ### impl IntoRawSocket for TcpListener
Available on **Windows** only.
[source](https://doc.rust-lang.org/src/std/os/windows/io/raw.rs.html#294-296)#### fn into\_raw\_socket(self) -> RawSocket
Consumes this object, returning the raw underlying socket. [Read more](../os/windows/io/trait.intorawsocket#tymethod.into_raw_socket)
[source](https://doc.rust-lang.org/src/std/os/wasi/net/mod.rs.html#19-23)### impl TcpListenerExt for TcpListener
Available on **WASI** only.
[source](https://doc.rust-lang.org/src/std/os/wasi/net/mod.rs.html#20-22)#### fn sock\_accept(&self, flags: u16) -> Result<u32>
🔬This is a nightly-only experimental API. (`wasi_ext` [#71213](https://github.com/rust-lang/rust/issues/71213))
Accept a socket. [Read more](../os/wasi/net/trait.tcplistenerext#tymethod.sock_accept)
Auto Trait Implementations
--------------------------
### impl RefUnwindSafe for TcpListener
### impl Send for TcpListener
### impl Sync for TcpListener
### impl Unpin for TcpListener
### impl UnwindSafe for TcpListener
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::net::Ipv6MulticastScope Enum std::net::Ipv6MulticastScope
=================================
```
#[non_exhaustive]
pub enum Ipv6MulticastScope {
InterfaceLocal,
LinkLocal,
RealmLocal,
AdminLocal,
SiteLocal,
OrganizationLocal,
Global,
}
```
🔬This is a nightly-only experimental API. (`ip` [#27709](https://github.com/rust-lang/rust/issues/27709))
Scope of an [IPv6 multicast address](struct.ipv6addr) as defined in [IETF RFC 7346 section 2](https://tools.ietf.org/html/rfc7346#section-2).
Stability Guarantees
--------------------
Not all possible values for a multicast scope have been assigned. Future RFCs may introduce new scopes, which will be added as variants to this enum; because of this the enum is marked as `#[non_exhaustive]`.
Examples
--------
```
#![feature(ip)]
use std::net::Ipv6Addr;
use std::net::Ipv6MulticastScope::*;
// An IPv6 multicast address with global scope (`ff0e::`).
let address = Ipv6Addr::new(0xff0e, 0, 0, 0, 0, 0, 0, 0);
// Will print "Global scope".
match address.multicast_scope() {
Some(InterfaceLocal) => println!("Interface-Local scope"),
Some(LinkLocal) => println!("Link-Local scope"),
Some(RealmLocal) => println!("Realm-Local scope"),
Some(AdminLocal) => println!("Admin-Local scope"),
Some(SiteLocal) => println!("Site-Local scope"),
Some(OrganizationLocal) => println!("Organization-Local scope"),
Some(Global) => println!("Global scope"),
Some(_) => println!("Unknown scope"),
None => println!("Not a multicast address!")
}
```
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.### `InterfaceLocal`
🔬This is a nightly-only experimental API. (`ip` [#27709](https://github.com/rust-lang/rust/issues/27709))
Interface-Local scope.
### `LinkLocal`
🔬This is a nightly-only experimental API. (`ip` [#27709](https://github.com/rust-lang/rust/issues/27709))
Link-Local scope.
### `RealmLocal`
🔬This is a nightly-only experimental API. (`ip` [#27709](https://github.com/rust-lang/rust/issues/27709))
Realm-Local scope.
### `AdminLocal`
🔬This is a nightly-only experimental API. (`ip` [#27709](https://github.com/rust-lang/rust/issues/27709))
Admin-Local scope.
### `SiteLocal`
🔬This is a nightly-only experimental API. (`ip` [#27709](https://github.com/rust-lang/rust/issues/27709))
Site-Local scope.
### `OrganizationLocal`
🔬This is a nightly-only experimental API. (`ip` [#27709](https://github.com/rust-lang/rust/issues/27709))
Organization-Local scope.
### `Global`
🔬This is a nightly-only experimental API. (`ip` [#27709](https://github.com/rust-lang/rust/issues/27709))
Global scope.
Trait Implementations
---------------------
[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/ip_addr.rs.html#200)#### fn clone(&self) -> Ipv6MulticastScope
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/net/ip_addr.rs.html#200)### impl Debug for Ipv6MulticastScope
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#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/net/ip_addr.rs.html#200)### impl Hash for Ipv6MulticastScope
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#200)#### 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/net/ip_addr.rs.html#200)### impl PartialEq<Ipv6MulticastScope> for Ipv6MulticastScope
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#200)#### fn eq(&self, other: &Ipv6MulticastScope) -> 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/net/ip_addr.rs.html#200)### impl Copy for Ipv6MulticastScope
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#200)### impl Eq for Ipv6MulticastScope
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#200)### impl StructuralEq for Ipv6MulticastScope
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#200)### impl StructuralPartialEq for Ipv6MulticastScope
Auto Trait Implementations
--------------------------
### impl RefUnwindSafe for Ipv6MulticastScope
### impl Send for Ipv6MulticastScope
### impl Sync for Ipv6MulticastScope
### impl Unpin for Ipv6MulticastScope
### impl UnwindSafe for Ipv6MulticastScope
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 Enum std::net::Shutdown Enum std::net::Shutdown
=======================
```
pub enum Shutdown {
Read,
Write,
Both,
}
```
Possible values which can be passed to the [`TcpStream::shutdown`](struct.tcpstream#method.shutdown "TcpStream::shutdown") method.
Variants
--------
### `Read`
The reading portion of the [`TcpStream`](struct.tcpstream "TcpStream") should be shut down.
All currently blocked and future [reads](../io/trait.read "io::Read") will return `[Ok](../result/enum.result#variant.Ok "Ok")(0)`.
### `Write`
The writing portion of the [`TcpStream`](struct.tcpstream "TcpStream") should be shut down.
All currently blocked and future [writes](../io/trait.write "io::Write") will return an error.
### `Both`
Both the reading and the writing portions of the [`TcpStream`](struct.tcpstream "TcpStream") should be shut down.
See [`Shutdown::Read`](enum.shutdown#variant.Read "Shutdown::Read") and [`Shutdown::Write`](enum.shutdown#variant.Write "Shutdown::Write") for more information.
Trait Implementations
---------------------
[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/mod.rs.html#49)#### fn clone(&self) -> Shutdown
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/net/mod.rs.html#49)### impl Debug for Shutdown
[source](https://doc.rust-lang.org/src/std/net/mod.rs.html#49)#### 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/net/mod.rs.html#49)### impl PartialEq<Shutdown> for Shutdown
[source](https://doc.rust-lang.org/src/std/net/mod.rs.html#49)#### fn eq(&self, other: &Shutdown) -> 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/net/mod.rs.html#49)### impl Copy for Shutdown
[source](https://doc.rust-lang.org/src/std/net/mod.rs.html#49)### impl Eq for Shutdown
[source](https://doc.rust-lang.org/src/std/net/mod.rs.html#49)### impl StructuralEq for Shutdown
[source](https://doc.rust-lang.org/src/std/net/mod.rs.html#49)### impl StructuralPartialEq for Shutdown
Auto Trait Implementations
--------------------------
### impl RefUnwindSafe for Shutdown
### impl Send for Shutdown
### impl Sync for Shutdown
### impl Unpin for Shutdown
### impl UnwindSafe for Shutdown
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::net::Ipv6Addr Struct std::net::Ipv6Addr
=========================
```
pub struct Ipv6Addr { /* private fields */ }
```
An IPv6 address.
IPv6 addresses are defined as 128-bit integers in [IETF RFC 4291](https://tools.ietf.org/html/rfc4291). They are usually represented as eight 16-bit segments.
Embedding IPv4 Addresses
------------------------
See [`IpAddr`](enum.ipaddr "IpAddr") for a type encompassing both IPv4 and IPv6 addresses.
To assist in the transition from IPv4 to IPv6 two types of IPv6 addresses that embed an IPv4 address were defined: IPv4-compatible and IPv4-mapped addresses. Of these IPv4-compatible addresses have been officially deprecated.
Both types of addresses are not assigned any special meaning by this implementation, other than what the relevant standards prescribe. This means that an address like `::ffff:127.0.0.1`, while representing an IPv4 loopback address, is not itself an IPv6 loopback address; only `::1` is. To handle these so called “IPv4-in-IPv6” addresses, they have to first be converted to their canonical IPv4 address.
#### IPv4-Compatible IPv6 Addresses
IPv4-compatible IPv6 addresses are defined in [IETF RFC 4291 Section 2.5.5.1](https://datatracker.ietf.org/doc/html/rfc4291#section-2.5.5.1), and have been officially deprecated. The RFC describes the format of an “IPv4-Compatible IPv6 address” as follows:
```
| 80 bits | 16 | 32 bits |
+--------------------------------------+--------------------------+
|0000..............................0000|0000| IPv4 address |
+--------------------------------------+----+---------------------+
```
So `::a.b.c.d` would be an IPv4-compatible IPv6 address representing the IPv4 address `a.b.c.d`.
To convert from an IPv4 address to an IPv4-compatible IPv6 address, use [`Ipv4Addr::to_ipv6_compatible`](struct.ipv4addr#method.to_ipv6_compatible "Ipv4Addr::to_ipv6_compatible"). Use [`Ipv6Addr::to_ipv4`](struct.ipv6addr#method.to_ipv4 "Ipv6Addr::to_ipv4") to convert an IPv4-compatible IPv6 address to the canonical IPv4 address.
#### IPv4-Mapped IPv6 Addresses
IPv4-mapped IPv6 addresses are defined in [IETF RFC 4291 Section 2.5.5.2](https://datatracker.ietf.org/doc/html/rfc4291#section-2.5.5.2). The RFC describes the format of an “IPv4-Mapped IPv6 address” as follows:
```
| 80 bits | 16 | 32 bits |
+--------------------------------------+--------------------------+
|0000..............................0000|FFFF| IPv4 address |
+--------------------------------------+----+---------------------+
```
So `::ffff:a.b.c.d` would be an IPv4-mapped IPv6 address representing the IPv4 address `a.b.c.d`.
To convert from an IPv4 address to an IPv4-mapped IPv6 address, use [`Ipv4Addr::to_ipv6_mapped`](struct.ipv4addr#method.to_ipv6_mapped "Ipv4Addr::to_ipv6_mapped"). Use [`Ipv6Addr::to_ipv4`](struct.ipv6addr#method.to_ipv4 "Ipv6Addr::to_ipv4") to convert an IPv4-mapped IPv6 address to the canonical IPv4 address. Note that this will also convert the IPv6 loopback address `::1` to `0.0.0.1`. Use [`Ipv6Addr::to_ipv4_mapped`](struct.ipv6addr#method.to_ipv4_mapped "Ipv6Addr::to_ipv4_mapped") to avoid this.
Textual representation
----------------------
`Ipv6Addr` provides a [`FromStr`](../str/trait.fromstr) implementation. There are many ways to represent an IPv6 address in text, but in general, each segments is written in hexadecimal notation, and segments are separated by `:`. For more information, see [IETF RFC 5952](https://tools.ietf.org/html/rfc5952).
Examples
--------
```
use std::net::Ipv6Addr;
let localhost = Ipv6Addr::new(0, 0, 0, 0, 0, 0, 0, 1);
assert_eq!("::1".parse(), Ok(localhost));
assert_eq!(localhost.is_loopback(), true);
```
Implementations
---------------
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#1164-1768)### impl Ipv6Addr
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#1180-1196)const: 1.32.0 · #### pub const fn new( a: u16, b: u16, c: u16, d: u16, e: u16, f: u16, g: u16, h: u16) -> Ipv6Addr
Creates a new IPv6 address from eight 16-bit segments.
The result will represent the IP address `a:b:c:d:e:f:g:h`.
##### Examples
```
use std::net::Ipv6Addr;
let addr = Ipv6Addr::new(0, 0, 0, 0, 0, 0xffff, 0xc00a, 0x2ff);
```
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#1209)1.30.0 · #### pub const LOCALHOST: Self = \_
An IPv6 address representing localhost: `::1`.
##### Examples
```
use std::net::Ipv6Addr;
let addr = Ipv6Addr::LOCALHOST;
assert_eq!(addr, Ipv6Addr::new(0, 0, 0, 0, 0, 0, 0, 1));
```
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#1222)1.30.0 · #### pub const UNSPECIFIED: Self = \_
An IPv6 address representing the unspecified address: `::`
##### Examples
```
use std::net::Ipv6Addr;
let addr = Ipv6Addr::UNSPECIFIED;
assert_eq!(addr, Ipv6Addr::new(0, 0, 0, 0, 0, 0, 0, 0));
```
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#1238-1253)const: 1.50.0 · #### pub const fn segments(&self) -> [u16; 8]
Returns the eight 16-bit segments that make up this address.
##### Examples
```
use std::net::Ipv6Addr;
assert_eq!(Ipv6Addr::new(0, 0, 0, 0, 0, 0xffff, 0xc00a, 0x2ff).segments(),
[0, 0, 0, 0, 0, 0xffff, 0xc00a, 0x2ff]);
```
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#1273-1275)1.7.0 (const: 1.50.0) · #### pub const fn is\_unspecified(&self) -> bool
Returns [`true`](../primitive.bool "true") for the special ‘unspecified’ address (`::`).
This property is defined in [IETF RFC 4291](https://tools.ietf.org/html/rfc4291).
##### Examples
```
use std::net::Ipv6Addr;
assert_eq!(Ipv6Addr::new(0, 0, 0, 0, 0, 0xffff, 0xc00a, 0x2ff).is_unspecified(), false);
assert_eq!(Ipv6Addr::new(0, 0, 0, 0, 0, 0, 0, 0).is_unspecified(), true);
```
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#1297-1299)1.7.0 (const: 1.50.0) · #### pub const fn is\_loopback(&self) -> bool
Returns [`true`](../primitive.bool "true") if this is the [loopback address](struct.ipv6addr#associatedconstant.LOCALHOST) (`::1`), as defined in [IETF RFC 4291 section 2.5.3](https://tools.ietf.org/html/rfc4291#section-2.5.3).
Contrary to IPv4, in IPv6 there is only one loopback address.
##### Examples
```
use std::net::Ipv6Addr;
assert_eq!(Ipv6Addr::new(0, 0, 0, 0, 0, 0xffff, 0xc00a, 0x2ff).is_loopback(), false);
assert_eq!(Ipv6Addr::new(0, 0, 0, 0, 0, 0, 0, 0x1).is_loopback(), true);
```
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#1369-1395)const: [unstable](https://github.com/rust-lang/rust/issues/76205 "Tracking issue for const_ipv6") · #### pub fn is\_global(&self) -> bool
🔬This is a nightly-only experimental API. (`ip` [#27709](https://github.com/rust-lang/rust/issues/27709))
Returns [`true`](../primitive.bool "true") if the address appears to be globally reachable as specified by the [IANA IPv6 Special-Purpose Address Registry](https://www.iana.org/assignments/iana-ipv6-special-registry/iana-ipv6-special-registry.xhtml). Whether or not an address is practically reachable will depend on your network configuration.
Most IPv6 addresses are globally reachable; unless they are specifically defined as *not* globally reachable.
Non-exhaustive list of notable addresses that are not globally reachable:
* The [unspecified address](struct.ipv6addr#associatedconstant.UNSPECIFIED) ([`is_unspecified`](struct.ipv6addr#method.is_unspecified))
* The [loopback address](struct.ipv6addr#associatedconstant.LOCALHOST) ([`is_loopback`](struct.ipv6addr#method.is_loopback))
* IPv4-mapped addresses
* Addresses reserved for benchmarking
* Addresses reserved for documentation ([`is_documentation`](struct.ipv6addr#method.is_documentation))
* Unique local addresses ([`is_unique_local`](struct.ipv6addr#method.is_unique_local))
* Unicast addresses with link-local scope ([`is_unicast_link_local`](struct.ipv6addr#method.is_unicast_link_local))
For the complete overview of which addresses are globally reachable, see the table at the [IANA IPv6 Special-Purpose Address Registry](https://www.iana.org/assignments/iana-ipv6-special-registry/iana-ipv6-special-registry.xhtml).
Note that an address having global scope is not the same as being globally reachable, and there is no direct relation between the two concepts: There exist addresses with global scope that are not globally reachable (for example unique local addresses), and addresses that are globally reachable without having global scope (multicast addresses with non-global scope).
##### Examples
```
#![feature(ip)]
use std::net::Ipv6Addr;
// Most IPv6 addresses are globally reachable:
assert_eq!(Ipv6Addr::new(0x26, 0, 0x1c9, 0, 0, 0xafc8, 0x10, 0x1).is_global(), true);
// However some addresses have been assigned a special meaning
// that makes them not globally reachable. Some examples are:
// The unspecified address (`::`)
assert_eq!(Ipv6Addr::UNSPECIFIED.is_global(), false);
// The loopback address (`::1`)
assert_eq!(Ipv6Addr::LOCALHOST.is_global(), false);
// IPv4-mapped addresses (`::ffff:0:0/96`)
assert_eq!(Ipv6Addr::new(0, 0, 0, 0, 0, 0xffff, 0xc00a, 0x2ff).is_global(), false);
// Addresses reserved for benchmarking (`2001:2::/48`)
assert_eq!(Ipv6Addr::new(0x2001, 2, 0, 0, 0, 0, 0, 1,).is_global(), false);
// Addresses reserved for documentation (`2001:db8::/32`)
assert_eq!(Ipv6Addr::new(0x2001, 0xdb8, 0, 0, 0, 0, 0, 1).is_global(), false);
// Unique local addresses (`fc00::/7`)
assert_eq!(Ipv6Addr::new(0xfc02, 0, 0, 0, 0, 0, 0, 1).is_global(), false);
// Unicast addresses with link-local scope (`fe80::/10`)
assert_eq!(Ipv6Addr::new(0xfe81, 0, 0, 0, 0, 0, 0, 1).is_global(), false);
// For a complete overview see the IANA IPv6 Special-Purpose Address Registry.
```
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#1417-1419)const: [unstable](https://github.com/rust-lang/rust/issues/76205 "Tracking issue for const_ipv6") · #### pub fn is\_unique\_local(&self) -> bool
🔬This is a nightly-only experimental API. (`ip` [#27709](https://github.com/rust-lang/rust/issues/27709))
Returns [`true`](../primitive.bool "true") if this is a unique local address (`fc00::/7`).
This property is defined in [IETF RFC 4193](https://tools.ietf.org/html/rfc4193).
##### Examples
```
#![feature(ip)]
use std::net::Ipv6Addr;
assert_eq!(Ipv6Addr::new(0, 0, 0, 0, 0, 0xffff, 0xc00a, 0x2ff).is_unique_local(), false);
assert_eq!(Ipv6Addr::new(0xfc02, 0, 0, 0, 0, 0, 0, 0).is_unique_local(), true);
```
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#1446-1448)const: [unstable](https://github.com/rust-lang/rust/issues/76205 "Tracking issue for const_ipv6") · #### pub fn is\_unicast(&self) -> bool
🔬This is a nightly-only experimental API. (`ip` [#27709](https://github.com/rust-lang/rust/issues/27709))
Returns [`true`](../primitive.bool "true") if this is a unicast address, as defined by [IETF RFC 4291](https://tools.ietf.org/html/rfc4291). Any address that is not a [multicast address](struct.ipv6addr#method.is_multicast) (`ff00::/8`) is unicast.
##### Examples
```
#![feature(ip)]
use std::net::Ipv6Addr;
// The unspecified and loopback addresses are unicast.
assert_eq!(Ipv6Addr::UNSPECIFIED.is_unicast(), true);
assert_eq!(Ipv6Addr::LOCALHOST.is_unicast(), true);
// Any address that is not a multicast address (`ff00::/8`) is unicast.
assert_eq!(Ipv6Addr::new(0x2001, 0xdb8, 0, 0, 0, 0, 0, 0).is_unicast(), true);
assert_eq!(Ipv6Addr::new(0xff00, 0, 0, 0, 0, 0, 0, 0).is_unicast(), false);
```
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#1498-1500)const: [unstable](https://github.com/rust-lang/rust/issues/76205 "Tracking issue for const_ipv6") · #### pub fn is\_unicast\_link\_local(&self) -> bool
🔬This is a nightly-only experimental API. (`ip` [#27709](https://github.com/rust-lang/rust/issues/27709))
Returns `true` if the address is a unicast address with link-local scope, as defined in [RFC 4291](https://tools.ietf.org/html/rfc4291).
A unicast address has link-local scope if it has the prefix `fe80::/10`, as per [RFC 4291 section 2.4](https://tools.ietf.org/html/rfc4291#section-2.4). Note that this encompasses more addresses than those defined in [RFC 4291 section 2.5.6](https://tools.ietf.org/html/rfc4291#section-2.5.6), which describes “Link-Local IPv6 Unicast Addresses” as having the following stricter format:
```
| 10 bits | 54 bits | 64 bits |
+----------+-------------------------+----------------------------+
|1111111010| 0 | interface ID |
+----------+-------------------------+----------------------------+
```
So while currently the only addresses with link-local scope an application will encounter are all in `fe80::/64`, this might change in the future with the publication of new standards. More addresses in `fe80::/10` could be allocated, and those addresses will have link-local scope.
Also note that while [RFC 4291 section 2.5.3](https://tools.ietf.org/html/rfc4291#section-2.5.3) mentions about the [loopback address](struct.ipv6addr#associatedconstant.LOCALHOST) (`::1`) that “it is treated as having Link-Local scope”, this does not mean that the loopback address actually has link-local scope and this method will return `false` on it.
##### Examples
```
#![feature(ip)]
use std::net::Ipv6Addr;
// The loopback address (`::1`) does not actually have link-local scope.
assert_eq!(Ipv6Addr::LOCALHOST.is_unicast_link_local(), false);
// Only addresses in `fe80::/10` have link-local scope.
assert_eq!(Ipv6Addr::new(0x2001, 0xdb8, 0, 0, 0, 0, 0, 0).is_unicast_link_local(), false);
assert_eq!(Ipv6Addr::new(0xfe80, 0, 0, 0, 0, 0, 0, 0).is_unicast_link_local(), true);
// Addresses outside the stricter `fe80::/64` also have link-local scope.
assert_eq!(Ipv6Addr::new(0xfe80, 0, 0, 1, 0, 0, 0, 0).is_unicast_link_local(), true);
assert_eq!(Ipv6Addr::new(0xfe81, 0, 0, 0, 0, 0, 0, 0).is_unicast_link_local(), true);
```
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#1523-1525)const: [unstable](https://github.com/rust-lang/rust/issues/76205 "Tracking issue for const_ipv6") · #### pub fn is\_documentation(&self) -> bool
🔬This is a nightly-only experimental API. (`ip` [#27709](https://github.com/rust-lang/rust/issues/27709))
Returns [`true`](../primitive.bool "true") if this is an address reserved for documentation (`2001:db8::/32`).
This property is defined in [IETF RFC 3849](https://tools.ietf.org/html/rfc3849).
##### Examples
```
#![feature(ip)]
use std::net::Ipv6Addr;
assert_eq!(Ipv6Addr::new(0, 0, 0, 0, 0, 0xffff, 0xc00a, 0x2ff).is_documentation(), false);
assert_eq!(Ipv6Addr::new(0x2001, 0xdb8, 0, 0, 0, 0, 0, 0).is_documentation(), true);
```
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#1546-1548)#### pub const fn is\_benchmarking(&self) -> bool
🔬This is a nightly-only experimental API. (`ip` [#27709](https://github.com/rust-lang/rust/issues/27709))
Returns [`true`](../primitive.bool "true") if this is an address reserved for benchmarking (`2001:2::/48`).
This property is defined in [IETF RFC 5180](https://tools.ietf.org/html/rfc5180), where it is mistakenly specified as covering the range `2001:0200::/48`. This is corrected in [IETF RFC Errata 1752](https://www.rfc-editor.org/errata_search.php?eid=1752) to `2001:0002::/48`.
```
#![feature(ip)]
use std::net::Ipv6Addr;
assert_eq!(Ipv6Addr::new(0, 0, 0, 0, 0, 0xffff, 0xc613, 0x0).is_benchmarking(), false);
assert_eq!(Ipv6Addr::new(0x2001, 0x2, 0, 0, 0, 0, 0, 0).is_benchmarking(), true);
```
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#1584-1592)const: [unstable](https://github.com/rust-lang/rust/issues/76205 "Tracking issue for const_ipv6") · #### pub fn is\_unicast\_global(&self) -> bool
🔬This is a nightly-only experimental API. (`ip` [#27709](https://github.com/rust-lang/rust/issues/27709))
Returns [`true`](../primitive.bool "true") if the address is a globally routable unicast address.
The following return false:
* the loopback address
* the link-local addresses
* unique local addresses
* the unspecified address
* the address range reserved for documentation
This method returns [`true`](../primitive.bool "true") for site-local addresses as per [RFC 4291 section 2.5.7](https://tools.ietf.org/html/rfc4291#section-2.5.7)
```
The special behavior of [the site-local unicast] prefix defined in [RFC3513] must no longer
be supported in new implementations (i.e., new implementations must treat this prefix as
Global Unicast).
```
##### Examples
```
#![feature(ip)]
use std::net::Ipv6Addr;
assert_eq!(Ipv6Addr::new(0x2001, 0xdb8, 0, 0, 0, 0, 0, 0).is_unicast_global(), false);
assert_eq!(Ipv6Addr::new(0, 0, 0, 0, 0, 0xffff, 0xc00a, 0x2ff).is_unicast_global(), true);
```
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#1613-1628)const: [unstable](https://github.com/rust-lang/rust/issues/76205 "Tracking issue for const_ipv6") · #### pub fn multicast\_scope(&self) -> Option<Ipv6MulticastScope>
🔬This is a nightly-only experimental API. (`ip` [#27709](https://github.com/rust-lang/rust/issues/27709))
Returns the address’s multicast scope if the address is multicast.
##### Examples
```
#![feature(ip)]
use std::net::{Ipv6Addr, Ipv6MulticastScope};
assert_eq!(
Ipv6Addr::new(0xff0e, 0, 0, 0, 0, 0, 0, 0).multicast_scope(),
Some(Ipv6MulticastScope::Global)
);
assert_eq!(Ipv6Addr::new(0, 0, 0, 0, 0, 0xffff, 0xc00a, 0x2ff).multicast_scope(), None);
```
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#1648-1650)1.7.0 (const: 1.50.0) · #### pub const fn is\_multicast(&self) -> bool
Returns [`true`](../primitive.bool "true") if this is a multicast address (`ff00::/8`).
This property is defined by [IETF RFC 4291](https://tools.ietf.org/html/rfc4291).
##### Examples
```
use std::net::Ipv6Addr;
assert_eq!(Ipv6Addr::new(0xff00, 0, 0, 0, 0, 0, 0, 0).is_multicast(), true);
assert_eq!(Ipv6Addr::new(0, 0, 0, 0, 0, 0xffff, 0xc00a, 0x2ff).is_multicast(), false);
```
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#1677-1684)1.63.0 (const: [unstable](https://github.com/rust-lang/rust/issues/76205 "Tracking issue for const_ipv6")) · #### pub fn to\_ipv4\_mapped(&self) -> Option<Ipv4Addr>
Converts this address to an [`IPv4` address](struct.ipv4addr) if it’s an [IPv4-mapped](struct.ipv6addr) address, as defined in [IETF RFC 4291 section 2.5.5.2](https://tools.ietf.org/html/rfc4291#section-2.5.5.2), otherwise returns [`None`](../option/enum.option#variant.None "None").
`::ffff:a.b.c.d` becomes `a.b.c.d`. All addresses *not* starting with `::ffff` will return `None`.
##### Examples
```
use std::net::{Ipv4Addr, Ipv6Addr};
assert_eq!(Ipv6Addr::new(0xff00, 0, 0, 0, 0, 0, 0, 0).to_ipv4_mapped(), None);
assert_eq!(Ipv6Addr::new(0, 0, 0, 0, 0, 0xffff, 0xc00a, 0x2ff).to_ipv4_mapped(),
Some(Ipv4Addr::new(192, 10, 2, 255)));
assert_eq!(Ipv6Addr::new(0, 0, 0, 0, 0, 0, 0, 1).to_ipv4_mapped(), None);
```
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#1719-1727)const: 1.50.0 · #### pub const fn to\_ipv4(&self) -> Option<Ipv4Addr>
Converts this address to an [`IPv4` address](struct.ipv4addr) if it is either an [IPv4-compatible](struct.ipv6addr#ipv4-compatible-ipv6-addresses) address as defined in [IETF RFC 4291 section 2.5.5.1](https://tools.ietf.org/html/rfc4291#section-2.5.5.1), or an [IPv4-mapped](struct.ipv6addr#ipv4-mapped-ipv6-addresses) address as defined in [IETF RFC 4291 section 2.5.5.2](https://tools.ietf.org/html/rfc4291#section-2.5.5.2), otherwise returns [`None`](../option/enum.option#variant.None "None").
Note that this will return an [`IPv4` address](struct.ipv4addr) for the IPv6 loopback address `::1`. Use [`Ipv6Addr::to_ipv4_mapped`](struct.ipv6addr#method.to_ipv4_mapped "Ipv6Addr::to_ipv4_mapped") to avoid this.
`::a.b.c.d` and `::ffff:a.b.c.d` become `a.b.c.d`. `::1` becomes `0.0.0.1`. All addresses *not* starting with either all zeroes or `::ffff` will return `None`.
##### Examples
```
use std::net::{Ipv4Addr, Ipv6Addr};
assert_eq!(Ipv6Addr::new(0xff00, 0, 0, 0, 0, 0, 0, 0).to_ipv4(), None);
assert_eq!(Ipv6Addr::new(0, 0, 0, 0, 0, 0xffff, 0xc00a, 0x2ff).to_ipv4(),
Some(Ipv4Addr::new(192, 10, 2, 255)));
assert_eq!(Ipv6Addr::new(0, 0, 0, 0, 0, 0, 0, 1).to_ipv4(),
Some(Ipv4Addr::new(0, 0, 0, 1)));
```
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#1746-1751)const: [unstable](https://github.com/rust-lang/rust/issues/76205 "Tracking issue for const_ipv6") · #### pub fn to\_canonical(&self) -> IpAddr
🔬This is a nightly-only experimental API. (`ip` [#27709](https://github.com/rust-lang/rust/issues/27709))
Converts this address to an `IpAddr::V4` if it is an IPv4-mapped addresses, otherwise it returns self wrapped in an `IpAddr::V6`.
##### Examples
```
#![feature(ip)]
use std::net::Ipv6Addr;
assert_eq!(Ipv6Addr::new(0, 0, 0, 0, 0, 0xffff, 0x7f00, 0x1).is_loopback(), false);
assert_eq!(Ipv6Addr::new(0, 0, 0, 0, 0, 0xffff, 0x7f00, 0x1).to_canonical().is_loopback(), true);
```
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#1765-1767)1.12.0 (const: 1.32.0) · #### pub const fn octets(&self) -> [u8; 16]
Returns the sixteen eight-bit integers the IPv6 address consists of.
```
use std::net::Ipv6Addr;
assert_eq!(Ipv6Addr::new(0xff00, 0, 0, 0, 0, 0, 0, 0).octets(),
[255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]);
```
[source](https://doc.rust-lang.org/src/std/net/parser.rs.html#335-351)### impl Ipv6Addr
[source](https://doc.rust-lang.org/src/std/net/parser.rs.html#348-350)#### pub fn parse\_ascii(b: &[u8]) -> Result<Self, AddrParseError>
🔬This is a nightly-only experimental API. (`addr_parse_ascii` [#101035](https://github.com/rust-lang/rust/issues/101035))
Parse an IPv6 address from a slice of bytes.
```
#![feature(addr_parse_ascii)]
use std::net::Ipv6Addr;
let localhost = Ipv6Addr::new(0, 0, 0, 0, 0, 0, 0, 1);
assert_eq!(Ipv6Addr::parse_ascii(b"::1"), Ok(localhost));
```
Trait Implementations
---------------------
[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/ip_addr.rs.html#158)#### fn clone(&self) -> Ipv6Addr
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/net/ip_addr.rs.html#1859-1863)### impl Debug for Ipv6Addr
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#1860-1862)#### 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/net/ip_addr.rs.html#1773-1856)### impl Display for Ipv6Addr
Write an Ipv6Addr, conforming to the canonical style described by [RFC 5952](https://tools.ietf.org/html/rfc5952).
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#1774-1855)#### 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/net/ip_addr.rs.html#2010-2037)1.16.0 · ### impl From<[u16; 8]> for Ipv6Addr
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#2033-2036)#### fn from(segments: [u16; 8]) -> Ipv6Addr
Creates an `Ipv6Addr` from an eight element 16-bit array.
##### Examples
```
use std::net::Ipv6Addr;
let addr = Ipv6Addr::from([
525u16, 524u16, 523u16, 522u16,
521u16, 520u16, 519u16, 518u16,
]);
assert_eq!(
Ipv6Addr::new(
0x20d, 0x20c,
0x20b, 0x20a,
0x209, 0x208,
0x207, 0x206
),
addr
);
```
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#1981-2007)1.9.0 · ### impl From<[u8; 16]> for Ipv6Addr
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#2004-2006)#### fn from(octets: [u8; 16]) -> Ipv6Addr
Creates an `Ipv6Addr` from a sixteen element byte array.
##### Examples
```
use std::net::Ipv6Addr;
let addr = Ipv6Addr::from([
25u8, 24u8, 23u8, 22u8, 21u8, 20u8, 19u8, 18u8,
17u8, 16u8, 15u8, 14u8, 13u8, 12u8, 11u8, 10u8,
]);
assert_eq!(
Ipv6Addr::new(
0x1918, 0x1716,
0x1514, 0x1312,
0x1110, 0x0f0e,
0x0d0c, 0x0b0a
),
addr
);
```
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#969-988)1.16.0 · ### impl From<Ipv6Addr> for IpAddr
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#985-987)#### fn from(ipv6: Ipv6Addr) -> IpAddr
Copies this address to a new `IpAddr::V6`.
##### Examples
```
use std::net::{IpAddr, Ipv6Addr};
let addr = Ipv6Addr::new(0, 0, 0, 0, 0, 0xffff, 0xc00a, 0x2ff);
assert_eq!(
IpAddr::V6(addr),
IpAddr::from(addr)
);
```
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#1938-1956)1.26.0 · ### impl From<Ipv6Addr> for u128
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#1953-1955)#### fn from(ip: Ipv6Addr) -> u128
Convert an `Ipv6Addr` into a host byte order `u128`.
##### Examples
```
use std::net::Ipv6Addr;
let addr = Ipv6Addr::new(
0x1020, 0x3040, 0x5060, 0x7080,
0x90A0, 0xB0C0, 0xD0E0, 0xF00D,
);
assert_eq!(0x102030405060708090A0B0C0D0E0F00D_u128, u128::from(addr));
```
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#1958-1978)1.26.0 · ### impl From<u128> for Ipv6Addr
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#1975-1977)#### fn from(ip: u128) -> Ipv6Addr
Convert a host byte order `u128` into an `Ipv6Addr`.
##### Examples
```
use std::net::Ipv6Addr;
let addr = Ipv6Addr::from(0x102030405060708090A0B0C0D0E0F00D_u128);
assert_eq!(
Ipv6Addr::new(
0x1020, 0x3040, 0x5060, 0x7080,
0x90A0, 0xB0C0, 0xD0E0, 0xF00D,
),
addr);
```
[source](https://doc.rust-lang.org/src/std/net/parser.rs.html#354-359)### impl FromStr for Ipv6Addr
#### type Err = AddrParseError
The associated error which can be returned from parsing.
[source](https://doc.rust-lang.org/src/std/net/parser.rs.html#356-358)#### fn from\_str(s: &str) -> Result<Ipv6Addr, AddrParseError>
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/net/ip_addr.rs.html#158)### impl Hash for Ipv6Addr
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#158)#### 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/net/ip_addr.rs.html#1918-1923)### impl Ord for Ipv6Addr
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#1920-1922)#### fn cmp(&self, other: &Ipv6Addr) -> 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/net/ip_addr.rs.html#1866-1874)1.16.0 · ### impl PartialEq<IpAddr> for Ipv6Addr
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#1868-1873)#### fn eq(&self, other: &IpAddr) -> 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/net/ip_addr.rs.html#1877-1885)1.16.0 · ### impl PartialEq<Ipv6Addr> for IpAddr
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#1879-1884)#### fn eq(&self, other: &Ipv6Addr) -> 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/net/ip_addr.rs.html#158)### impl PartialEq<Ipv6Addr> for Ipv6Addr
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#158)#### fn eq(&self, other: &Ipv6Addr) -> 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/net/ip_addr.rs.html#1907-1915)1.16.0 · ### impl PartialOrd<IpAddr> for Ipv6Addr
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#1909-1914)#### fn partial\_cmp(&self, other: &IpAddr) -> 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/net/ip_addr.rs.html#1896-1904)1.16.0 · ### impl PartialOrd<Ipv6Addr> for IpAddr
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#1898-1903)#### fn partial\_cmp(&self, other: &Ipv6Addr) -> 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/net/ip_addr.rs.html#1888-1893)### impl PartialOrd<Ipv6Addr> for Ipv6Addr
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#1890-1892)#### fn partial\_cmp(&self, other: &Ipv6Addr) -> 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/net/ip_addr.rs.html#158)### impl Copy for Ipv6Addr
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#158)### impl Eq for Ipv6Addr
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#158)### impl StructuralEq for Ipv6Addr
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#158)### impl StructuralPartialEq for Ipv6Addr
Auto Trait Implementations
--------------------------
### impl RefUnwindSafe for Ipv6Addr
### impl Send for Ipv6Addr
### impl Sync for Ipv6Addr
### impl Unpin for Ipv6Addr
### impl UnwindSafe for Ipv6Addr
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::net::TcpStream Struct std::net::TcpStream
==========================
```
pub struct TcpStream(_);
```
A TCP stream between a local and a remote socket.
After creating a `TcpStream` by either [`connect`](struct.tcpstream#method.connect)ing to a remote host or [`accept`](struct.tcplistener#method.accept)ing a connection on a [`TcpListener`](struct.tcplistener "TcpListener"), data can be transmitted by [reading](../io/trait.read) and [writing](../io/trait.write) to it.
The connection will be closed when the value is dropped. The reading and writing portions of the connection can also be shut down individually with the [`shutdown`](struct.tcpstream#method.shutdown) method.
The Transmission Control Protocol is specified in [IETF RFC 793](https://tools.ietf.org/html/rfc793).
Examples
--------
```
use std::io::prelude::*;
use std::net::TcpStream;
fn main() -> std::io::Result<()> {
let mut stream = TcpStream::connect("127.0.0.1:34254")?;
stream.write(&[1])?;
stream.read(&mut [0; 128])?;
Ok(())
} // the stream is closed here
```
Implementations
---------------
[source](https://doc.rust-lang.org/src/std/net/tcp.rs.html#113-608)### impl TcpStream
[source](https://doc.rust-lang.org/src/std/net/tcp.rs.html#156-158)#### pub fn connect<A: ToSocketAddrs>(addr: A) -> Result<TcpStream>
Opens a TCP connection to a remote host.
`addr` is an address of the remote host. Anything which implements [`ToSocketAddrs`](trait.tosocketaddrs "ToSocketAddrs") trait can be supplied for the address; see this trait documentation for concrete examples.
If `addr` yields multiple addresses, `connect` will be attempted with each of the addresses until a connection is successful. If none of the addresses result in a successful connection, the error returned from the last connection attempt (the last address) is returned.
##### Examples
Open a TCP connection to `127.0.0.1:8080`:
```
use std::net::TcpStream;
if let Ok(stream) = TcpStream::connect("127.0.0.1:8080") {
println!("Connected to the server!");
} else {
println!("Couldn't connect to server...");
}
```
Open a TCP connection to `127.0.0.1:8080`. If the connection fails, open a TCP connection to `127.0.0.1:8081`:
```
use std::net::{SocketAddr, TcpStream};
let addrs = [
SocketAddr::from(([127, 0, 0, 1], 8080)),
SocketAddr::from(([127, 0, 0, 1], 8081)),
];
if let Ok(stream) = TcpStream::connect(&addrs[..]) {
println!("Connected to the server!");
} else {
println!("Couldn't connect to server...");
}
```
[source](https://doc.rust-lang.org/src/std/net/tcp.rs.html#172-174)1.21.0 · #### pub fn connect\_timeout(addr: &SocketAddr, timeout: Duration) -> Result<TcpStream>
Opens a TCP connection to a remote host with a timeout.
Unlike `connect`, `connect_timeout` takes a single [`SocketAddr`](enum.socketaddr "SocketAddr") since timeout must be applied to individual addresses.
It is an error to pass a zero `Duration` to this function.
Unlike other methods on `TcpStream`, this does not correspond to a single system call. It instead calls `connect` in nonblocking mode and then uses an OS-specific mechanism to await the completion of the connection request.
[source](https://doc.rust-lang.org/src/std/net/tcp.rs.html#189-191)#### pub fn peer\_addr(&self) -> Result<SocketAddr>
Returns the socket address of the remote peer of this TCP connection.
##### Examples
```
use std::net::{Ipv4Addr, SocketAddr, SocketAddrV4, TcpStream};
let stream = TcpStream::connect("127.0.0.1:8080")
.expect("Couldn't connect to the server...");
assert_eq!(stream.peer_addr().unwrap(),
SocketAddr::V4(SocketAddrV4::new(Ipv4Addr::new(127, 0, 0, 1), 8080)));
```
[source](https://doc.rust-lang.org/src/std/net/tcp.rs.html#206-208)#### pub fn local\_addr(&self) -> Result<SocketAddr>
Returns the socket address of the local half of this TCP connection.
##### Examples
```
use std::net::{IpAddr, Ipv4Addr, TcpStream};
let stream = TcpStream::connect("127.0.0.1:8080")
.expect("Couldn't connect to the server...");
assert_eq!(stream.local_addr().unwrap().ip(),
IpAddr::V4(Ipv4Addr::new(127, 0, 0, 1)));
```
[source](https://doc.rust-lang.org/src/std/net/tcp.rs.html#233-235)#### 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 on the specified portions to return immediately with an appropriate value (see the documentation of [`Shutdown`](enum.shutdown "Shutdown")).
##### Platform-specific behavior
Calling this function multiple times may result in different behavior, depending on the operating system. On Linux, the second call will return `Ok(())`, but on macOS, it will return `ErrorKind::NotConnected`. This may change in the future.
##### Examples
```
use std::net::{Shutdown, TcpStream};
let stream = TcpStream::connect("127.0.0.1:8080")
.expect("Couldn't connect to the server...");
stream.shutdown(Shutdown::Both).expect("shutdown call failed");
```
[source](https://doc.rust-lang.org/src/std/net/tcp.rs.html#254-256)#### pub fn try\_clone(&self) -> Result<TcpStream>
Creates a new independently owned handle to the underlying socket.
The returned `TcpStream` 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::net::TcpStream;
let stream = TcpStream::connect("127.0.0.1:8080")
.expect("Couldn't connect to the server...");
let stream_clone = stream.try_clone().expect("clone failed...");
```
[source](https://doc.rust-lang.org/src/std/net/tcp.rs.html#298-300)1.4.0 · #### pub fn set\_read\_timeout(&self, dur: Option<Duration>) -> Result<()>
Sets the read timeout to the timeout specified.
If the value specified 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.
##### Platform-specific behavior
Platforms may return a different error code whenever a read times out as a result of setting this option. For example Unix typically returns an error of the kind [`WouldBlock`](../io/enum.errorkind#variant.WouldBlock), but Windows may return [`TimedOut`](../io/enum.errorkind#variant.TimedOut).
##### Examples
```
use std::net::TcpStream;
let stream = TcpStream::connect("127.0.0.1:8080")
.expect("Couldn't connect to the server...");
stream.set_read_timeout(None).expect("set_read_timeout call failed");
```
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::TcpStream;
use std::time::Duration;
let stream = TcpStream::connect("127.0.0.1:8080").unwrap();
let result = stream.set_read_timeout(Some(Duration::new(0, 0)));
let err = result.unwrap_err();
assert_eq!(err.kind(), io::ErrorKind::InvalidInput)
```
[source](https://doc.rust-lang.org/src/std/net/tcp.rs.html#342-344)1.4.0 · #### pub fn set\_write\_timeout(&self, dur: Option<Duration>) -> Result<()>
Sets the write timeout to the timeout specified.
If the value specified is [`None`](../option/enum.option#variant.None "None"), then [`write`](../io/trait.write#tymethod.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.
##### Platform-specific behavior
Platforms may return a different error code whenever a write times out as a result of setting this option. For example Unix typically returns an error of the kind [`WouldBlock`](../io/enum.errorkind#variant.WouldBlock), but Windows may return [`TimedOut`](../io/enum.errorkind#variant.TimedOut).
##### Examples
```
use std::net::TcpStream;
let stream = TcpStream::connect("127.0.0.1:8080")
.expect("Couldn't connect to the server...");
stream.set_write_timeout(None).expect("set_write_timeout call failed");
```
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::TcpStream;
use std::time::Duration;
let stream = TcpStream::connect("127.0.0.1:8080").unwrap();
let result = stream.set_write_timeout(Some(Duration::new(0, 0)));
let err = result.unwrap_err();
assert_eq!(err.kind(), io::ErrorKind::InvalidInput)
```
[source](https://doc.rust-lang.org/src/std/net/tcp.rs.html#367-369)1.4.0 · #### pub fn read\_timeout(&self) -> Result<Option<Duration>>
Returns the read timeout of this socket.
If the timeout is [`None`](../option/enum.option#variant.None "None"), then [`read`](../io/trait.read#tymethod.read) calls will block indefinitely.
##### Platform-specific behavior
Some platforms do not provide access to the current timeout.
##### Examples
```
use std::net::TcpStream;
let stream = TcpStream::connect("127.0.0.1:8080")
.expect("Couldn't connect to the server...");
stream.set_read_timeout(None).expect("set_read_timeout call failed");
assert_eq!(stream.read_timeout().unwrap(), None);
```
[source](https://doc.rust-lang.org/src/std/net/tcp.rs.html#392-394)1.4.0 · #### pub fn write\_timeout(&self) -> Result<Option<Duration>>
Returns the write timeout of this socket.
If the timeout is [`None`](../option/enum.option#variant.None "None"), then [`write`](../io/trait.write#tymethod.write) calls will block indefinitely.
##### Platform-specific behavior
Some platforms do not provide access to the current timeout.
##### Examples
```
use std::net::TcpStream;
let stream = TcpStream::connect("127.0.0.1:8080")
.expect("Couldn't connect to the server...");
stream.set_write_timeout(None).expect("set_write_timeout call failed");
assert_eq!(stream.write_timeout().unwrap(), None);
```
[source](https://doc.rust-lang.org/src/std/net/tcp.rs.html#414-416)1.18.0 · #### pub fn peek(&self, buf: &mut [u8]) -> Result<usize>
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
```
use std::net::TcpStream;
let stream = TcpStream::connect("127.0.0.1:8000")
.expect("Couldn't connect to the server...");
let mut buf = [0; 10];
let len = stream.peek(&mut buf).expect("peek failed");
```
[source](https://doc.rust-lang.org/src/std/net/tcp.rs.html#439-441)#### pub fn set\_linger(&self, linger: Option<Duration>) -> Result<()>
🔬This is a nightly-only experimental API. (`tcp_linger` [#88494](https://github.com/rust-lang/rust/issues/88494))
Sets the value of the `SO_LINGER` option on this socket.
This value controls how the socket is closed when data remains to be sent. If `SO_LINGER` is set, the socket will remain open for the specified duration as the system attempts to send pending data. Otherwise, the system may close the socket immediately, or wait for a default timeout.
##### Examples
```
#![feature(tcp_linger)]
use std::net::TcpStream;
use std::time::Duration;
let stream = TcpStream::connect("127.0.0.1:8080")
.expect("Couldn't connect to the server...");
stream.set_linger(Some(Duration::from_secs(0))).expect("set_linger call failed");
```
[source](https://doc.rust-lang.org/src/std/net/tcp.rs.html#461-463)#### pub fn linger(&self) -> Result<Option<Duration>>
🔬This is a nightly-only experimental API. (`tcp_linger` [#88494](https://github.com/rust-lang/rust/issues/88494))
Gets the value of the `SO_LINGER` option on this socket.
For more information about this option, see [`TcpStream::set_linger`](struct.tcpstream#method.set_linger "TcpStream::set_linger").
##### Examples
```
#![feature(tcp_linger)]
use std::net::TcpStream;
use std::time::Duration;
let stream = TcpStream::connect("127.0.0.1:8080")
.expect("Couldn't connect to the server...");
stream.set_linger(Some(Duration::from_secs(0))).expect("set_linger call failed");
assert_eq!(stream.linger().unwrap(), Some(Duration::from_secs(0)));
```
[source](https://doc.rust-lang.org/src/std/net/tcp.rs.html#483-485)1.9.0 · #### pub fn set\_nodelay(&self, nodelay: bool) -> Result<()>
Sets the value of the `TCP_NODELAY` option on this socket.
If set, this option disables the Nagle algorithm. This means that segments are always sent as soon as possible, even if there is only a small amount of data. When not set, data is buffered until there is a sufficient amount to send out, thereby avoiding the frequent sending of small packets.
##### Examples
```
use std::net::TcpStream;
let stream = TcpStream::connect("127.0.0.1:8080")
.expect("Couldn't connect to the server...");
stream.set_nodelay(true).expect("set_nodelay call failed");
```
[source](https://doc.rust-lang.org/src/std/net/tcp.rs.html#502-504)1.9.0 · #### pub fn nodelay(&self) -> Result<bool>
Gets the value of the `TCP_NODELAY` option on this socket.
For more information about this option, see [`TcpStream::set_nodelay`](struct.tcpstream#method.set_nodelay "TcpStream::set_nodelay").
##### Examples
```
use std::net::TcpStream;
let stream = TcpStream::connect("127.0.0.1:8080")
.expect("Couldn't connect to the server...");
stream.set_nodelay(true).expect("set_nodelay call failed");
assert_eq!(stream.nodelay().unwrap_or(false), true);
```
[source](https://doc.rust-lang.org/src/std/net/tcp.rs.html#521-523)1.9.0 · #### pub fn set\_ttl(&self, ttl: u32) -> Result<()>
Sets the value for the `IP_TTL` option on this socket.
This value sets the time-to-live field that is used in every packet sent from this socket.
##### Examples
```
use std::net::TcpStream;
let stream = TcpStream::connect("127.0.0.1:8080")
.expect("Couldn't connect to the server...");
stream.set_ttl(100).expect("set_ttl call failed");
```
[source](https://doc.rust-lang.org/src/std/net/tcp.rs.html#540-542)1.9.0 · #### pub fn ttl(&self) -> Result<u32>
Gets the value of the `IP_TTL` option for this socket.
For more information about this option, see [`TcpStream::set_ttl`](struct.tcpstream#method.set_ttl "TcpStream::set_ttl").
##### Examples
```
use std::net::TcpStream;
let stream = TcpStream::connect("127.0.0.1:8080")
.expect("Couldn't connect to the server...");
stream.set_ttl(100).expect("set_ttl call failed");
assert_eq!(stream.ttl().unwrap_or(0), 100);
```
[source](https://doc.rust-lang.org/src/std/net/tcp.rs.html#560-562)1.9.0 · #### pub fn take\_error(&self) -> Result<Option<Error>>
Gets the value of the `SO_ERROR` option on this socket.
This will retrieve the stored error in the underlying socket, clearing the field in the process. This can be useful for checking errors between calls.
##### Examples
```
use std::net::TcpStream;
let stream = TcpStream::connect("127.0.0.1:8080")
.expect("Couldn't connect to the server...");
stream.take_error().expect("No error was expected...");
```
[source](https://doc.rust-lang.org/src/std/net/tcp.rs.html#605-607)1.9.0 · #### pub fn set\_nonblocking(&self, nonblocking: bool) -> Result<()>
Moves this TCP stream into or out of nonblocking mode.
This will result in `read`, `write`, `recv` and `send` operations becoming nonblocking, i.e., immediately returning from their calls. If the IO operation is successful, `Ok` is returned and no further action is required. If the IO operation could not be completed and needs to be retried, an error with kind [`io::ErrorKind::WouldBlock`](../io/enum.errorkind#variant.WouldBlock "io::ErrorKind::WouldBlock") is returned.
On Unix platforms, calling this method corresponds to calling `fcntl` `FIONBIO`. On Windows calling this method corresponds to calling `ioctlsocket` `FIONBIO`.
##### Examples
Reading bytes from a TCP stream in non-blocking mode:
```
use std::io::{self, Read};
use std::net::TcpStream;
let mut stream = TcpStream::connect("127.0.0.1:7878")
.expect("Couldn't connect to the server...");
stream.set_nonblocking(true).expect("set_nonblocking call failed");
let mut buf = vec![];
loop {
match stream.read_to_end(&mut buf) {
Ok(_) => break,
Err(ref e) if e.kind() == io::ErrorKind::WouldBlock => {
// wait until network socket is ready, typically implemented
// via platform-specific APIs such as epoll or IOCP
wait_for_fd();
}
Err(e) => panic!("encountered IO error: {e}"),
};
};
println!("bytes: {buf:?}");
```
Trait Implementations
---------------------
[source](https://doc.rust-lang.org/src/std/os/fd/owned.rs.html#283-288)1.63.0 · ### impl AsFd for TcpStream
[source](https://doc.rust-lang.org/src/std/os/fd/owned.rs.html#285-287)#### 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/std/os/fd/net.rs.html#17)### impl AsRawFd for TcpStream
[source](https://doc.rust-lang.org/src/std/os/fd/net.rs.html#17)#### 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/std/os/windows/io/raw.rs.html#237-242)### impl AsRawSocket for TcpStream
Available on **Windows** only.
[source](https://doc.rust-lang.org/src/std/os/windows/io/raw.rs.html#239-241)#### fn as\_raw\_socket(&self) -> RawSocket
Extracts the raw socket. [Read more](../os/windows/io/trait.asrawsocket#tymethod.as_raw_socket)
[source](https://doc.rust-lang.org/src/std/os/windows/io/socket.rs.html#269-274)1.63.0 · ### impl AsSocket for TcpStream
Available on **Windows** only.
[source](https://doc.rust-lang.org/src/std/os/windows/io/socket.rs.html#271-273)#### fn as\_socket(&self) -> BorrowedSocket<'\_>
Borrows the socket.
[source](https://doc.rust-lang.org/src/std/net/tcp.rs.html#704-708)### impl Debug for TcpStream
[source](https://doc.rust-lang.org/src/std/net/tcp.rs.html#705-707)#### 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/fd/owned.rs.html#299-306)1.63.0 · ### impl From<OwnedFd> for TcpStream
[source](https://doc.rust-lang.org/src/std/os/fd/owned.rs.html#301-305)#### fn from(owned\_fd: OwnedFd) -> Self
Converts to this type from the input type.
[source](https://doc.rust-lang.org/src/std/os/windows/io/socket.rs.html#285-290)1.63.0 · ### impl From<OwnedSocket> for TcpStream
Available on **Windows** only.
[source](https://doc.rust-lang.org/src/std/os/windows/io/socket.rs.html#287-289)#### fn from(owned: OwnedSocket) -> Self
Converts to this type from the input type.
[source](https://doc.rust-lang.org/src/std/os/fd/owned.rs.html#291-296)1.63.0 · ### impl From<TcpStream> for OwnedFd
[source](https://doc.rust-lang.org/src/std/os/fd/owned.rs.html#293-295)#### fn from(tcp\_stream: TcpStream) -> OwnedFd
Converts to this type from the input type.
[source](https://doc.rust-lang.org/src/std/os/windows/io/socket.rs.html#277-282)1.63.0 · ### impl From<TcpStream> for OwnedSocket
Available on **Windows** only.
[source](https://doc.rust-lang.org/src/std/os/windows/io/socket.rs.html#279-281)#### fn from(tcp\_stream: TcpStream) -> OwnedSocket
Converts to this type from the input type.
[source](https://doc.rust-lang.org/src/std/os/fd/net.rs.html#33)1.1.0 · ### impl FromRawFd for TcpStream
[source](https://doc.rust-lang.org/src/std/os/fd/net.rs.html#33)#### unsafe fn from\_raw\_fd(fd: RawFd) -> TcpStream
Notable traits for [TcpStream](struct.tcpstream "struct std::net::TcpStream")
```
impl Read for TcpStream
impl Write for TcpStream
impl Read for &TcpStream
impl Write for &TcpStream
```
Available on **Unix** only.Constructs a new instance of `Self` from the given raw file descriptor. [Read more](../os/unix/io/trait.fromrawfd#tymethod.from_raw_fd)
[source](https://doc.rust-lang.org/src/std/os/windows/io/raw.rs.html#259-265)1.1.0 · ### impl FromRawSocket for TcpStream
Available on **Windows** only.
[source](https://doc.rust-lang.org/src/std/os/windows/io/raw.rs.html#261-264)#### unsafe fn from\_raw\_socket(sock: RawSocket) -> TcpStream
Notable traits for [TcpStream](struct.tcpstream "struct std::net::TcpStream")
```
impl Read for TcpStream
impl Write for TcpStream
impl Read for &TcpStream
impl Write for &TcpStream
```
Constructs a new I/O object from the specified raw socket. [Read more](../os/windows/io/trait.fromrawsocket#tymethod.from_raw_socket)
[source](https://doc.rust-lang.org/src/std/os/fd/net.rs.html#46)1.4.0 · ### impl IntoRawFd for TcpStream
[source](https://doc.rust-lang.org/src/std/os/fd/net.rs.html#46)#### fn into\_raw\_fd(self) -> RawFd
Available on **Unix** only.Consumes this object, returning the raw underlying file descriptor. [Read more](../os/unix/io/trait.intorawfd#tymethod.into_raw_fd)
[source](https://doc.rust-lang.org/src/std/os/windows/io/raw.rs.html#284-289)1.4.0 · ### impl IntoRawSocket for TcpStream
Available on **Windows** only.
[source](https://doc.rust-lang.org/src/std/os/windows/io/raw.rs.html#286-288)#### fn into\_raw\_socket(self) -> RawSocket
Consumes this object, returning the raw underlying socket. [Read more](../os/windows/io/trait.intorawsocket#tymethod.into_raw_socket)
[source](https://doc.rust-lang.org/src/std/net/tcp.rs.html#651-664)### impl Read for &TcpStream
[source](https://doc.rust-lang.org/src/std/net/tcp.rs.html#652-654)#### 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/net/tcp.rs.html#656-658)#### 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/net/tcp.rs.html#661-663)#### 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)#### 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)#### 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)#### 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/net/tcp.rs.html#617-630)### impl Read for TcpStream
[source](https://doc.rust-lang.org/src/std/net/tcp.rs.html#618-620)#### 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/net/tcp.rs.html#622-624)#### 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/net/tcp.rs.html#627-629)#### 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)#### 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)#### 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)#### 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/os/net/tcp.rs.html#62-70)### impl TcpStreamExt for TcpStream
Available on **Linux or Android** only.
[source](https://doc.rust-lang.org/src/std/os/net/tcp.rs.html#63-65)#### fn set\_quickack(&self, quickack: bool) -> Result<()>
🔬This is a nightly-only experimental API. (`tcp_quickack` [#96256](https://github.com/rust-lang/rust/issues/96256))
Available on **Linux** only.Enable or disable `TCP_QUICKACK`. [Read more](../os/linux/net/trait.tcpstreamext#tymethod.set_quickack)
[source](https://doc.rust-lang.org/src/std/os/net/tcp.rs.html#67-69)#### fn quickack(&self) -> Result<bool>
🔬This is a nightly-only experimental API. (`tcp_quickack` [#96256](https://github.com/rust-lang/rust/issues/96256))
Available on **Linux** only.Gets the value of the `TCP_QUICKACK` option on this socket. [Read more](../os/linux/net/trait.tcpstreamext#tymethod.quickack)
[source](https://doc.rust-lang.org/src/std/net/tcp.rs.html#666-683)### impl Write for &TcpStream
[source](https://doc.rust-lang.org/src/std/net/tcp.rs.html#667-669)#### 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/net/tcp.rs.html#671-673)#### 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/net/tcp.rs.html#676-678)#### 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/net/tcp.rs.html#680-682)#### 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)#### 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)#### 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/std/net/tcp.rs.html#632-649)### impl Write for TcpStream
[source](https://doc.rust-lang.org/src/std/net/tcp.rs.html#633-635)#### 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/net/tcp.rs.html#637-639)#### 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/net/tcp.rs.html#642-644)#### 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/net/tcp.rs.html#646-648)#### 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)#### 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)#### 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)
Auto Trait Implementations
--------------------------
### impl RefUnwindSafe for TcpStream
### impl Send for TcpStream
### impl Sync for TcpStream
### impl Unpin for TcpStream
### impl UnwindSafe for TcpStream
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::net::IntoIncoming Struct std::net::IntoIncoming
=============================
```
pub struct IntoIncoming { /* private fields */ }
```
🔬This is a nightly-only experimental API. (`tcplistener_into_incoming` [#88339](https://github.com/rust-lang/rust/issues/88339))
An iterator that infinitely [`accept`](struct.tcplistener#method.accept)s connections on a [`TcpListener`](struct.tcplistener "TcpListener").
This `struct` is created by the [`TcpListener::into_incoming`](struct.tcplistener#method.into_incoming "TcpListener::into_incoming") method. See its documentation for more.
Trait Implementations
---------------------
[source](https://doc.rust-lang.org/src/std/net/tcp.rs.html#107)### impl Debug for IntoIncoming
[source](https://doc.rust-lang.org/src/std/net/tcp.rs.html#107)#### 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/net/tcp.rs.html#1017-1022)### impl Iterator for IntoIncoming
#### type Item = Result<TcpStream, Error>
The type of the elements being iterated over.
[source](https://doc.rust-lang.org/src/std/net/tcp.rs.html#1019-1021)#### fn next(&mut self) -> Option<Result<TcpStream>>
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)
[source](https://doc.rust-lang.org/src/std/net/tcp.rs.html#1025)### impl FusedIterator for IntoIncoming
Auto Trait Implementations
--------------------------
### impl RefUnwindSafe for IntoIncoming
### impl Send for IntoIncoming
### impl Sync for IntoIncoming
### impl Unpin for IntoIncoming
### impl UnwindSafe for IntoIncoming
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 Trait std::net::ToSocketAddrs Trait std::net::ToSocketAddrs
=============================
```
pub trait ToSocketAddrs {
type Iter: Iterator<Item = SocketAddr>;
fn to_socket_addrs(&self) -> Result<Self::Iter>;
}
```
A trait for objects which can be converted or resolved to one or more [`SocketAddr`](enum.socketaddr "SocketAddr") values.
This trait is used for generic address resolution when constructing network objects. By default it is implemented for the following types:
* [`SocketAddr`](enum.socketaddr "SocketAddr"): [`to_socket_addrs`](trait.tosocketaddrs#tymethod.to_socket_addrs) is the identity function.
* [`SocketAddrV4`](struct.socketaddrv4 "SocketAddrV4"), [`SocketAddrV6`](struct.socketaddrv6 "SocketAddrV6"), `([IpAddr](enum.ipaddr "IpAddr"), [u16](../primitive.u16 "u16"))`, `([Ipv4Addr](struct.ipv4addr "Ipv4Addr"), [u16](../primitive.u16 "u16"))`, `([Ipv6Addr](struct.ipv6addr "Ipv6Addr"), [u16](../primitive.u16 "u16"))`: [`to_socket_addrs`](trait.tosocketaddrs#tymethod.to_socket_addrs) constructs a [`SocketAddr`](enum.socketaddr "SocketAddr") trivially.
* `(&[str](../primitive.str "str"), [u16](../primitive.u16 "u16"))`: `&[str](../primitive.str "str")` should be either a string representation of an [`IpAddr`](enum.ipaddr "IpAddr") address as expected by [`FromStr`](../str/trait.fromstr "std::str::FromStr") implementation or a host name. [`u16`](../primitive.u16 "u16") is the port number.
* `&[str](../primitive.str "str")`: the string should be either a string representation of a [`SocketAddr`](enum.socketaddr "SocketAddr") as expected by its [`FromStr`](../str/trait.fromstr "std::str::FromStr") implementation or a string like `<host_name>:<port>` pair where `<port>` is a [`u16`](../primitive.u16 "u16") value.
This trait allows constructing network objects like [`TcpStream`](struct.tcpstream "net::TcpStream") or [`UdpSocket`](struct.udpsocket "net::UdpSocket") easily with values of various types for the bind/connection address. It is needed because sometimes one type is more appropriate than the other: for simple uses a string like `"localhost:12345"` is much nicer than manual construction of the corresponding [`SocketAddr`](enum.socketaddr "SocketAddr"), but sometimes [`SocketAddr`](enum.socketaddr "SocketAddr") value is *the* main source of the address, and converting it to some other type (e.g., a string) just for it to be converted back to [`SocketAddr`](enum.socketaddr "SocketAddr") in constructor methods is pointless.
Addresses returned by the operating system that are not IP addresses are silently ignored.
Examples
--------
Creating a [`SocketAddr`](enum.socketaddr "SocketAddr") iterator that yields one item:
```
use std::net::{ToSocketAddrs, SocketAddr};
let addr = SocketAddr::from(([127, 0, 0, 1], 443));
let mut addrs_iter = addr.to_socket_addrs().unwrap();
assert_eq!(Some(addr), addrs_iter.next());
assert!(addrs_iter.next().is_none());
```
Creating a [`SocketAddr`](enum.socketaddr "SocketAddr") iterator from a hostname:
```
use std::net::{SocketAddr, ToSocketAddrs};
// assuming 'localhost' resolves to 127.0.0.1
let mut addrs_iter = "localhost:443".to_socket_addrs().unwrap();
assert_eq!(addrs_iter.next(), Some(SocketAddr::from(([127, 0, 0, 1], 443))));
assert!(addrs_iter.next().is_none());
// assuming 'foo' does not resolve
assert!("foo:443".to_socket_addrs().is_err());
```
Creating a [`SocketAddr`](enum.socketaddr "SocketAddr") iterator that yields multiple items:
```
use std::net::{SocketAddr, ToSocketAddrs};
let addr1 = SocketAddr::from(([0, 0, 0, 0], 80));
let addr2 = SocketAddr::from(([127, 0, 0, 1], 443));
let addrs = vec![addr1, addr2];
let mut addrs_iter = (&addrs[..]).to_socket_addrs().unwrap();
assert_eq!(Some(addr1), addrs_iter.next());
assert_eq!(Some(addr2), addrs_iter.next());
assert!(addrs_iter.next().is_none());
```
Attempting to create a [`SocketAddr`](enum.socketaddr "SocketAddr") iterator from an improperly formatted socket address `&str` (missing the port):
```
use std::io;
use std::net::ToSocketAddrs;
let err = "127.0.0.1".to_socket_addrs().unwrap_err();
assert_eq!(err.kind(), io::ErrorKind::InvalidInput);
```
[`TcpStream::connect`](struct.tcpstream#method.connect) is an example of an function that utilizes `ToSocketAddrs` as a trait bound on its parameter in order to accept different types:
```
use std::net::{TcpStream, Ipv4Addr};
let stream = TcpStream::connect(("127.0.0.1", 443));
// or
let stream = TcpStream::connect("127.0.0.1:443");
// or
let stream = TcpStream::connect((Ipv4Addr::new(127, 0, 0, 1), 443));
```
Required Associated Types
-------------------------
[source](https://doc.rust-lang.org/src/std/net/socket_addr.rs.html#831)#### type Iter: Iterator<Item = SocketAddr>
Returned iterator over socket addresses which this type may correspond to.
Required Methods
----------------
[source](https://doc.rust-lang.org/src/std/net/socket_addr.rs.html#841)#### fn to\_socket\_addrs(&self) -> Result<Self::Iter>
Converts this object to an iterator of resolved [`SocketAddr`](enum.socketaddr "SocketAddr")s.
The returned iterator might not actually yield any values depending on the outcome of any resolution performed.
Note that this function may block the current thread while resolution is performed.
Implementors
------------
[source](https://doc.rust-lang.org/src/std/net/socket_addr.rs.html#910-927)### impl ToSocketAddrs for (&str, u16)
#### type Iter = IntoIter<SocketAddr, Global>
[source](https://doc.rust-lang.org/src/std/net/socket_addr.rs.html#869-878)### impl ToSocketAddrs for (IpAddr, u16)
#### type Iter = IntoIter<SocketAddr>
[source](https://doc.rust-lang.org/src/std/net/socket_addr.rs.html#930-935)1.46.0 · ### impl ToSocketAddrs for (String, u16)
#### type Iter = IntoIter<SocketAddr, Global>
[source](https://doc.rust-lang.org/src/std/net/socket_addr.rs.html#881-887)### impl ToSocketAddrs for (Ipv4Addr, u16)
#### type Iter = IntoIter<SocketAddr>
[source](https://doc.rust-lang.org/src/std/net/socket_addr.rs.html#890-896)### impl ToSocketAddrs for (Ipv6Addr, u16)
#### type Iter = IntoIter<SocketAddr>
[source](https://doc.rust-lang.org/src/std/net/socket_addr.rs.html#845-850)### impl ToSocketAddrs for SocketAddr
#### type Iter = IntoIter<SocketAddr>
[source](https://doc.rust-lang.org/src/std/net/socket_addr.rs.html#939-949)### impl ToSocketAddrs for str
#### type Iter = IntoIter<SocketAddr, Global>
[source](https://doc.rust-lang.org/src/std/net/socket_addr.rs.html#969-974)1.16.0 · ### impl ToSocketAddrs for String
#### type Iter = IntoIter<SocketAddr, Global>
[source](https://doc.rust-lang.org/src/std/net/socket_addr.rs.html#853-858)### impl ToSocketAddrs for SocketAddrV4
#### type Iter = IntoIter<SocketAddr>
[source](https://doc.rust-lang.org/src/std/net/socket_addr.rs.html#861-866)### impl ToSocketAddrs for SocketAddrV6
#### type Iter = IntoIter<SocketAddr>
[source](https://doc.rust-lang.org/src/std/net/socket_addr.rs.html#952-958)1.8.0 · ### impl<'a> ToSocketAddrs for &'a [SocketAddr]
#### type Iter = Cloned<Iter<'a, SocketAddr>>
[source](https://doc.rust-lang.org/src/std/net/socket_addr.rs.html#961-966)### impl<T: ToSocketAddrs + ?Sized> ToSocketAddrs for &T
#### type Iter = <T as ToSocketAddrs>::Iter
rust Struct std::net::SocketAddrV4 Struct std::net::SocketAddrV4
=============================
```
pub struct SocketAddrV4 { /* private fields */ }
```
An IPv4 socket address.
IPv4 socket addresses consist of an [`IPv4` address](struct.ipv4addr) and a 16-bit port number, as stated in [IETF RFC 793](https://tools.ietf.org/html/rfc793).
See [`SocketAddr`](enum.socketaddr "SocketAddr") for a type encompassing both IPv4 and IPv6 socket addresses.
The size of a `SocketAddrV4` struct may vary depending on the target operating system. Do not assume that this type has the same memory layout as the underlying system representation.
Examples
--------
```
use std::net::{Ipv4Addr, SocketAddrV4};
let socket = SocketAddrV4::new(Ipv4Addr::new(127, 0, 0, 1), 8080);
assert_eq!("127.0.0.1:8080".parse(), Ok(socket));
assert_eq!(socket.ip(), &Ipv4Addr::new(127, 0, 0, 1));
assert_eq!(socket.port(), 8080);
```
Implementations
---------------
[source](https://doc.rust-lang.org/src/std/net/parser.rs.html#361-377)### impl SocketAddrV4
[source](https://doc.rust-lang.org/src/std/net/parser.rs.html#374-376)#### pub fn parse\_ascii(b: &[u8]) -> Result<Self, AddrParseError>
🔬This is a nightly-only experimental API. (`addr_parse_ascii` [#101035](https://github.com/rust-lang/rust/issues/101035))
Parse an IPv4 socket address from a slice of bytes.
```
#![feature(addr_parse_ascii)]
use std::net::{Ipv4Addr, SocketAddrV4};
let socket = SocketAddrV4::new(Ipv4Addr::new(127, 0, 0, 1), 8080);
assert_eq!(SocketAddrV4::parse_ascii(b"127.0.0.1:8080"), Ok(socket));
```
[source](https://doc.rust-lang.org/src/std/net/socket_addr.rs.html#269-353)### impl SocketAddrV4
[source](https://doc.rust-lang.org/src/std/net/socket_addr.rs.html#284-286)const: [unstable](https://github.com/rust-lang/rust/issues/82485 "Tracking issue for const_socketaddr") · #### pub fn new(ip: Ipv4Addr, port: u16) -> SocketAddrV4
Creates a new socket address from an [`IPv4` address](struct.ipv4addr) and a port number.
##### Examples
```
use std::net::{SocketAddrV4, Ipv4Addr};
let socket = SocketAddrV4::new(Ipv4Addr::new(127, 0, 0, 1), 8080);
```
[source](https://doc.rust-lang.org/src/std/net/socket_addr.rs.html#301-303)const: [unstable](https://github.com/rust-lang/rust/issues/82485 "Tracking issue for const_socketaddr") · #### pub fn ip(&self) -> &Ipv4Addr
Returns the IP address associated with this socket address.
##### Examples
```
use std::net::{SocketAddrV4, Ipv4Addr};
let socket = SocketAddrV4::new(Ipv4Addr::new(127, 0, 0, 1), 8080);
assert_eq!(socket.ip(), &Ipv4Addr::new(127, 0, 0, 1));
```
[source](https://doc.rust-lang.org/src/std/net/socket_addr.rs.html#317-319)1.9.0 · #### pub fn set\_ip(&mut self, new\_ip: Ipv4Addr)
Changes the IP address associated with this socket address.
##### Examples
```
use std::net::{SocketAddrV4, Ipv4Addr};
let mut socket = SocketAddrV4::new(Ipv4Addr::new(127, 0, 0, 1), 8080);
socket.set_ip(Ipv4Addr::new(192, 168, 0, 1));
assert_eq!(socket.ip(), &Ipv4Addr::new(192, 168, 0, 1));
```
[source](https://doc.rust-lang.org/src/std/net/socket_addr.rs.html#334-336)const: [unstable](https://github.com/rust-lang/rust/issues/82485 "Tracking issue for const_socketaddr") · #### pub fn port(&self) -> u16
Returns the port number associated with this socket address.
##### Examples
```
use std::net::{SocketAddrV4, Ipv4Addr};
let socket = SocketAddrV4::new(Ipv4Addr::new(127, 0, 0, 1), 8080);
assert_eq!(socket.port(), 8080);
```
[source](https://doc.rust-lang.org/src/std/net/socket_addr.rs.html#350-352)1.9.0 · #### pub fn set\_port(&mut self, new\_port: u16)
Changes the port number associated with this socket address.
##### Examples
```
use std::net::{SocketAddrV4, Ipv4Addr};
let mut socket = SocketAddrV4::new(Ipv4Addr::new(127, 0, 0, 1), 8080);
socket.set_port(4242);
assert_eq!(socket.port(), 4242);
```
Trait Implementations
---------------------
[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#78)#### fn clone(&self) -> SocketAddrV4
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/net/socket_addr.rs.html#638-642)### impl Debug for SocketAddrV4
[source](https://doc.rust-lang.org/src/std/net/socket_addr.rs.html#639-641)#### 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/net/socket_addr.rs.html#619-635)### impl Display for SocketAddrV4
[source](https://doc.rust-lang.org/src/std/net/socket_addr.rs.html#620-634)#### 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/net/socket_addr.rs.html#573-578)1.16.0 · ### impl From<SocketAddrV4> for SocketAddr
[source](https://doc.rust-lang.org/src/std/net/socket_addr.rs.html#575-577)#### fn from(sock4: SocketAddrV4) -> SocketAddr
Converts a [`SocketAddrV4`](struct.socketaddrv4 "SocketAddrV4") into a [`SocketAddr::V4`](enum.socketaddr#variant.V4 "SocketAddr::V4").
[source](https://doc.rust-lang.org/src/std/net/parser.rs.html#380-385)1.5.0 · ### impl FromStr for SocketAddrV4
#### type Err = AddrParseError
The associated error which can be returned from parsing.
[source](https://doc.rust-lang.org/src/std/net/parser.rs.html#382-384)#### fn from\_str(s: &str) -> Result<SocketAddrV4, AddrParseError>
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/net/socket_addr.rs.html#707-711)### impl Hash for SocketAddrV4
[source](https://doc.rust-lang.org/src/std/net/socket_addr.rs.html#708-710)#### fn hash<H: Hasher>(&self, s: &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/net/socket_addr.rs.html#693-697)1.45.0 · ### impl Ord for SocketAddrV4
[source](https://doc.rust-lang.org/src/std/net/socket_addr.rs.html#694-696)#### fn cmp(&self, other: &SocketAddrV4) -> 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/net/socket_addr.rs.html#78)### impl PartialEq<SocketAddrV4> for SocketAddrV4
[source](https://doc.rust-lang.org/src/std/net/socket_addr.rs.html#78)#### fn eq(&self, other: &SocketAddrV4) -> 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/net/socket_addr.rs.html#679-683)1.45.0 · ### impl PartialOrd<SocketAddrV4> for SocketAddrV4
[source](https://doc.rust-lang.org/src/std/net/socket_addr.rs.html#680-682)#### fn partial\_cmp(&self, other: &SocketAddrV4) -> 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/net/socket_addr.rs.html#853-858)### impl ToSocketAddrs for SocketAddrV4
#### type Iter = IntoIter<SocketAddr>
Returned iterator over socket addresses which this type may correspond to. [Read more](trait.tosocketaddrs#associatedtype.Iter)
[source](https://doc.rust-lang.org/src/std/net/socket_addr.rs.html#855-857)#### fn to\_socket\_addrs(&self) -> Result<IntoIter<SocketAddr>>
Converts this object to an iterator of resolved [`SocketAddr`](enum.socketaddr "SocketAddr")s. [Read more](trait.tosocketaddrs#tymethod.to_socket_addrs)
[source](https://doc.rust-lang.org/src/std/net/socket_addr.rs.html#78)### impl Copy for SocketAddrV4
[source](https://doc.rust-lang.org/src/std/net/socket_addr.rs.html#78)### impl Eq for SocketAddrV4
[source](https://doc.rust-lang.org/src/std/net/socket_addr.rs.html#78)### impl StructuralEq for SocketAddrV4
[source](https://doc.rust-lang.org/src/std/net/socket_addr.rs.html#78)### impl StructuralPartialEq for SocketAddrV4
Auto Trait Implementations
--------------------------
### impl RefUnwindSafe for SocketAddrV4
### impl Send for SocketAddrV4
### impl Sync for SocketAddrV4
### impl Unpin for SocketAddrV4
### impl UnwindSafe for SocketAddrV4
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::net::IpAddr Enum std::net::IpAddr
=====================
```
pub enum IpAddr {
V4(Ipv4Addr),
V6(Ipv6Addr),
}
```
An IP address, either IPv4 or IPv6.
This enum can contain either an [`Ipv4Addr`](struct.ipv4addr "Ipv4Addr") or an [`Ipv6Addr`](struct.ipv6addr "Ipv6Addr"), see their respective documentation for more details.
Examples
--------
```
use std::net::{IpAddr, Ipv4Addr, Ipv6Addr};
let localhost_v4 = IpAddr::V4(Ipv4Addr::new(127, 0, 0, 1));
let localhost_v6 = IpAddr::V6(Ipv6Addr::new(0, 0, 0, 0, 0, 0, 0, 1));
assert_eq!("127.0.0.1".parse(), Ok(localhost_v4));
assert_eq!("::1".parse(), Ok(localhost_v6));
assert_eq!(localhost_v4.is_ipv6(), false);
assert_eq!(localhost_v4.is_ipv4(), true);
```
Variants
--------
### `V4([Ipv4Addr](struct.ipv4addr "struct std::net::Ipv4Addr"))`
An IPv4 address.
### `V6([Ipv6Addr](struct.ipv6addr "struct std::net::Ipv6Addr"))`
An IPv6 address.
Implementations
---------------
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#220-439)### impl IpAddr
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#238-243)1.12.0 (const: 1.50.0) · #### pub const fn is\_unspecified(&self) -> bool
Returns [`true`](../primitive.bool "true") for the special ‘unspecified’ address.
See the documentation for [`Ipv4Addr::is_unspecified()`](struct.ipv4addr#method.is_unspecified "Ipv4Addr::is_unspecified()") and [`Ipv6Addr::is_unspecified()`](struct.ipv6addr#method.is_unspecified "Ipv6Addr::is_unspecified()") for more details.
##### Examples
```
use std::net::{IpAddr, Ipv4Addr, Ipv6Addr};
assert_eq!(IpAddr::V4(Ipv4Addr::new(0, 0, 0, 0)).is_unspecified(), true);
assert_eq!(IpAddr::V6(Ipv6Addr::new(0, 0, 0, 0, 0, 0, 0, 0)).is_unspecified(), true);
```
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#262-267)1.12.0 (const: 1.50.0) · #### pub const fn is\_loopback(&self) -> bool
Returns [`true`](../primitive.bool "true") if this is a loopback address.
See the documentation for [`Ipv4Addr::is_loopback()`](struct.ipv4addr#method.is_loopback "Ipv4Addr::is_loopback()") and [`Ipv6Addr::is_loopback()`](struct.ipv6addr#method.is_loopback "Ipv6Addr::is_loopback()") for more details.
##### Examples
```
use std::net::{IpAddr, Ipv4Addr, Ipv6Addr};
assert_eq!(IpAddr::V4(Ipv4Addr::new(127, 0, 0, 1)).is_loopback(), true);
assert_eq!(IpAddr::V6(Ipv6Addr::new(0, 0, 0, 0, 0, 0, 0, 0x1)).is_loopback(), true);
```
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#288-293)const: [unstable](https://github.com/rust-lang/rust/issues/76205 "Tracking issue for const_ip") · #### pub fn is\_global(&self) -> bool
🔬This is a nightly-only experimental API. (`ip` [#27709](https://github.com/rust-lang/rust/issues/27709))
Returns [`true`](../primitive.bool "true") if the address appears to be globally routable.
See the documentation for [`Ipv4Addr::is_global()`](struct.ipv4addr#method.is_global "Ipv4Addr::is_global()") and [`Ipv6Addr::is_global()`](struct.ipv6addr#method.is_global "Ipv6Addr::is_global()") for more details.
##### Examples
```
#![feature(ip)]
use std::net::{IpAddr, Ipv4Addr, Ipv6Addr};
assert_eq!(IpAddr::V4(Ipv4Addr::new(80, 9, 12, 3)).is_global(), true);
assert_eq!(IpAddr::V6(Ipv6Addr::new(0, 0, 0x1c9, 0, 0, 0xafc8, 0, 0x1)).is_global(), true);
```
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#312-317)1.12.0 (const: 1.50.0) · #### pub const fn is\_multicast(&self) -> bool
Returns [`true`](../primitive.bool "true") if this is a multicast address.
See the documentation for [`Ipv4Addr::is_multicast()`](struct.ipv4addr#method.is_multicast "Ipv4Addr::is_multicast()") and [`Ipv6Addr::is_multicast()`](struct.ipv6addr#method.is_multicast "Ipv6Addr::is_multicast()") for more details.
##### Examples
```
use std::net::{IpAddr, Ipv4Addr, Ipv6Addr};
assert_eq!(IpAddr::V4(Ipv4Addr::new(224, 254, 0, 0)).is_multicast(), true);
assert_eq!(IpAddr::V6(Ipv6Addr::new(0xff00, 0, 0, 0, 0, 0, 0, 0)).is_multicast(), true);
```
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#341-346)const: [unstable](https://github.com/rust-lang/rust/issues/76205 "Tracking issue for const_ip") · #### pub fn is\_documentation(&self) -> bool
🔬This is a nightly-only experimental API. (`ip` [#27709](https://github.com/rust-lang/rust/issues/27709))
Returns [`true`](../primitive.bool "true") if this address is in a range designated for documentation.
See the documentation for [`Ipv4Addr::is_documentation()`](struct.ipv4addr#method.is_documentation "Ipv4Addr::is_documentation()") and [`Ipv6Addr::is_documentation()`](struct.ipv6addr#method.is_documentation "Ipv6Addr::is_documentation()") for more details.
##### Examples
```
#![feature(ip)]
use std::net::{IpAddr, Ipv4Addr, Ipv6Addr};
assert_eq!(IpAddr::V4(Ipv4Addr::new(203, 0, 113, 6)).is_documentation(), true);
assert_eq!(
IpAddr::V6(Ipv6Addr::new(0x2001, 0xdb8, 0, 0, 0, 0, 0, 0)).is_documentation(),
true
);
```
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#366-371)#### pub const fn is\_benchmarking(&self) -> bool
🔬This is a nightly-only experimental API. (`ip` [#27709](https://github.com/rust-lang/rust/issues/27709))
Returns [`true`](../primitive.bool "true") if this address is in a range designated for benchmarking.
See the documentation for [`Ipv4Addr::is_benchmarking()`](struct.ipv4addr#method.is_benchmarking "Ipv4Addr::is_benchmarking()") and [`Ipv6Addr::is_benchmarking()`](struct.ipv6addr#method.is_benchmarking "Ipv6Addr::is_benchmarking()") for more details.
##### Examples
```
#![feature(ip)]
use std::net::{IpAddr, Ipv4Addr, Ipv6Addr};
assert_eq!(IpAddr::V4(Ipv4Addr::new(198, 19, 255, 255)).is_benchmarking(), true);
assert_eq!(IpAddr::V6(Ipv6Addr::new(0x2001, 0x2, 0, 0, 0, 0, 0, 0)).is_benchmarking(), true);
```
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#390-392)1.16.0 (const: 1.50.0) · #### pub const fn is\_ipv4(&self) -> bool
Returns [`true`](../primitive.bool "true") if this address is an [`IPv4` address](enum.ipaddr#variant.V4), and [`false`](../primitive.bool "false") otherwise.
##### Examples
```
use std::net::{IpAddr, Ipv4Addr, Ipv6Addr};
assert_eq!(IpAddr::V4(Ipv4Addr::new(203, 0, 113, 6)).is_ipv4(), true);
assert_eq!(IpAddr::V6(Ipv6Addr::new(0x2001, 0xdb8, 0, 0, 0, 0, 0, 0)).is_ipv4(), false);
```
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#411-413)1.16.0 (const: 1.50.0) · #### pub const fn is\_ipv6(&self) -> bool
Returns [`true`](../primitive.bool "true") if this address is an [`IPv6` address](enum.ipaddr#variant.V6), and [`false`](../primitive.bool "false") otherwise.
##### Examples
```
use std::net::{IpAddr, Ipv4Addr, Ipv6Addr};
assert_eq!(IpAddr::V4(Ipv4Addr::new(203, 0, 113, 6)).is_ipv6(), false);
assert_eq!(IpAddr::V6(Ipv6Addr::new(0x2001, 0xdb8, 0, 0, 0, 0, 0, 0)).is_ipv6(), true);
```
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#433-438)const: [unstable](https://github.com/rust-lang/rust/issues/76205 "Tracking issue for const_ip") · #### pub fn to\_canonical(&self) -> IpAddr
🔬This is a nightly-only experimental API. (`ip` [#27709](https://github.com/rust-lang/rust/issues/27709))
Converts this address to an `IpAddr::V4` if it is an IPv4-mapped IPv6 addresses, otherwise it return `self` as-is.
##### Examples
```
#![feature(ip)]
use std::net::{IpAddr, Ipv4Addr, Ipv6Addr};
assert_eq!(IpAddr::V4(Ipv4Addr::new(127, 0, 0, 1)).to_canonical().is_loopback(), true);
assert_eq!(IpAddr::V6(Ipv6Addr::new(0, 0, 0, 0, 0, 0xffff, 0x7f00, 0x1)).is_loopback(), false);
assert_eq!(IpAddr::V6(Ipv6Addr::new(0, 0, 0, 0, 0, 0xffff, 0x7f00, 0x1)).to_canonical().is_loopback(), true);
```
[source](https://doc.rust-lang.org/src/std/net/parser.rs.html#276-294)### impl IpAddr
[source](https://doc.rust-lang.org/src/std/net/parser.rs.html#291-293)#### pub fn parse\_ascii(b: &[u8]) -> Result<Self, AddrParseError>
🔬This is a nightly-only experimental API. (`addr_parse_ascii` [#101035](https://github.com/rust-lang/rust/issues/101035))
Parse an IP address from a slice of bytes.
```
#![feature(addr_parse_ascii)]
use std::net::{IpAddr, Ipv4Addr, Ipv6Addr};
let localhost_v4 = IpAddr::V4(Ipv4Addr::new(127, 0, 0, 1));
let localhost_v6 = IpAddr::V6(Ipv6Addr::new(0, 0, 0, 0, 0, 0, 0, 1));
assert_eq!(IpAddr::parse_ascii(b"127.0.0.1"), Ok(localhost_v4));
assert_eq!(IpAddr::parse_ascii(b"::1"), Ok(localhost_v6));
```
Trait Implementations
---------------------
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#34)### impl Clone for IpAddr
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#34)#### fn clone(&self) -> IpAddr
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/net/ip_addr.rs.html#940-944)### impl Debug for IpAddr
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#941-943)#### 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/net/ip_addr.rs.html#930-937)### impl Display for IpAddr
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#931-936)#### fn fmt(&self, fmt: &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/net/ip_addr.rs.html#2069-2095)1.17.0 · ### impl From<[u16; 8]> for IpAddr
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#2092-2094)#### fn from(segments: [u16; 8]) -> IpAddr
Creates an `IpAddr::V6` from an eight element 16-bit array.
##### Examples
```
use std::net::{IpAddr, Ipv6Addr};
let addr = IpAddr::from([
525u16, 524u16, 523u16, 522u16,
521u16, 520u16, 519u16, 518u16,
]);
assert_eq!(
IpAddr::V6(Ipv6Addr::new(
0x20d, 0x20c,
0x20b, 0x20a,
0x209, 0x208,
0x207, 0x206
)),
addr
);
```
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#2040-2066)1.17.0 · ### impl From<[u8; 16]> for IpAddr
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#2063-2065)#### fn from(octets: [u8; 16]) -> IpAddr
Creates an `IpAddr::V6` from a sixteen element byte array.
##### Examples
```
use std::net::{IpAddr, Ipv6Addr};
let addr = IpAddr::from([
25u8, 24u8, 23u8, 22u8, 21u8, 20u8, 19u8, 18u8,
17u8, 16u8, 15u8, 14u8, 13u8, 12u8, 11u8, 10u8,
]);
assert_eq!(
IpAddr::V6(Ipv6Addr::new(
0x1918, 0x1716,
0x1514, 0x1312,
0x1110, 0x0f0e,
0x0d0c, 0x0b0a
)),
addr
);
```
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#1147-1162)1.17.0 · ### impl From<[u8; 4]> for IpAddr
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#1159-1161)#### fn from(octets: [u8; 4]) -> IpAddr
Creates an `IpAddr::V4` from a four element byte array.
##### Examples
```
use std::net::{IpAddr, Ipv4Addr};
let addr = IpAddr::from([13u8, 12u8, 11u8, 10u8]);
assert_eq!(IpAddr::V4(Ipv4Addr::new(13, 12, 11, 10)), addr);
```
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#947-966)1.16.0 · ### impl From<Ipv4Addr> for IpAddr
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#963-965)#### fn from(ipv4: Ipv4Addr) -> IpAddr
Copies this address to a new `IpAddr::V4`.
##### Examples
```
use std::net::{IpAddr, Ipv4Addr};
let addr = Ipv4Addr::new(127, 0, 0, 1);
assert_eq!(
IpAddr::V4(addr),
IpAddr::from(addr)
)
```
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#969-988)1.16.0 · ### impl From<Ipv6Addr> for IpAddr
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#985-987)#### fn from(ipv6: Ipv6Addr) -> IpAddr
Copies this address to a new `IpAddr::V6`.
##### Examples
```
use std::net::{IpAddr, Ipv6Addr};
let addr = Ipv6Addr::new(0, 0, 0, 0, 0, 0xffff, 0xc00a, 0x2ff);
assert_eq!(
IpAddr::V6(addr),
IpAddr::from(addr)
);
```
[source](https://doc.rust-lang.org/src/std/net/parser.rs.html#297-302)### impl FromStr for IpAddr
#### type Err = AddrParseError
The associated error which can be returned from parsing.
[source](https://doc.rust-lang.org/src/std/net/parser.rs.html#299-301)#### fn from\_str(s: &str) -> Result<IpAddr, AddrParseError>
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/net/ip_addr.rs.html#34)### impl Hash for IpAddr
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#34)#### 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/net/ip_addr.rs.html#34)### impl Ord for IpAddr
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#34)#### fn cmp(&self, other: &IpAddr) -> 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/net/ip_addr.rs.html#34)### impl PartialEq<IpAddr> for IpAddr
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#34)#### fn eq(&self, other: &IpAddr) -> 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/net/ip_addr.rs.html#1030-1038)1.16.0 · ### impl PartialEq<IpAddr> for Ipv4Addr
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#1032-1037)#### fn eq(&self, other: &IpAddr) -> 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/net/ip_addr.rs.html#1866-1874)1.16.0 · ### impl PartialEq<IpAddr> for Ipv6Addr
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#1868-1873)#### fn eq(&self, other: &IpAddr) -> 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/net/ip_addr.rs.html#1019-1027)1.16.0 · ### impl PartialEq<Ipv4Addr> for IpAddr
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#1021-1026)#### fn eq(&self, other: &Ipv4Addr) -> 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/net/ip_addr.rs.html#1877-1885)1.16.0 · ### impl PartialEq<Ipv6Addr> for IpAddr
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#1879-1884)#### fn eq(&self, other: &Ipv6Addr) -> 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/net/ip_addr.rs.html#34)### impl PartialOrd<IpAddr> for IpAddr
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#34)#### fn partial\_cmp(&self, other: &IpAddr) -> 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/net/ip_addr.rs.html#1060-1068)1.16.0 · ### impl PartialOrd<IpAddr> for Ipv4Addr
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#1062-1067)#### fn partial\_cmp(&self, other: &IpAddr) -> 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/net/ip_addr.rs.html#1907-1915)1.16.0 · ### impl PartialOrd<IpAddr> for Ipv6Addr
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#1909-1914)#### fn partial\_cmp(&self, other: &IpAddr) -> 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/net/ip_addr.rs.html#1049-1057)1.16.0 · ### impl PartialOrd<Ipv4Addr> for IpAddr
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#1051-1056)#### fn partial\_cmp(&self, other: &Ipv4Addr) -> 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/net/ip_addr.rs.html#1896-1904)1.16.0 · ### impl PartialOrd<Ipv6Addr> for IpAddr
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#1898-1903)#### fn partial\_cmp(&self, other: &Ipv6Addr) -> 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/net/ip_addr.rs.html#34)### impl Copy for IpAddr
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#34)### impl Eq for IpAddr
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#34)### impl StructuralEq for IpAddr
[source](https://doc.rust-lang.org/src/std/net/ip_addr.rs.html#34)### impl StructuralPartialEq for IpAddr
Auto Trait Implementations
--------------------------
### impl RefUnwindSafe for IpAddr
### impl Send for IpAddr
### impl Sync for IpAddr
### impl Unpin for IpAddr
### impl UnwindSafe for IpAddr
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 Trait std::iter::Extend Trait std::iter::Extend
=======================
```
pub trait Extend<A> {
fn extend<T>(&mut self, iter: T) where T: IntoIterator<Item = A>;
fn extend_one(&mut self, item: A) { ... }
fn extend_reserve(&mut self, additional: usize) { ... }
}
```
Extend a collection with the contents of an iterator.
Iterators produce a series of values, and collections can also be thought of as a series of values. The `Extend` trait bridges this gap, allowing you to extend a collection by including the contents of that iterator. When extending a collection with an already existing key, that entry is updated or, in the case of collections that permit multiple entries with equal keys, that entry is inserted.
Examples
--------
Basic usage:
```
// You can extend a String with some chars:
let mut message = String::from("The first three letters are: ");
message.extend(&['a', 'b', 'c']);
assert_eq!("abc", &message[29..32]);
```
Implementing `Extend`:
```
// A sample collection, that's just a wrapper over Vec<T>
#[derive(Debug)]
struct MyCollection(Vec<i32>);
// Let's give it some methods so we can create one and add things
// to it.
impl MyCollection {
fn new() -> MyCollection {
MyCollection(Vec::new())
}
fn add(&mut self, elem: i32) {
self.0.push(elem);
}
}
// since MyCollection has a list of i32s, we implement Extend for i32
impl Extend<i32> for MyCollection {
// This is a bit simpler with the concrete type signature: we can call
// extend on anything which can be turned into an Iterator which gives
// us i32s. Because we need i32s to put into MyCollection.
fn extend<T: IntoIterator<Item=i32>>(&mut self, iter: T) {
// The implementation is very straightforward: loop through the
// iterator, and add() each element to ourselves.
for elem in iter {
self.add(elem);
}
}
}
let mut c = MyCollection::new();
c.add(5);
c.add(6);
c.add(7);
// let's extend our collection with three more numbers
c.extend(vec![1, 2, 3]);
// we've added these elements onto the end
assert_eq!("MyCollection([5, 6, 7, 1, 2, 3])", format!("{c:?}"));
```
Required Methods
----------------
[source](https://doc.rust-lang.org/src/core/iter/traits/collect.rs.html#367)#### fn extend<T>(&mut self, iter: T)where T: [IntoIterator](trait.intoiterator "trait std::iter::IntoIterator")<Item = A>,
Extends a collection with the contents of an iterator.
As this is the only required method for this trait, the [trait-level](trait.extend) docs contain more details.
##### Examples
Basic usage:
```
// You can extend a String with some chars:
let mut message = String::from("abc");
message.extend(['d', 'e', 'f'].iter());
assert_eq!("abcdef", &message);
```
Provided Methods
----------------
[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.
The default implementation does nothing.
Implementors
------------
[source](https://doc.rust-lang.org/src/alloc/string.rs.html#2055)### impl Extend<char> for String
[source](https://doc.rust-lang.org/src/core/iter/traits/collect.rs.html#385)1.28.0 · ### impl Extend<()> for ()
[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/std/ffi/os_str.rs.html#1366-1373)1.52.0 · ### impl Extend<OsString> for OsString
[source](https://doc.rust-lang.org/src/alloc/string.rs.html#2115)1.4.0 · ### impl Extend<String> for String
[source](https://doc.rust-lang.org/src/alloc/string.rs.html#2076)1.2.0 · ### impl<'a> Extend<&'a char> for String
[source](https://doc.rust-lang.org/src/alloc/string.rs.html#2094)### impl<'a> Extend<&'a str> for String
[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/alloc/string.rs.html#2128)1.19.0 · ### impl<'a> Extend<Cow<'a, str>> for String
[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/alloc/collections/btree/map.rs.html#2140-2141)1.2.0 · ### impl<'a, K, V, A> Extend<(&'a K, &'a V)> for BTreeMap<K, V, A>where K: [Ord](../cmp/trait.ord "trait std::cmp::Ord") + [Copy](../marker/trait.copy "trait std::marker::Copy"), V: [Copy](../marker/trait.copy "trait std::marker::Copy"), A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator") + [Clone](../clone/trait.clone "trait std::clone::Clone"),
[source](https://doc.rust-lang.org/src/std/collections/hash/map.rs.html#3053-3073)1.4.0 · ### impl<'a, K, V, S> Extend<(&'a K, &'a V)> for HashMap<K, V, S>where K: [Eq](../cmp/trait.eq "trait std::cmp::Eq") + [Hash](../hash/trait.hash "trait std::hash::Hash") + [Copy](../marker/trait.copy "trait std::marker::Copy"), V: [Copy](../marker/trait.copy "trait std::marker::Copy"), S: [BuildHasher](../hash/trait.buildhasher "trait std::hash::BuildHasher"),
[source](https://doc.rust-lang.org/src/alloc/collections/binary_heap.rs.html#1707)1.2.0 · ### impl<'a, T> Extend<&'a T> for BinaryHeap<T>where T: 'a + [Ord](../cmp/trait.ord "trait std::cmp::Ord") + [Copy](../marker/trait.copy "trait std::marker::Copy"),
[source](https://doc.rust-lang.org/src/alloc/collections/linked_list.rs.html#1877)1.2.0 · ### impl<'a, T> Extend<&'a T> for LinkedList<T>where T: 'a + [Copy](../marker/trait.copy "trait std::marker::Copy"),
[source](https://doc.rust-lang.org/src/alloc/collections/btree/set.rs.html#1359)1.2.0 · ### impl<'a, T, A> Extend<&'a T> for BTreeSet<T, A>where T: 'a + [Ord](../cmp/trait.ord "trait std::cmp::Ord") + [Copy](../marker/trait.copy "trait std::marker::Copy"), 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/vec_deque/mod.rs.html#3006)1.2.0 · ### impl<'a, T, A> Extend<&'a T> for VecDeque<T, A>where T: 'a + [Copy](../marker/trait.copy "trait std::marker::Copy"), A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"),
[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/std/collections/hash/set.rs.html#1089-1108)1.4.0 · ### impl<'a, T, S> Extend<&'a T> for HashSet<T, S>where T: 'a + [Eq](../cmp/trait.eq "trait std::cmp::Eq") + [Hash](../hash/trait.hash "trait std::hash::Hash") + [Copy](../marker/trait.copy "trait std::marker::Copy"), S: [BuildHasher](../hash/trait.buildhasher "trait std::hash::BuildHasher"),
[source](https://doc.rust-lang.org/src/core/iter/traits/collect.rs.html#393)1.56.0 · ### impl<A, B, ExtendA, ExtendB> Extend<(A, B)> for (ExtendA, ExtendB)where ExtendA: [Extend](trait.extend "trait std::iter::Extend")<A>, ExtendB: [Extend](trait.extend "trait std::iter::Extend")<B>,
[source](https://doc.rust-lang.org/src/alloc/collections/btree/map.rs.html#2125)### impl<K, V, A> Extend<(K, V)> for BTreeMap<K, V, A>where K: [Ord](../cmp/trait.ord "trait std::cmp::Ord"), A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator") + [Clone](../clone/trait.clone "trait std::clone::Clone"),
[source](https://doc.rust-lang.org/src/std/collections/hash/map.rs.html#3031-3050)### impl<K, V, S> Extend<(K, V)> for HashMap<K, V, S>where K: [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"),
Inserts all new key-values from the iterator and replaces values with existing keys with new values returned from the iterator.
[source](https://doc.rust-lang.org/src/std/path.rs.html#1700-1709)### impl<P: AsRef<Path>> Extend<P> for PathBuf
[source](https://doc.rust-lang.org/src/alloc/collections/binary_heap.rs.html#1658)### impl<T> Extend<T> 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#1853)### impl<T> Extend<T> for LinkedList<T>
[source](https://doc.rust-lang.org/src/alloc/collections/btree/set.rs.html#1344)### impl<T, A> Extend<T> for BTreeSet<T, A>where T: [Ord](../cmp/trait.ord "trait std::cmp::Ord"), 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/vec_deque/mod.rs.html#2989)### impl<T, A> Extend<T> for VecDeque<T, A>where A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"),
[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/std/collections/hash/set.rs.html#1067-1086)### impl<T, S> Extend<T> for HashSet<T, S>where T: [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"),
rust Function std::iter::zip Function std::iter::zip
=======================
```
pub fn zip<A, B>( a: A, b: B) -> Zip<<A as IntoIterator>::IntoIter, <B as IntoIterator>::IntoIter>ⓘNotable traits for 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);where A: IntoIterator, B: IntoIterator,
```
Converts the arguments to iterators and zips them.
See the documentation of [`Iterator::zip`](trait.iterator#method.zip "Iterator::zip") for more.
Examples
--------
```
use std::iter::zip;
let xs = [1, 2, 3];
let ys = [4, 5, 6];
let mut iter = zip(xs, ys);
assert_eq!(iter.next().unwrap(), (1, 4));
assert_eq!(iter.next().unwrap(), (2, 5));
assert_eq!(iter.next().unwrap(), (3, 6));
assert!(iter.next().is_none());
// Nested zips are also possible:
let zs = [7, 8, 9];
let mut iter = zip(zip(xs, ys), zs);
assert_eq!(iter.next().unwrap(), ((1, 4), 7));
assert_eq!(iter.next().unwrap(), ((2, 5), 8));
assert_eq!(iter.next().unwrap(), ((3, 6), 9));
assert!(iter.next().is_none());
```
rust Function std::iter::repeat_with Function std::iter::repeat\_with
================================
```
pub fn repeat_with<A, F>(repeater: F) -> RepeatWith<F>ⓘNotable traits for RepeatWith<F>impl<A, F> Iterator for RepeatWith<F>where F: FnMut() -> A, type Item = A;where F: FnMut() -> A,
```
Creates a new iterator that repeats elements of type `A` endlessly by applying the provided closure, the repeater, `F: FnMut() -> A`.
The `repeat_with()` function calls the repeater over and over again.
Infinite iterators like `repeat_with()` are often used with adapters like [`Iterator::take()`](trait.iterator#method.take "Iterator::take()"), in order to make them finite.
If the element type of the iterator you need implements [`Clone`](../clone/trait.clone "Clone"), and it is OK to keep the source element in memory, you should instead use the [`repeat()`](fn.repeat) function.
An iterator produced by `repeat_with()` is not a [`DoubleEndedIterator`](trait.doubleendediterator). If you need `repeat_with()` to return a [`DoubleEndedIterator`](trait.doubleendediterator), please open a GitHub issue explaining your use case.
Examples
--------
Basic usage:
```
use std::iter;
// let's assume we have some value of a type that is not `Clone`
// or which we don't want to have in memory just yet because it is expensive:
#[derive(PartialEq, Debug)]
struct Expensive;
// a particular value forever:
let mut things = iter::repeat_with(|| Expensive);
assert_eq!(Some(Expensive), things.next());
assert_eq!(Some(Expensive), things.next());
assert_eq!(Some(Expensive), things.next());
assert_eq!(Some(Expensive), things.next());
assert_eq!(Some(Expensive), things.next());
```
Using mutation and going finite:
```
use std::iter;
// From the zeroth to the third power of two:
let mut curr = 1;
let mut pow2 = iter::repeat_with(|| { let tmp = curr; curr *= 2; tmp })
.take(4);
assert_eq!(Some(1), pow2.next());
assert_eq!(Some(2), pow2.next());
assert_eq!(Some(4), pow2.next());
assert_eq!(Some(8), pow2.next());
// ... and now we're done
assert_eq!(None, pow2.next());
```
rust Trait std::iter::Iterator Trait std::iter::Iterator
=========================
```
pub trait Iterator {
type Item;
Show 75 methods fn next(&mut self) -> Option<Self::Item>;
fn next_chunk<const N: usize>( &mut self ) -> Result<[Self::Item; N], IntoIter<Self::Item, N>> { ... }
fn size_hint(&self) -> (usize, Option<usize>) { ... }
fn count(self) -> usize { ... }
fn last(self) -> Option<Self::Item> { ... }
fn advance_by(&mut self, n: usize) -> Result<(), usize> { ... }
fn nth(&mut self, n: usize) -> Option<Self::Item> { ... }
fn step_by(self, step: usize) -> StepBy<Self> { ... }
fn chain<U>(self, other: U) -> Chain<Self, <U as IntoIterator>::IntoIter>ⓘNotable traits for 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; where U: IntoIterator<Item = Self::Item>,
{ ... }
fn zip<U>(self, other: U) -> Zip<Self, <U as IntoIterator>::IntoIter>ⓘNotable traits for 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); where U: IntoIterator,
{ ... }
fn intersperse(self, separator: Self::Item) -> Intersperse<Self>ⓘNotable traits for Intersperse<I>impl<I> Iterator for Intersperse<I>where I: Iterator, <I as Iterator>::Item: Clone, type Item = <I as Iterator>::Item; where Self::Item: Clone,
{ ... }
fn intersperse_with<G>(self, separator: G) -> IntersperseWith<Self, G>ⓘNotable traits for 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; where G: FnMut() -> Self::Item,
{ ... }
fn map<B, F>(self, f: F) -> Map<Self, F>ⓘNotable traits for 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; where F: FnMut(Self::Item) -> B,
{ ... }
fn for_each<F>(self, f: F) where F: FnMut(Self::Item),
{ ... }
fn filter<P>(self, predicate: P) -> Filter<Self, P>ⓘNotable traits for 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; where P: FnMut(&Self::Item) -> bool,
{ ... }
fn filter_map<B, F>(self, f: F) -> FilterMap<Self, F>ⓘNotable traits for 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; where F: FnMut(Self::Item) -> Option<B>,
{ ... }
fn enumerate(self) -> Enumerate<Self>ⓘNotable traits for Enumerate<I>impl<I> Iterator for Enumerate<I>where I: Iterator, type Item = (usize, <I as Iterator>::Item); { ... }
fn peekable(self) -> Peekable<Self>ⓘNotable traits for Peekable<I>impl<I> Iterator for Peekable<I>where I: Iterator, type Item = <I as Iterator>::Item; { ... }
fn skip_while<P>(self, predicate: P) -> SkipWhile<Self, P>ⓘNotable traits for 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; where P: FnMut(&Self::Item) -> bool,
{ ... }
fn take_while<P>(self, predicate: P) -> TakeWhile<Self, P>ⓘNotable traits for 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; where P: FnMut(&Self::Item) -> bool,
{ ... }
fn map_while<B, P>(self, predicate: P) -> MapWhile<Self, P>ⓘNotable traits for 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; where P: FnMut(Self::Item) -> Option<B>,
{ ... }
fn skip(self, n: usize) -> Skip<Self>ⓘNotable traits for Skip<I>impl<I> Iterator for Skip<I>where I: Iterator, type Item = <I as Iterator>::Item; { ... }
fn take(self, n: usize) -> Take<Self>ⓘNotable traits for Take<I>impl<I> Iterator for Take<I>where I: Iterator, type Item = <I as Iterator>::Item; { ... }
fn scan<St, B, F>(self, initial_state: St, f: F) -> Scan<Self, St, F>ⓘNotable traits for 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; where F: FnMut(&mut St, Self::Item) -> Option<B>,
{ ... }
fn flat_map<U, F>(self, f: F) -> FlatMap<Self, U, F>ⓘNotable traits for 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; where U: IntoIterator, F: FnMut(Self::Item) -> U,
{ ... }
fn flatten(self) -> Flatten<Self>ⓘNotable traits for Flatten<I>impl<I, U> Iterator for Flatten<I>where I: Iterator, U: Iterator, <I as Iterator>::Item: IntoIterator, <<I as Iterator>::Item as IntoIterator>::IntoIter == U, <<I as Iterator>::Item as IntoIterator>::Item == <U as Iterator>::Item, type Item = <U as Iterator>::Item; where Self::Item: IntoIterator,
{ ... }
fn fuse(self) -> Fuse<Self>ⓘNotable traits for Fuse<I>impl<I> Iterator for Fuse<I>where I: Iterator, type Item = <I as Iterator>::Item; { ... }
fn inspect<F>(self, f: F) -> Inspect<Self, F>ⓘNotable traits for 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; where F: FnMut(&Self::Item),
{ ... }
fn by_ref(&mut self) -> &mut Self { ... }
fn collect<B>(self) -> B where B: FromIterator<Self::Item>,
{ ... }
fn try_collect<B>( &mut self ) -> <<Self::Item as Try>::Residual as Residual<B>>::TryType where B: FromIterator<<Self::Item as Try>::Output>, Self::Item: Try, <Self::Item as Try>::Residual: Residual<B>,
{ ... }
fn collect_into<E>(self, collection: &mut E) -> &mut E where E: Extend<Self::Item>,
{ ... }
fn partition<B, F>(self, f: F) -> (B, B) where B: Default + Extend<Self::Item>, F: FnMut(&Self::Item) -> bool,
{ ... }
fn partition_in_place<'a, T, P>(self, predicate: P) -> usize where T: 'a, Self: DoubleEndedIterator<Item = &'a mut T>, P: FnMut(&T) -> bool,
{ ... }
fn is_partitioned<P>(self, predicate: P) -> bool where P: FnMut(Self::Item) -> bool,
{ ... }
fn try_fold<B, F, R>(&mut self, init: B, f: F) -> R where F: FnMut(B, Self::Item) -> R, R: Try<Output = B>,
{ ... }
fn try_for_each<F, R>(&mut self, f: F) -> R where F: FnMut(Self::Item) -> R, R: Try<Output = ()>,
{ ... }
fn fold<B, F>(self, init: B, f: F) -> B where F: FnMut(B, Self::Item) -> B,
{ ... }
fn reduce<F>(self, f: F) -> Option<Self::Item> where F: FnMut(Self::Item, Self::Item) -> Self::Item,
{ ... }
fn try_reduce<F, R>( &mut self, f: F ) -> <<R as Try>::Residual as Residual<Option<<R as Try>::Output>>>::TryType where F: FnMut(Self::Item, Self::Item) -> R, R: Try<Output = Self::Item>, <R as Try>::Residual: Residual<Option<Self::Item>>,
{ ... }
fn all<F>(&mut self, f: F) -> bool where F: FnMut(Self::Item) -> bool,
{ ... }
fn any<F>(&mut self, f: F) -> bool where F: FnMut(Self::Item) -> bool,
{ ... }
fn find<P>(&mut self, predicate: P) -> Option<Self::Item> where P: FnMut(&Self::Item) -> bool,
{ ... }
fn find_map<B, F>(&mut self, f: F) -> Option<B> where F: FnMut(Self::Item) -> Option<B>,
{ ... }
fn try_find<F, R>( &mut self, f: F ) -> <<R as Try>::Residual as Residual<Option<Self::Item>>>::TryType where F: FnMut(&Self::Item) -> R, R: Try<Output = bool>, <R as Try>::Residual: Residual<Option<Self::Item>>,
{ ... }
fn position<P>(&mut self, predicate: P) -> Option<usize> where P: FnMut(Self::Item) -> bool,
{ ... }
fn rposition<P>(&mut self, predicate: P) -> Option<usize> where P: FnMut(Self::Item) -> bool, Self: ExactSizeIterator + DoubleEndedIterator,
{ ... }
fn max(self) -> Option<Self::Item> where Self::Item: Ord,
{ ... }
fn min(self) -> Option<Self::Item> where Self::Item: Ord,
{ ... }
fn max_by_key<B, F>(self, f: F) -> Option<Self::Item> where B: Ord, F: FnMut(&Self::Item) -> B,
{ ... }
fn max_by<F>(self, compare: F) -> Option<Self::Item> where F: FnMut(&Self::Item, &Self::Item) -> Ordering,
{ ... }
fn min_by_key<B, F>(self, f: F) -> Option<Self::Item> where B: Ord, F: FnMut(&Self::Item) -> B,
{ ... }
fn min_by<F>(self, compare: F) -> Option<Self::Item> where F: FnMut(&Self::Item, &Self::Item) -> Ordering,
{ ... }
fn rev(self) -> Rev<Self>ⓘNotable traits for Rev<I>impl<I> Iterator for Rev<I>where I: DoubleEndedIterator, type Item = <I as Iterator>::Item; where Self: DoubleEndedIterator,
{ ... }
fn unzip<A, B, FromA, FromB>(self) -> (FromA, FromB) where FromA: Default + Extend<A>, FromB: Default + Extend<B>, Self: Iterator<Item = (A, B)>,
{ ... }
fn copied<'a, T>(self) -> Copied<Self>ⓘNotable traits for Copied<I>impl<'a, I, T> Iterator for Copied<I>where T: 'a + Copy, I: Iterator<Item = &'a T>, type Item = T; where T: 'a + Copy, Self: Iterator<Item = &'a T>,
{ ... }
fn cloned<'a, T>(self) -> Cloned<Self>ⓘNotable traits for Cloned<I>impl<'a, I, T> Iterator for Cloned<I>where T: 'a + Clone, I: Iterator<Item = &'a T>, type Item = T; where T: 'a + Clone, Self: Iterator<Item = &'a T>,
{ ... }
fn cycle(self) -> Cycle<Self>ⓘNotable traits for Cycle<I>impl<I> Iterator for Cycle<I>where I: Clone + Iterator, type Item = <I as Iterator>::Item; where Self: Clone,
{ ... }
fn array_chunks<const N: usize>(self) -> ArrayChunks<Self, N>ⓘNotable traits for ArrayChunks<I, N>impl<I, const N: usize> Iterator for ArrayChunks<I, N>where I: Iterator, type Item = [<I as Iterator>::Item; N]; { ... }
fn sum<S>(self) -> S where S: Sum<Self::Item>,
{ ... }
fn product<P>(self) -> P where P: Product<Self::Item>,
{ ... }
fn cmp<I>(self, other: I) -> Ordering where I: IntoIterator<Item = Self::Item>, Self::Item: Ord,
{ ... }
fn cmp_by<I, F>(self, other: I, cmp: F) -> Ordering where I: IntoIterator, F: FnMut(Self::Item, <I as IntoIterator>::Item) -> Ordering,
{ ... }
fn partial_cmp<I>(self, other: I) -> Option<Ordering> where I: IntoIterator, Self::Item: PartialOrd<<I as IntoIterator>::Item>,
{ ... }
fn partial_cmp_by<I, F>(self, other: I, partial_cmp: F) -> Option<Ordering> where I: IntoIterator, F: FnMut(Self::Item, <I as IntoIterator>::Item) -> Option<Ordering>,
{ ... }
fn eq<I>(self, other: I) -> bool where I: IntoIterator, Self::Item: PartialEq<<I as IntoIterator>::Item>,
{ ... }
fn eq_by<I, F>(self, other: I, eq: F) -> bool where I: IntoIterator, F: FnMut(Self::Item, <I as IntoIterator>::Item) -> bool,
{ ... }
fn ne<I>(self, other: I) -> bool where I: IntoIterator, Self::Item: PartialEq<<I as IntoIterator>::Item>,
{ ... }
fn lt<I>(self, other: I) -> bool where I: IntoIterator, Self::Item: PartialOrd<<I as IntoIterator>::Item>,
{ ... }
fn le<I>(self, other: I) -> bool where I: IntoIterator, Self::Item: PartialOrd<<I as IntoIterator>::Item>,
{ ... }
fn gt<I>(self, other: I) -> bool where I: IntoIterator, Self::Item: PartialOrd<<I as IntoIterator>::Item>,
{ ... }
fn ge<I>(self, other: I) -> bool where I: IntoIterator, Self::Item: PartialOrd<<I as IntoIterator>::Item>,
{ ... }
fn is_sorted(self) -> bool where Self::Item: PartialOrd<Self::Item>,
{ ... }
fn is_sorted_by<F>(self, compare: F) -> bool where F: FnMut(&Self::Item, &Self::Item) -> Option<Ordering>,
{ ... }
fn is_sorted_by_key<F, K>(self, f: F) -> bool where F: FnMut(Self::Item) -> K, K: PartialOrd<K>,
{ ... }
}
```
Notable traits for [StepBy](struct.stepby "struct std::iter::StepBy")<I>
```
impl<I> Iterator for StepBy<I>where
I: Iterator,
type Item = <I as Iterator>::Item;
```
An interface for dealing with iterators.
This is the main iterator trait. For more about the concept of iterators generally, please see the [module-level documentation](index). In particular, you may want to know how to [implement `Iterator`](index#implementing-iterator).
Required Associated Types
-------------------------
[source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#70)#### type Item
The type of the elements being iterated over.
Required Methods
----------------
[source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#104)#### fn next(&mut self) -> Option<Self::Item>
Advances the iterator and returns the next value.
Returns [`None`](../option/enum.option#variant.None "None") when iteration is finished. Individual iterator implementations may choose to resume iteration, and so calling `next()` again may or may not eventually start returning [`Some(Item)`](../option/enum.option#variant.Some) again at some point.
##### Examples
Basic usage:
```
let a = [1, 2, 3];
let mut iter = a.iter();
// A call to next() returns the next value...
assert_eq!(Some(&1), iter.next());
assert_eq!(Some(&2), iter.next());
assert_eq!(Some(&3), iter.next());
// ... and then None once it's over.
assert_eq!(None, iter.next());
// More calls may or may not return `None`. Here, they always will.
assert_eq!(None, iter.next());
assert_eq!(None, iter.next());
```
Provided Methods
----------------
[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.
If there are not enough elements to fill the array then `Err` is returned containing an iterator over the remaining elements.
##### Examples
Basic usage:
```
#![feature(iter_next_chunk)]
let mut iter = "lorem".chars();
assert_eq!(iter.next_chunk().unwrap(), ['l', 'o']); // N is inferred as 2
assert_eq!(iter.next_chunk().unwrap(), ['r', 'e', 'm']); // N is inferred as 3
assert_eq!(iter.next_chunk::<4>().unwrap_err().as_slice(), &[]); // N is explicitly 4
```
Split a string and get the first three items.
```
#![feature(iter_next_chunk)]
let quote = "not all those who wander are lost";
let [first, second, third] = quote.split_whitespace().next_chunk().unwrap();
assert_eq!(first, "not");
assert_eq!(second, "all");
assert_eq!(third, "those");
```
[source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#215)#### fn size\_hint(&self) -> (usize, Option<usize>)
Returns the bounds on the remaining length of the iterator.
Specifically, `size_hint()` returns a tuple where the first element is the lower bound, and the second element is the upper bound.
The second half of the tuple that is returned is an `[Option](../option/enum.option "Option")<[usize](../primitive.usize "usize")>`. A [`None`](../option/enum.option#variant.None "None") here means that either there is no known upper bound, or the upper bound is larger than [`usize`](../primitive.usize "usize").
##### Implementation notes
It is not enforced that an iterator implementation yields the declared number of elements. A buggy iterator may yield less than the lower bound or more than the upper bound of elements.
`size_hint()` is primarily intended to be used for optimizations such as reserving space for the elements of the iterator, but must not be trusted to e.g., omit bounds checks in unsafe code. An incorrect implementation of `size_hint()` should not lead to memory safety violations.
That said, the implementation should provide a correct estimation, because otherwise it would be a violation of the trait’s protocol.
The default implementation returns `(0, [None](../option/enum.option#variant.None "None"))` which is correct for any iterator.
##### Examples
Basic usage:
```
let a = [1, 2, 3];
let mut iter = a.iter();
assert_eq!((3, Some(3)), iter.size_hint());
let _ = iter.next();
assert_eq!((2, Some(2)), iter.size_hint());
```
A more complex example:
```
// The even numbers in the range of zero to nine.
let iter = (0..10).filter(|x| x % 2 == 0);
// We might iterate from zero to ten times. Knowing that it's five
// exactly wouldn't be possible without executing filter().
assert_eq!((0, Some(10)), iter.size_hint());
// Let's add five more numbers with chain()
let iter = (0..10).filter(|x| x % 2 == 0).chain(15..20);
// now both bounds are increased by five
assert_eq!((5, Some(15)), iter.size_hint());
```
Returning `None` for an upper bound:
```
// an infinite iterator has no upper bound
// and the maximum possible lower bound
let iter = 0..;
assert_eq!((usize::MAX, None), iter.size_hint());
```
[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.
This method will call [`next`](trait.iterator#tymethod.next) repeatedly until [`None`](../option/enum.option#variant.None "None") is encountered, returning the number of times it saw [`Some`](../option/enum.option#variant.Some "Some"). Note that [`next`](trait.iterator#tymethod.next) has to be called at least once even if the iterator does not have any elements.
##### Overflow Behavior
The method does no guarding against overflows, so counting elements of an iterator with more than [`usize::MAX`](../primitive.usize#associatedconstant.MAX "usize::MAX") elements either produces the wrong result or panics. If debug assertions are enabled, a panic is guaranteed.
##### Panics
This function might panic if the iterator has more than [`usize::MAX`](../primitive.usize#associatedconstant.MAX "usize::MAX") elements.
##### Examples
Basic usage:
```
let a = [1, 2, 3];
assert_eq!(a.iter().count(), 3);
let a = [1, 2, 3, 4, 5];
assert_eq!(a.iter().count(), 5);
```
[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.
This method will evaluate the iterator until it returns [`None`](../option/enum.option#variant.None "None"). While doing so, it keeps track of the current element. After [`None`](../option/enum.option#variant.None "None") is returned, `last()` will then return the last element it saw.
##### Examples
Basic usage:
```
let a = [1, 2, 3];
assert_eq!(a.iter().last(), Some(&3));
let a = [1, 2, 3, 4, 5];
assert_eq!(a.iter().last(), Some(&5));
```
[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.
This method will eagerly skip `n` elements by calling [`next`](trait.iterator#tymethod.next) up to `n` times until [`None`](../option/enum.option#variant.None "None") is encountered.
`advance_by(n)` will return [`Ok(())`](../result/enum.result#variant.Ok "Ok") if the iterator successfully advances by `n` elements, or [`Err(k)`](../result/enum.result#variant.Err "Err") if [`None`](../option/enum.option#variant.None "None") is encountered, where `k` is the number of elements the iterator is advanced by before running out of elements (i.e. the length of the iterator). Note that `k` is always less than `n`.
Calling `advance_by(0)` can do meaningful work, for example [`Flatten`](struct.flatten) can advance its outer iterator until it finds an inner iterator that is not empty, which then often allows it to return a more accurate `size_hint()` than in its initial state.
##### Examples
Basic usage:
```
#![feature(iter_advance_by)]
let a = [1, 2, 3, 4];
let mut iter = a.iter();
assert_eq!(iter.advance_by(2), Ok(()));
assert_eq!(iter.next(), Some(&3));
assert_eq!(iter.advance_by(0), Ok(()));
assert_eq!(iter.advance_by(100), Err(1)); // only `&4` was skipped
```
[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.
Like most indexing operations, the count starts from zero, so `nth(0)` returns the first value, `nth(1)` the second, and so on.
Note that all preceding elements, as well as the returned element, will be consumed from the iterator. That means that the preceding elements will be discarded, and also that calling `nth(0)` multiple times on the same iterator will return different elements.
`nth()` will return [`None`](../option/enum.option#variant.None "None") if `n` is greater than or equal to the length of the iterator.
##### Examples
Basic usage:
```
let a = [1, 2, 3];
assert_eq!(a.iter().nth(1), Some(&2));
```
Calling `nth()` multiple times doesn’t rewind the iterator:
```
let a = [1, 2, 3];
let mut iter = a.iter();
assert_eq!(iter.nth(1), Some(&2));
assert_eq!(iter.nth(1), None);
```
Returning `None` if there are less than `n + 1` elements:
```
let a = [1, 2, 3];
assert_eq!(a.iter().nth(10), None);
```
[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](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.
Note 1: The first element of the iterator will always be returned, regardless of the step given.
Note 2: The time at which ignored elements are pulled is not fixed. `StepBy` behaves like the sequence `self.next()`, `self.nth(step-1)`, `self.nth(step-1)`, …, but is also free to behave like the sequence `advance_n_and_return_first(&mut self, step)`, `advance_n_and_return_first(&mut self, step)`, … Which way is used may change for some iterators for performance reasons. The second way will advance the iterator earlier and may consume more items.
`advance_n_and_return_first` is the equivalent of:
```
fn advance_n_and_return_first<I>(iter: &mut I, n: usize) -> Option<I::Item>
where
I: Iterator,
{
let next = iter.next();
if n > 1 {
iter.nth(n - 2);
}
next
}
```
##### Panics
The method will panic if the given step is `0`.
##### Examples
Basic usage:
```
let a = [0, 1, 2, 3, 4, 5];
let mut iter = a.iter().step_by(2);
assert_eq!(iter.next(), Some(&0));
assert_eq!(iter.next(), Some(&2));
assert_eq!(iter.next(), Some(&4));
assert_eq!(iter.next(), None);
```
[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](trait.intoiterator "trait std::iter::IntoIterator")<Item = Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>,
Notable traits for [Chain](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.
`chain()` will return a new iterator which will first iterate over values from the first iterator and then over values from the second iterator.
In other words, it links two iterators together, in a chain. 🔗
[`once`](fn.once) is commonly used to adapt a single value into a chain of other kinds of iteration.
##### Examples
Basic usage:
```
let a1 = [1, 2, 3];
let a2 = [4, 5, 6];
let mut iter = a1.iter().chain(a2.iter());
assert_eq!(iter.next(), Some(&1));
assert_eq!(iter.next(), Some(&2));
assert_eq!(iter.next(), Some(&3));
assert_eq!(iter.next(), Some(&4));
assert_eq!(iter.next(), Some(&5));
assert_eq!(iter.next(), Some(&6));
assert_eq!(iter.next(), None);
```
Since the argument to `chain()` uses [`IntoIterator`](trait.intoiterator "IntoIterator"), we can pass anything that can be converted into an [`Iterator`](trait.iterator "Iterator"), not just an [`Iterator`](trait.iterator "Iterator") itself. For example, slices (`&[T]`) implement [`IntoIterator`](trait.intoiterator "IntoIterator"), and so can be passed to `chain()` directly:
```
let s1 = &[1, 2, 3];
let s2 = &[4, 5, 6];
let mut iter = s1.iter().chain(s2);
assert_eq!(iter.next(), Some(&1));
assert_eq!(iter.next(), Some(&2));
assert_eq!(iter.next(), Some(&3));
assert_eq!(iter.next(), Some(&4));
assert_eq!(iter.next(), Some(&5));
assert_eq!(iter.next(), Some(&6));
assert_eq!(iter.next(), None);
```
If you work with Windows API, you may wish to convert [`OsStr`](../ffi/struct.osstr) to `Vec<u16>`:
```
#[cfg(windows)]
fn os_str_to_utf16(s: &std::ffi::OsStr) -> Vec<u16> {
use std::os::windows::ffi::OsStrExt;
s.encode_wide().chain(std::iter::once(0)).collect()
}
```
[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](trait.intoiterator "trait std::iter::IntoIterator"),
Notable traits for [Zip](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.
`zip()` returns a new iterator that will iterate over two other iterators, returning a tuple where the first element comes from the first iterator, and the second element comes from the second iterator.
In other words, it zips two iterators together, into a single one.
If either iterator returns [`None`](../option/enum.option#variant.None "None"), [`next`](trait.iterator#tymethod.next) from the zipped iterator will return [`None`](../option/enum.option#variant.None "None"). If the zipped iterator has no more elements to return then each further attempt to advance it will first try to advance the first iterator at most one time and if it still yielded an item try to advance the second iterator at most one time.
To ‘undo’ the result of zipping up two iterators, see [`unzip`](trait.iterator#method.unzip).
##### Examples
Basic usage:
```
let a1 = [1, 2, 3];
let a2 = [4, 5, 6];
let mut iter = a1.iter().zip(a2.iter());
assert_eq!(iter.next(), Some((&1, &4)));
assert_eq!(iter.next(), Some((&2, &5)));
assert_eq!(iter.next(), Some((&3, &6)));
assert_eq!(iter.next(), None);
```
Since the argument to `zip()` uses [`IntoIterator`](trait.intoiterator "IntoIterator"), we can pass anything that can be converted into an [`Iterator`](trait.iterator "Iterator"), not just an [`Iterator`](trait.iterator "Iterator") itself. For example, slices (`&[T]`) implement [`IntoIterator`](trait.intoiterator "IntoIterator"), and so can be passed to `zip()` directly:
```
let s1 = &[1, 2, 3];
let s2 = &[4, 5, 6];
let mut iter = s1.iter().zip(s2);
assert_eq!(iter.next(), Some((&1, &4)));
assert_eq!(iter.next(), Some((&2, &5)));
assert_eq!(iter.next(), Some((&3, &6)));
assert_eq!(iter.next(), None);
```
`zip()` is often used to zip an infinite iterator to a finite one. This works because the finite iterator will eventually return [`None`](../option/enum.option#variant.None "None"), ending the zipper. Zipping with `(0..)` can look a lot like [`enumerate`](trait.iterator#method.enumerate):
```
let enumerate: Vec<_> = "foo".chars().enumerate().collect();
let zipper: Vec<_> = (0..).zip("foo".chars()).collect();
assert_eq!((0, 'f'), enumerate[0]);
assert_eq!((0, 'f'), zipper[0]);
assert_eq!((1, 'o'), enumerate[1]);
assert_eq!((1, 'o'), zipper[1]);
assert_eq!((2, 'o'), enumerate[2]);
assert_eq!((2, 'o'), zipper[2]);
```
If both iterators have roughly equivalent syntax, it may be more readable to use [`zip`](fn.zip):
```
use std::iter::zip;
let a = [1, 2, 3];
let b = [2, 3, 4];
let mut zipped = zip(
a.into_iter().map(|x| x * 2).skip(1),
b.into_iter().map(|x| x * 2).skip(1),
);
assert_eq!(zipped.next(), Some((4, 6)));
assert_eq!(zipped.next(), Some((6, 8)));
assert_eq!(zipped.next(), None);
```
compared to:
```
let mut zipped = a
.into_iter()
.map(|x| x * 2)
.skip(1)
.zip(b.into_iter().map(|x| x * 2).skip(1));
```
[source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#659-662)#### fn intersperse(self, separator: Self::Item) -> Intersperse<Self>where Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [Clone](../clone/trait.clone "trait std::clone::Clone"),
Notable traits for [Intersperse](struct.intersperse "struct std::iter::Intersperse")<I>
```
impl<I> Iterator for Intersperse<I>where
I: Iterator,
<I as Iterator>::Item: Clone,
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 a copy of `separator` between adjacent items of the original iterator.
In case `separator` does not implement [`Clone`](../clone/trait.clone) or needs to be computed every time, use [`intersperse_with`](trait.iterator#method.intersperse_with).
##### Examples
Basic usage:
```
#![feature(iter_intersperse)]
let mut a = [0, 1, 2].iter().intersperse(&100);
assert_eq!(a.next(), Some(&0)); // The first element from `a`.
assert_eq!(a.next(), Some(&100)); // The separator.
assert_eq!(a.next(), Some(&1)); // The next element from `a`.
assert_eq!(a.next(), Some(&100)); // The separator.
assert_eq!(a.next(), Some(&2)); // The last element from `a`.
assert_eq!(a.next(), None); // The iterator is finished.
```
`intersperse` can be very useful to join an iterator’s items using a common element:
```
#![feature(iter_intersperse)]
let hello = ["Hello", "World", "!"].iter().copied().intersperse(" ").collect::<String>();
assert_eq!(hello, "Hello World !");
```
[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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"),
Notable traits for [IntersperseWith](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.
The closure will be called exactly once each time an item is placed between two adjacent items from the underlying iterator; specifically, the closure is not called if the underlying iterator yields less than two items and after the last item is yielded.
If the iterator’s item implements [`Clone`](../clone/trait.clone), it may be easier to use [`intersperse`](trait.iterator#method.intersperse).
##### Examples
Basic usage:
```
#![feature(iter_intersperse)]
#[derive(PartialEq, Debug)]
struct NotClone(usize);
let v = [NotClone(0), NotClone(1), NotClone(2)];
let mut it = v.into_iter().intersperse_with(|| NotClone(99));
assert_eq!(it.next(), Some(NotClone(0))); // The first element from `v`.
assert_eq!(it.next(), Some(NotClone(99))); // The separator.
assert_eq!(it.next(), Some(NotClone(1))); // The next element from `v`.
assert_eq!(it.next(), Some(NotClone(99))); // The separator.
assert_eq!(it.next(), Some(NotClone(2))); // The last element from from `v`.
assert_eq!(it.next(), None); // The iterator is finished.
```
`intersperse_with` can be used in situations where the separator needs to be computed:
```
#![feature(iter_intersperse)]
let src = ["Hello", "to", "all", "people", "!!"].iter().copied();
// The closure mutably borrows its context to generate an item.
let mut happy_emojis = [" ❤️ ", " 😀 "].iter().copied();
let separator = || happy_emojis.next().unwrap_or(" 🦀 ");
let result = src.intersperse_with(separator).collect::<String>();
assert_eq!(result, "Hello ❤️ to 😀 all 🦀 people 🦀 !!");
```
[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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> B,
Notable traits for [Map](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.
`map()` transforms one iterator into another, by means of its argument: something that implements [`FnMut`](../ops/trait.fnmut). It produces a new iterator which calls this closure on each element of the original iterator.
If you are good at thinking in types, you can think of `map()` like this: If you have an iterator that gives you elements of some type `A`, and you want an iterator of some other type `B`, you can use `map()`, passing a closure that takes an `A` and returns a `B`.
`map()` is conceptually similar to a [`for`](../../book/ch03-05-control-flow#looping-through-a-collection-with-for) loop. However, as `map()` is lazy, it is best used when you’re already working with other iterators. If you’re doing some sort of looping for a side effect, it’s considered more idiomatic to use [`for`](../../book/ch03-05-control-flow#looping-through-a-collection-with-for) than `map()`.
##### Examples
Basic usage:
```
let a = [1, 2, 3];
let mut iter = a.iter().map(|x| 2 * x);
assert_eq!(iter.next(), Some(2));
assert_eq!(iter.next(), Some(4));
assert_eq!(iter.next(), Some(6));
assert_eq!(iter.next(), None);
```
If you’re doing some sort of side effect, prefer [`for`](../../book/ch03-05-control-flow#looping-through-a-collection-with-for) to `map()`:
```
// don't do this:
(0..5).map(|x| println!("{x}"));
// it won't even execute, as it is lazy. Rust will warn you about this.
// Instead, use for:
for x in 0..5 {
println!("{x}");
}
```
[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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")),
Calls a closure on each element of an iterator.
This is equivalent to using a [`for`](../../book/ch03-05-control-flow#looping-through-a-collection-with-for) loop on the iterator, although `break` and `continue` are not possible from a closure. It’s generally more idiomatic to use a `for` loop, but `for_each` may be more legible when processing items at the end of longer iterator chains. In some cases `for_each` may also be faster than a loop, because it will use internal iteration on adapters like `Chain`.
##### Examples
Basic usage:
```
use std::sync::mpsc::channel;
let (tx, rx) = channel();
(0..5).map(|x| x * 2 + 1)
.for_each(move |x| tx.send(x).unwrap());
let v: Vec<_> = rx.iter().collect();
assert_eq!(v, vec![1, 3, 5, 7, 9]);
```
For such a small example, a `for` loop may be cleaner, but `for_each` might be preferable to keep a functional style with longer iterators:
```
(0..5).flat_map(|x| x * 100 .. x * 110)
.enumerate()
.filter(|&(i, x)| (i + x) % 3 == 0)
.for_each(|(i, x)| println!("{i}:{x}"));
```
[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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool),
Notable traits for [Filter](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.
Given an element the closure must return `true` or `false`. The returned iterator will yield only the elements for which the closure returns true.
##### Examples
Basic usage:
```
let a = [0i32, 1, 2];
let mut iter = a.iter().filter(|x| x.is_positive());
assert_eq!(iter.next(), Some(&1));
assert_eq!(iter.next(), Some(&2));
assert_eq!(iter.next(), None);
```
Because the closure passed to `filter()` takes a reference, and many iterators iterate over references, this leads to a possibly confusing situation, where the type of the closure is a double reference:
```
let a = [0, 1, 2];
let mut iter = a.iter().filter(|x| **x > 1); // need two *s!
assert_eq!(iter.next(), Some(&2));
assert_eq!(iter.next(), None);
```
It’s common to instead use destructuring on the argument to strip away one:
```
let a = [0, 1, 2];
let mut iter = a.iter().filter(|&x| *x > 1); // both & and *
assert_eq!(iter.next(), Some(&2));
assert_eq!(iter.next(), None);
```
or both:
```
let a = [0, 1, 2];
let mut iter = a.iter().filter(|&&x| x > 1); // two &s
assert_eq!(iter.next(), Some(&2));
assert_eq!(iter.next(), None);
```
of these layers.
Note that `iter.filter(f).next()` is equivalent to `iter.find(f)`.
[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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Option](../option/enum.option "enum std::option::Option")<B>,
Notable traits for [FilterMap](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.
The returned iterator yields only the `value`s for which the supplied closure returns `Some(value)`.
`filter_map` can be used to make chains of [`filter`](trait.iterator#method.filter) and [`map`](trait.iterator#method.map) more concise. The example below shows how a `map().filter().map()` can be shortened to a single call to `filter_map`.
##### Examples
Basic usage:
```
let a = ["1", "two", "NaN", "four", "5"];
let mut iter = a.iter().filter_map(|s| s.parse().ok());
assert_eq!(iter.next(), Some(1));
assert_eq!(iter.next(), Some(5));
assert_eq!(iter.next(), None);
```
Here’s the same example, but with [`filter`](trait.iterator#method.filter) and [`map`](trait.iterator#method.map):
```
let a = ["1", "two", "NaN", "four", "5"];
let mut iter = a.iter().map(|s| s.parse()).filter(|s| s.is_ok()).map(|s| s.unwrap());
assert_eq!(iter.next(), Some(1));
assert_eq!(iter.next(), Some(5));
assert_eq!(iter.next(), None);
```
[source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#987-989)#### fn enumerate(self) -> Enumerate<Self>
Notable traits for [Enumerate](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.
The iterator returned yields pairs `(i, val)`, where `i` is the current index of iteration and `val` is the value returned by the iterator.
`enumerate()` keeps its count as a [`usize`](../primitive.usize "usize"). If you want to count by a different sized integer, the [`zip`](trait.iterator#method.zip) function provides similar functionality.
##### Overflow Behavior
The method does no guarding against overflows, so enumerating more than [`usize::MAX`](../primitive.usize#associatedconstant.MAX "usize::MAX") elements either produces the wrong result or panics. If debug assertions are enabled, a panic is guaranteed.
##### Panics
The returned iterator might panic if the to-be-returned index would overflow a [`usize`](../primitive.usize "usize").
##### Examples
```
let a = ['a', 'b', 'c'];
let mut iter = a.iter().enumerate();
assert_eq!(iter.next(), Some((0, &'a')));
assert_eq!(iter.next(), Some((1, &'b')));
assert_eq!(iter.next(), Some((2, &'c')));
assert_eq!(iter.next(), None);
```
[source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1058-1060)#### fn peekable(self) -> Peekable<Self>
Notable traits for [Peekable](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`](struct.peekable#method.peek) and [`peek_mut`](struct.peekable#method.peek_mut) methods to look at the next element of the iterator without consuming it. See their documentation for more information.
Note that the underlying iterator is still advanced when [`peek`](struct.peekable#method.peek) or [`peek_mut`](struct.peekable#method.peek_mut) are called for the first time: In order to retrieve the next element, [`next`](trait.iterator#tymethod.next) is called on the underlying iterator, hence any side effects (i.e. anything other than fetching the next value) of the [`next`](trait.iterator#tymethod.next) method will occur.
##### Examples
Basic usage:
```
let xs = [1, 2, 3];
let mut iter = xs.iter().peekable();
// peek() lets us see into the future
assert_eq!(iter.peek(), Some(&&1));
assert_eq!(iter.next(), Some(&1));
assert_eq!(iter.next(), Some(&2));
// we can peek() multiple times, the iterator won't advance
assert_eq!(iter.peek(), Some(&&3));
assert_eq!(iter.peek(), Some(&&3));
assert_eq!(iter.next(), Some(&3));
// after the iterator is finished, so is peek()
assert_eq!(iter.peek(), None);
assert_eq!(iter.next(), None);
```
Using [`peek_mut`](struct.peekable#method.peek_mut) to mutate the next item without advancing the iterator:
```
let xs = [1, 2, 3];
let mut iter = xs.iter().peekable();
// `peek_mut()` lets us see into the future
assert_eq!(iter.peek_mut(), Some(&mut &1));
assert_eq!(iter.peek_mut(), Some(&mut &1));
assert_eq!(iter.next(), Some(&1));
if let Some(mut p) = iter.peek_mut() {
assert_eq!(*p, &2);
// put a value into the iterator
*p = &1000;
}
// The value reappears as the iterator continues
assert_eq!(iter.collect::<Vec<_>>(), vec![&1000, &3]);
```
[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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool),
Notable traits for [SkipWhile](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`](trait.iterator#method.skip)s elements based on a predicate.
`skip_while()` takes a closure as an argument. It will call this closure on each element of the iterator, and ignore elements until it returns `false`.
After `false` is returned, `skip_while()`’s job is over, and the rest of the elements are yielded.
##### Examples
Basic usage:
```
let a = [-1i32, 0, 1];
let mut iter = a.iter().skip_while(|x| x.is_negative());
assert_eq!(iter.next(), Some(&0));
assert_eq!(iter.next(), Some(&1));
assert_eq!(iter.next(), None);
```
Because the closure passed to `skip_while()` takes a reference, and many iterators iterate over references, this leads to a possibly confusing situation, where the type of the closure argument is a double reference:
```
let a = [-1, 0, 1];
let mut iter = a.iter().skip_while(|x| **x < 0); // need two *s!
assert_eq!(iter.next(), Some(&0));
assert_eq!(iter.next(), Some(&1));
assert_eq!(iter.next(), None);
```
Stopping after an initial `false`:
```
let a = [-1, 0, 1, -2];
let mut iter = a.iter().skip_while(|x| **x < 0);
assert_eq!(iter.next(), Some(&0));
assert_eq!(iter.next(), Some(&1));
// while this would have been false, since we already got a false,
// skip_while() isn't used any more
assert_eq!(iter.next(), Some(&-2));
assert_eq!(iter.next(), None);
```
[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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool),
Notable traits for [TakeWhile](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.
`take_while()` takes a closure as an argument. It will call this closure on each element of the iterator, and yield elements while it returns `true`.
After `false` is returned, `take_while()`’s job is over, and the rest of the elements are ignored.
##### Examples
Basic usage:
```
let a = [-1i32, 0, 1];
let mut iter = a.iter().take_while(|x| x.is_negative());
assert_eq!(iter.next(), Some(&-1));
assert_eq!(iter.next(), None);
```
Because the closure passed to `take_while()` takes a reference, and many iterators iterate over references, this leads to a possibly confusing situation, where the type of the closure is a double reference:
```
let a = [-1, 0, 1];
let mut iter = a.iter().take_while(|x| **x < 0); // need two *s!
assert_eq!(iter.next(), Some(&-1));
assert_eq!(iter.next(), None);
```
Stopping after an initial `false`:
```
let a = [-1, 0, 1, -2];
let mut iter = a.iter().take_while(|x| **x < 0);
assert_eq!(iter.next(), Some(&-1));
// We have more elements that are less than zero, but since we already
// got a false, take_while() isn't used any more
assert_eq!(iter.next(), None);
```
Because `take_while()` needs to look at the value in order to see if it should be included or not, consuming iterators will see that it is removed:
```
let a = [1, 2, 3, 4];
let mut iter = a.iter();
let result: Vec<i32> = iter.by_ref()
.take_while(|n| **n != 3)
.cloned()
.collect();
assert_eq!(result, &[1, 2]);
let result: Vec<i32> = iter.cloned().collect();
assert_eq!(result, &[4]);
```
The `3` is no longer there, because it was consumed in order to see if the iteration should stop, but wasn’t placed back into the iterator.
[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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Option](../option/enum.option "enum std::option::Option")<B>,
Notable traits for [MapWhile](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.
`map_while()` takes a closure as an argument. It will call this closure on each element of the iterator, and yield elements while it returns [`Some(_)`](../option/enum.option#variant.Some "Some").
##### Examples
Basic usage:
```
let a = [-1i32, 4, 0, 1];
let mut iter = a.iter().map_while(|x| 16i32.checked_div(*x));
assert_eq!(iter.next(), Some(-16));
assert_eq!(iter.next(), Some(4));
assert_eq!(iter.next(), None);
```
Here’s the same example, but with [`take_while`](trait.iterator#method.take_while) and [`map`](trait.iterator#method.map):
```
let a = [-1i32, 4, 0, 1];
let mut iter = a.iter()
.map(|x| 16i32.checked_div(*x))
.take_while(|x| x.is_some())
.map(|x| x.unwrap());
assert_eq!(iter.next(), Some(-16));
assert_eq!(iter.next(), Some(4));
assert_eq!(iter.next(), None);
```
Stopping after an initial [`None`](../option/enum.option#variant.None "None"):
```
let a = [0, 1, 2, -3, 4, 5, -6];
let iter = a.iter().map_while(|x| u32::try_from(*x).ok());
let vec = iter.collect::<Vec<_>>();
// We have more elements which could fit in u32 (4, 5), but `map_while` returned `None` for `-3`
// (as the `predicate` returned `None`) and `collect` stops at the first `None` encountered.
assert_eq!(vec, vec![0, 1, 2]);
```
Because `map_while()` needs to look at the value in order to see if it should be included or not, consuming iterators will see that it is removed:
```
let a = [1, 2, -3, 4];
let mut iter = a.iter();
let result: Vec<u32> = iter.by_ref()
.map_while(|n| u32::try_from(*n).ok())
.collect();
assert_eq!(result, &[1, 2]);
let result: Vec<i32> = iter.cloned().collect();
assert_eq!(result, &[4]);
```
The `-3` is no longer there, because it was consumed in order to see if the iteration should stop, but wasn’t placed back into the iterator.
Note that unlike [`take_while`](trait.iterator#method.take_while) this iterator is **not** fused. It is also not specified what this iterator returns after the first [`None`](../option/enum.option#variant.None "None") is returned. If you need fused iterator, use [`fuse`](trait.iterator#method.fuse).
[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](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.
`skip(n)` skips elements until `n` elements are skipped or the end of the iterator is reached (whichever happens first). After that, all the remaining elements are yielded. In particular, if the original iterator is too short, then the returned iterator is empty.
Rather than overriding this method directly, instead override the `nth` method.
##### Examples
Basic usage:
```
let a = [1, 2, 3];
let mut iter = a.iter().skip(2);
assert_eq!(iter.next(), Some(&3));
assert_eq!(iter.next(), None);
```
[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](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.
`take(n)` yields elements until `n` elements are yielded or the end of the iterator is reached (whichever happens first). The returned iterator is a prefix of length `n` if the original iterator contains at least `n` elements, otherwise it contains all of the (fewer than `n`) elements of the original iterator.
##### Examples
Basic usage:
```
let a = [1, 2, 3];
let mut iter = a.iter().take(2);
assert_eq!(iter.next(), Some(&1));
assert_eq!(iter.next(), Some(&2));
assert_eq!(iter.next(), None);
```
`take()` is often used with an infinite iterator, to make it finite:
```
let mut iter = (0..).take(3);
assert_eq!(iter.next(), Some(0));
assert_eq!(iter.next(), Some(1));
assert_eq!(iter.next(), Some(2));
assert_eq!(iter.next(), None);
```
If less than `n` elements are available, `take` will limit itself to the size of the underlying iterator:
```
let v = [1, 2];
let mut iter = v.into_iter().take(5);
assert_eq!(iter.next(), Some(1));
assert_eq!(iter.next(), Some(2));
assert_eq!(iter.next(), None);
```
[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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Option](../option/enum.option "enum std::option::Option")<B>,
Notable traits for [Scan](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`](trait.iterator#method.fold) that holds internal state and produces a new iterator.
`scan()` takes two arguments: an initial value which seeds the internal state, and a closure with two arguments, the first being a mutable reference to the internal state and the second an iterator element. The closure can assign to the internal state to share state between iterations.
On iteration, the closure will be applied to each element of the iterator and the return value from the closure, an [`Option`](../option/enum.option "Option"), is yielded by the iterator.
##### Examples
Basic usage:
```
let a = [1, 2, 3];
let mut iter = a.iter().scan(1, |state, &x| {
// each iteration, we'll multiply the state by the element
*state = *state * x;
// then, we'll yield the negation of the state
Some(-*state)
});
assert_eq!(iter.next(), Some(-1));
assert_eq!(iter.next(), Some(-2));
assert_eq!(iter.next(), Some(-6));
assert_eq!(iter.next(), None);
```
[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](trait.intoiterator "trait std::iter::IntoIterator"), F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> U,
Notable traits for [FlatMap](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.
The [`map`](trait.iterator#method.map) adapter is very useful, but only when the closure argument produces values. If it produces an iterator instead, there’s an extra layer of indirection. `flat_map()` will remove this extra layer on its own.
You can think of `flat_map(f)` as the semantic equivalent of [`map`](trait.iterator#method.map)ping, and then [`flatten`](trait.iterator#method.flatten)ing as in `map(f).flatten()`.
Another way of thinking about `flat_map()`: [`map`](trait.iterator#method.map)’s closure returns one item for each element, and `flat_map()`’s closure returns an iterator for each element.
##### Examples
Basic usage:
```
let words = ["alpha", "beta", "gamma"];
// chars() returns an iterator
let merged: String = words.iter()
.flat_map(|s| s.chars())
.collect();
assert_eq!(merged, "alphabetagamma");
```
[source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1532-1535)1.29.0 · #### fn flatten(self) -> Flatten<Self>where Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [IntoIterator](trait.intoiterator "trait std::iter::IntoIterator"),
Notable traits for [Flatten](struct.flatten "struct std::iter::Flatten")<I>
```
impl<I, U> Iterator for Flatten<I>where
I: Iterator,
U: Iterator,
<I as Iterator>::Item: IntoIterator,
<<I as Iterator>::Item as IntoIterator>::IntoIter == U,
<<I as Iterator>::Item as IntoIterator>::Item == <U as Iterator>::Item,
type Item = <U as Iterator>::Item;
```
Creates an iterator that flattens nested structure.
This is useful when you have an iterator of iterators or an iterator of things that can be turned into iterators and you want to remove one level of indirection.
##### Examples
Basic usage:
```
let data = vec![vec![1, 2, 3, 4], vec![5, 6]];
let flattened = data.into_iter().flatten().collect::<Vec<u8>>();
assert_eq!(flattened, &[1, 2, 3, 4, 5, 6]);
```
Mapping and then flattening:
```
let words = ["alpha", "beta", "gamma"];
// chars() returns an iterator
let merged: String = words.iter()
.map(|s| s.chars())
.flatten()
.collect();
assert_eq!(merged, "alphabetagamma");
```
You can also rewrite this in terms of [`flat_map()`](trait.iterator#method.flat_map), which is preferable in this case since it conveys intent more clearly:
```
let words = ["alpha", "beta", "gamma"];
// chars() returns an iterator
let merged: String = words.iter()
.flat_map(|s| s.chars())
.collect();
assert_eq!(merged, "alphabetagamma");
```
Flattening only removes one level of nesting at a time:
```
let d3 = [[[1, 2], [3, 4]], [[5, 6], [7, 8]]];
let d2 = d3.iter().flatten().collect::<Vec<_>>();
assert_eq!(d2, [&[1, 2], &[3, 4], &[5, 6], &[7, 8]]);
let d1 = d3.iter().flatten().flatten().collect::<Vec<_>>();
assert_eq!(d1, [&1, &2, &3, &4, &5, &6, &7, &8]);
```
Here we see that `flatten()` does not perform a “deep” flatten. Instead, only one level of nesting is removed. That is, if you `flatten()` a three-dimensional array, the result will be two-dimensional and not one-dimensional. To get a one-dimensional structure, you have to `flatten()` again.
[source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1600-1602)#### fn fuse(self) -> Fuse<Self>
Notable traits for [Fuse](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").
After an iterator returns [`None`](../option/enum.option#variant.None "None"), future calls may or may not yield [`Some(T)`](../option/enum.option#variant.Some) again. `fuse()` adapts an iterator, ensuring that after a [`None`](../option/enum.option#variant.None "None") is given, it will always return [`None`](../option/enum.option#variant.None "None") forever.
Note that the [`Fuse`](struct.fuse "Fuse") wrapper is a no-op on iterators that implement the [`FusedIterator`](trait.fusediterator) trait. `fuse()` may therefore behave incorrectly if the [`FusedIterator`](trait.fusediterator) trait is improperly implemented.
##### Examples
Basic usage:
```
// an iterator which alternates between Some and None
struct Alternate {
state: i32,
}
impl Iterator for Alternate {
type Item = i32;
fn next(&mut self) -> Option<i32> {
let val = self.state;
self.state = self.state + 1;
// if it's even, Some(i32), else None
if val % 2 == 0 {
Some(val)
} else {
None
}
}
}
let mut iter = Alternate { state: 0 };
// we can see our iterator going back and forth
assert_eq!(iter.next(), Some(0));
assert_eq!(iter.next(), None);
assert_eq!(iter.next(), Some(2));
assert_eq!(iter.next(), None);
// however, once we fuse it...
let mut iter = iter.fuse();
assert_eq!(iter.next(), Some(4));
assert_eq!(iter.next(), None);
// it will always return `None` after the first time.
assert_eq!(iter.next(), None);
assert_eq!(iter.next(), None);
assert_eq!(iter.next(), None);
```
[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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")),
Notable traits for [Inspect](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.
When using iterators, you’ll often chain several of them together. While working on such code, you might want to check out what’s happening at various parts in the pipeline. To do that, insert a call to `inspect()`.
It’s more common for `inspect()` to be used as a debugging tool than to exist in your final code, but applications may find it useful in certain situations when errors need to be logged before being discarded.
##### Examples
Basic usage:
```
let a = [1, 4, 2, 3];
// this iterator sequence is complex.
let sum = a.iter()
.cloned()
.filter(|x| x % 2 == 0)
.fold(0, |sum, i| sum + i);
println!("{sum}");
// let's add some inspect() calls to investigate what's happening
let sum = a.iter()
.cloned()
.inspect(|x| println!("about to filter: {x}"))
.filter(|x| x % 2 == 0)
.inspect(|x| println!("made it through filter: {x}"))
.fold(0, |sum, i| sum + i);
println!("{sum}");
```
This will print:
```
6
about to filter: 1
about to filter: 4
made it through filter: 4
about to filter: 2
made it through filter: 2
about to filter: 3
6
```
Logging errors before discarding them:
```
let lines = ["1", "2", "a"];
let sum: i32 = lines
.iter()
.map(|line| line.parse::<i32>())
.inspect(|num| {
if let Err(ref e) = *num {
println!("Parsing error: {e}");
}
})
.filter_map(Result::ok)
.sum();
println!("Sum: {sum}");
```
This will print:
```
Parsing error: invalid digit found in string
Sum: 3
```
[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.
This is useful to allow applying iterator adapters while still retaining ownership of the original iterator.
##### Examples
Basic usage:
```
let mut words = ["hello", "world", "of", "Rust"].into_iter();
// Take the first two words.
let hello_world: Vec<_> = words.by_ref().take(2).collect();
assert_eq!(hello_world, vec!["hello", "world"]);
// Collect the rest of the words.
// We can only do this because we used `by_ref` earlier.
let of_rust: Vec<_> = words.collect();
assert_eq!(of_rust, vec!["of", "Rust"]);
```
[source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1832-1834)#### fn collect<B>(self) -> Bwhere B: [FromIterator](trait.fromiterator "trait std::iter::FromIterator")<Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>,
Transforms an iterator into a collection.
`collect()` can take anything iterable, and turn it into a relevant collection. This is one of the more powerful methods in the standard library, used in a variety of contexts.
The most basic pattern in which `collect()` is used is to turn one collection into another. You take a collection, call [`iter`](trait.iterator#tymethod.next) on it, do a bunch of transformations, and then `collect()` at the end.
`collect()` can also create instances of types that are not typical collections. For example, a [`String`](../string/struct.string) can be built from [`char`](../primitive.char)s, and an iterator of [`Result<T, E>`](../result/enum.result "Result") items can be collected into `Result<Collection<T>, E>`. See the examples below for more.
Because `collect()` is so general, it can cause problems with type inference. As such, `collect()` is one of the few times you’ll see the syntax affectionately known as the ‘turbofish’: `::<>`. This helps the inference algorithm understand specifically which collection you’re trying to collect into.
##### Examples
Basic usage:
```
let a = [1, 2, 3];
let doubled: Vec<i32> = a.iter()
.map(|&x| x * 2)
.collect();
assert_eq!(vec![2, 4, 6], doubled);
```
Note that we needed the `: Vec<i32>` on the left-hand side. This is because we could collect into, for example, a [`VecDeque<T>`](../collections/struct.vecdeque) instead:
```
use std::collections::VecDeque;
let a = [1, 2, 3];
let doubled: VecDeque<i32> = a.iter().map(|&x| x * 2).collect();
assert_eq!(2, doubled[0]);
assert_eq!(4, doubled[1]);
assert_eq!(6, doubled[2]);
```
Using the ‘turbofish’ instead of annotating `doubled`:
```
let a = [1, 2, 3];
let doubled = a.iter().map(|x| x * 2).collect::<Vec<i32>>();
assert_eq!(vec![2, 4, 6], doubled);
```
Because `collect()` only cares about what you’re collecting into, you can still use a partial type hint, `_`, with the turbofish:
```
let a = [1, 2, 3];
let doubled = a.iter().map(|x| x * 2).collect::<Vec<_>>();
assert_eq!(vec![2, 4, 6], doubled);
```
Using `collect()` to make a [`String`](../string/struct.string):
```
let chars = ['g', 'd', 'k', 'k', 'n'];
let hello: String = chars.iter()
.map(|&x| x as u8)
.map(|x| (x + 1) as char)
.collect();
assert_eq!("hello", hello);
```
If you have a list of [`Result<T, E>`](../result/enum.result "Result")s, you can use `collect()` to see if any of them failed:
```
let results = [Ok(1), Err("nope"), Ok(3), Err("bad")];
let result: Result<Vec<_>, &str> = results.iter().cloned().collect();
// gives us the first error
assert_eq!(Err("nope"), result);
let results = [Ok(1), Ok(3)];
let result: Result<Vec<_>, &str> = results.iter().cloned().collect();
// gives us the list of answers
assert_eq!(Ok(vec![1, 3]), result);
```
[source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#1910-1915)#### fn try\_collect<B>( &mut self) -> <<Self::Item as Try>::Residual as Residual<B>>::TryTypewhere B: [FromIterator](trait.fromiterator "trait std::iter::FromIterator")<<Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item") as [Try](../ops/trait.try "trait std::ops::Try")>::[Output](../ops/trait.try#associatedtype.Output "type std::ops::Try::Output")>, Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [Try](../ops/trait.try "trait std::ops::Try"), <Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item") 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")<B>,
🔬This is a nightly-only experimental API. (`iterator_try_collect` [#94047](https://github.com/rust-lang/rust/issues/94047))
Fallibly transforms an iterator into a collection, short circuiting if a failure is encountered.
`try_collect()` is a variation of [`collect()`](trait.iterator#method.collect) that allows fallible conversions during collection. Its main use case is simplifying conversions from iterators yielding [`Option<T>`](../option/enum.option "Option") into `Option<Collection<T>>`, or similarly for other [`Try`](../ops/trait.try "Try") types (e.g. [`Result`](../result/enum.result "Result")).
Importantly, `try_collect()` doesn’t require that the outer [`Try`](../ops/trait.try "Try") type also implements [`FromIterator`](trait.fromiterator "FromIterator"); only the inner type produced on `Try::Output` must implement it. Concretely, this means that collecting into `ControlFlow<_, Vec<i32>>` is valid because `Vec<i32>` implements [`FromIterator`](trait.fromiterator "FromIterator"), even though [`ControlFlow`](../ops/enum.controlflow "ControlFlow") doesn’t.
Also, if a failure is encountered during `try_collect()`, the iterator is still valid and may continue to be used, in which case it will continue iterating starting after the element that triggered the failure. See the last example below for an example of how this works.
##### Examples
Successfully collecting an iterator of `Option<i32>` into `Option<Vec<i32>>`:
```
#![feature(iterator_try_collect)]
let u = vec![Some(1), Some(2), Some(3)];
let v = u.into_iter().try_collect::<Vec<i32>>();
assert_eq!(v, Some(vec![1, 2, 3]));
```
Failing to collect in the same way:
```
#![feature(iterator_try_collect)]
let u = vec![Some(1), Some(2), None, Some(3)];
let v = u.into_iter().try_collect::<Vec<i32>>();
assert_eq!(v, None);
```
A similar example, but with `Result`:
```
#![feature(iterator_try_collect)]
let u: Vec<Result<i32, ()>> = vec![Ok(1), Ok(2), Ok(3)];
let v = u.into_iter().try_collect::<Vec<i32>>();
assert_eq!(v, Ok(vec![1, 2, 3]));
let u = vec![Ok(1), Ok(2), Err(()), Ok(3)];
let v = u.into_iter().try_collect::<Vec<i32>>();
assert_eq!(v, Err(()));
```
Finally, even [`ControlFlow`](../ops/enum.controlflow "ControlFlow") works, despite the fact that it doesn’t implement [`FromIterator`](trait.fromiterator "FromIterator"). Note also that the iterator can continue to be used, even if a failure is encountered:
```
#![feature(iterator_try_collect)]
use core::ops::ControlFlow::{Break, Continue};
let u = [Continue(1), Continue(2), Break(3), Continue(4), Continue(5)];
let mut it = u.into_iter();
let v = it.try_collect::<Vec<_>>();
assert_eq!(v, Break(3));
let v = it.try_collect::<Vec<_>>();
assert_eq!(v, Continue(vec![4, 5]));
```
[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](trait.extend "trait std::iter::Extend")<Self::[Item](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.
This method consumes the iterator and adds all its items to the passed collection. The collection is then returned, so the call chain can be continued.
This is useful when you already have a collection and wants to add the iterator items to it.
This method is a convenience method to call [Extend::extend](trait.extend), but instead of being called on a collection, it’s called on an iterator.
##### Examples
Basic usage:
```
#![feature(iter_collect_into)]
let a = [1, 2, 3];
let mut vec: Vec::<i32> = vec![0, 1];
a.iter().map(|&x| x * 2).collect_into(&mut vec);
a.iter().map(|&x| x * 10).collect_into(&mut vec);
assert_eq!(vec![0, 1, 2, 4, 6, 10, 20, 30], vec);
```
`Vec` can have a manual set capacity to avoid reallocating it:
```
#![feature(iter_collect_into)]
let a = [1, 2, 3];
let mut vec: Vec::<i32> = Vec::with_capacity(6);
a.iter().map(|&x| x * 2).collect_into(&mut vec);
a.iter().map(|&x| x * 10).collect_into(&mut vec);
assert_eq!(6, vec.capacity());
println!("{:?}", vec);
```
The returned mutable reference can be used to continue the call chain:
```
#![feature(iter_collect_into)]
let a = [1, 2, 3];
let mut vec: Vec::<i32> = Vec::with_capacity(6);
let count = a.iter().collect_into(&mut vec).iter().count();
assert_eq!(count, vec.len());
println!("Vec len is {}", count);
let count = a.iter().collect_into(&mut vec).iter().count();
assert_eq!(count, vec.len());
println!("Vec len now is {}", count);
```
[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](trait.extend "trait std::iter::Extend")<Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>, F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool),
Consumes an iterator, creating two collections from it.
The predicate passed to `partition()` can return `true`, or `false`. `partition()` returns a pair, all of the elements for which it returned `true`, and all of the elements for which it returned `false`.
See also [`is_partitioned()`](trait.iterator#method.is_partitioned) and [`partition_in_place()`](trait.iterator#method.partition_in_place).
##### Examples
Basic usage:
```
let a = [1, 2, 3];
let (even, odd): (Vec<_>, Vec<_>) = a
.into_iter()
.partition(|n| n % 2 == 0);
assert_eq!(even, vec![2]);
assert_eq!(odd, vec![1, 3]);
```
[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](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.
The relative order of partitioned items is not maintained.
##### Current implementation
Current algorithms tries finding the first element for which the predicate evaluates to false, and the last element for which it evaluates to true and repeatedly swaps them.
Time complexity: *O*(*n*)
See also [`is_partitioned()`](trait.iterator#method.is_partitioned) and [`partition()`](trait.iterator#method.partition).
##### Examples
```
#![feature(iter_partition_in_place)]
let mut a = [1, 2, 3, 4, 5, 6, 7];
// Partition in-place between evens and odds
let i = a.iter_mut().partition_in_place(|&n| n % 2 == 0);
assert_eq!(i, 3);
assert!(a[..i].iter().all(|&n| n % 2 == 0)); // evens
assert!(a[i..].iter().all(|&n| n % 2 == 1)); // odds
```
[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](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`.
See also [`partition()`](trait.iterator#method.partition) and [`partition_in_place()`](trait.iterator#method.partition_in_place).
##### Examples
```
#![feature(iter_is_partitioned)]
assert!("Iterator".chars().is_partitioned(char::is_uppercase));
assert!(!"IntoIterator".chars().is_partitioned(char::is_uppercase));
```
[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](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.
`try_fold()` takes two arguments: an initial value, and a closure with two arguments: an ‘accumulator’, and an element. The closure either returns successfully, with the value that the accumulator should have for the next iteration, or it returns failure, with an error value that is propagated back to the caller immediately (short-circuiting).
The initial value is the value the accumulator will have on the first call. If applying the closure succeeded against every element of the iterator, `try_fold()` returns the final accumulator as success.
Folding is useful whenever you have a collection of something, and want to produce a single value from it.
##### Note to Implementors
Several of the other (forward) methods have default implementations in terms of this one, so try to implement this explicitly if it can do something better than the default `for` loop implementation.
In particular, try to have this call `try_fold()` on the internal parts from which this iterator is composed. If multiple calls are needed, the `?` operator may be convenient for chaining the accumulator value along, but beware any invariants that need to be upheld before those early returns. This is a `&mut self` method, so iteration needs to be resumable after hitting an error here.
##### Examples
Basic usage:
```
let a = [1, 2, 3];
// the checked sum of all of the elements of the array
let sum = a.iter().try_fold(0i8, |acc, &x| acc.checked_add(x));
assert_eq!(sum, Some(6));
```
Short-circuiting:
```
let a = [10, 20, 30, 100, 40, 50];
let mut it = a.iter();
// This sum overflows when adding the 100 element
let sum = it.try_fold(0i8, |acc, &x| acc.checked_add(x));
assert_eq!(sum, None);
// Because it short-circuited, the remaining elements are still
// available through the iterator.
assert_eq!(it.len(), 2);
assert_eq!(it.next(), Some(&40));
```
While you cannot `break` from a closure, the [`ControlFlow`](../ops/enum.controlflow "ControlFlow") type allows a similar idea:
```
use std::ops::ControlFlow;
let triangular = (1..30).try_fold(0_i8, |prev, x| {
if let Some(next) = prev.checked_add(x) {
ControlFlow::Continue(next)
} else {
ControlFlow::Break(prev)
}
});
assert_eq!(triangular, ControlFlow::Break(120));
let triangular = (1..30).try_fold(0_u64, |prev, x| {
if let Some(next) = prev.checked_add(x) {
ControlFlow::Continue(next)
} else {
ControlFlow::Break(prev)
}
});
assert_eq!(triangular, ControlFlow::Continue(435));
```
[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](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.
This can also be thought of as the fallible form of [`for_each()`](trait.iterator#method.for_each) or as the stateless version of [`try_fold()`](trait.iterator#method.try_fold).
##### Examples
```
use std::fs::rename;
use std::io::{stdout, Write};
use std::path::Path;
let data = ["no_tea.txt", "stale_bread.json", "torrential_rain.png"];
let res = data.iter().try_for_each(|x| writeln!(stdout(), "{x}"));
assert!(res.is_ok());
let mut it = data.iter().cloned();
let res = it.try_for_each(|x| rename(x, Path::new(x).with_extension("old")));
assert!(res.is_err());
// It short-circuited, so the remaining items are still in the iterator:
assert_eq!(it.next(), Some("stale_bread.json"));
```
The [`ControlFlow`](../ops/enum.controlflow "ControlFlow") type can be used with this method for the situations in which you’d use `break` and `continue` in a normal loop:
```
use std::ops::ControlFlow;
let r = (2..100).try_for_each(|x| {
if 323 % x == 0 {
return ControlFlow::Break(x)
}
ControlFlow::Continue(())
});
assert_eq!(r, ControlFlow::Break(17));
```
[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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> B,
Folds every element into an accumulator by applying an operation, returning the final result.
`fold()` takes two arguments: an initial value, and a closure with two arguments: an ‘accumulator’, and an element. The closure returns the value that the accumulator should have for the next iteration.
The initial value is the value the accumulator will have on the first call.
After applying this closure to every element of the iterator, `fold()` returns the accumulator.
This operation is sometimes called ‘reduce’ or ‘inject’.
Folding is useful whenever you have a collection of something, and want to produce a single value from it.
Note: `fold()`, and similar methods that traverse the entire iterator, might not terminate for infinite iterators, even on traits for which a result is determinable in finite time.
Note: [`reduce()`](trait.iterator#method.reduce) can be used to use the first element as the initial value, if the accumulator type and item type is the same.
Note: `fold()` combines elements in a *left-associative* fashion. For associative operators like `+`, the order the elements are combined in is not important, but for non-associative operators like `-` the order will affect the final result. For a *right-associative* version of `fold()`, see [`DoubleEndedIterator::rfold()`](trait.doubleendediterator#method.rfold "DoubleEndedIterator::rfold()").
##### Note to Implementors
Several of the other (forward) methods have default implementations in terms of this one, so try to implement this explicitly if it can do something better than the default `for` loop implementation.
In particular, try to have this call `fold()` on the internal parts from which this iterator is composed.
##### Examples
Basic usage:
```
let a = [1, 2, 3];
// the sum of all of the elements of the array
let sum = a.iter().fold(0, |acc, x| acc + x);
assert_eq!(sum, 6);
```
Let’s walk through each step of the iteration here:
| element | acc | x | result |
| --- | --- | --- | --- |
| | 0 | | |
| 1 | 0 | 1 | 1 |
| 2 | 1 | 2 | 3 |
| 3 | 3 | 3 | 6 |
And so, our final result, `6`.
This example demonstrates the left-associative nature of `fold()`: it builds a string, starting with an initial value and continuing with each element from the front until the back:
```
let numbers = [1, 2, 3, 4, 5];
let zero = "0".to_string();
let result = numbers.iter().fold(zero, |acc, &x| {
format!("({acc} + {x})")
});
assert_eq!(result, "(((((0 + 1) + 2) + 3) + 4) + 5)");
```
It’s common for people who haven’t used iterators a lot to use a `for` loop with a list of things to build up a result. Those can be turned into `fold()`s:
```
let numbers = [1, 2, 3, 4, 5];
let mut result = 0;
// for loop:
for i in &numbers {
result = result + i;
}
// fold:
let result2 = numbers.iter().fold(0, |acc, &x| acc + x);
// they're the same
assert_eq!(result, result2);
```
[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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"),
Reduces the elements to a single one, by repeatedly applying a reducing operation.
If the iterator is empty, returns [`None`](../option/enum.option#variant.None "None"); otherwise, returns the result of the reduction.
The reducing function is a closure with two arguments: an ‘accumulator’, and an element. For iterators with at least one element, this is the same as [`fold()`](trait.iterator#method.fold) with the first element of the iterator as the initial accumulator value, folding every subsequent element into it.
##### Example
Find the maximum value:
```
fn find_max<I>(iter: I) -> Option<I::Item>
where I: Iterator,
I::Item: Ord,
{
iter.reduce(|accum, item| {
if accum >= item { accum } else { item }
})
}
let a = [10, 20, 5, -23, 0];
let b: [u32; 0] = [];
assert_eq!(find_max(a.iter()), Some(&20));
assert_eq!(find_max(b.iter()), None);
```
[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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> R, R: [Try](../ops/trait.try "trait std::ops::Try")<Output = Self::[Item](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](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.
The return type of this method depends on the return type of the closure. If the closure returns `Result<Self::Item, E>`, then this function will return `Result<Option<Self::Item>, E>`. If the closure returns `Option<Self::Item>`, then this function will return `Option<Option<Self::Item>>`.
When called on an empty iterator, this function will return either `Some(None)` or `Ok(None)` depending on the type of the provided closure.
For iterators with at least one element, this is essentially the same as calling [`try_fold()`](trait.iterator#method.try_fold) with the first element of the iterator as the initial accumulator value.
##### Examples
Safely calculate the sum of a series of numbers:
```
#![feature(iterator_try_reduce)]
let numbers: Vec<usize> = vec![10, 20, 5, 23, 0];
let sum = numbers.into_iter().try_reduce(|x, y| x.checked_add(y));
assert_eq!(sum, Some(Some(58)));
```
Determine when a reduction short circuited:
```
#![feature(iterator_try_reduce)]
let numbers = vec![1, 2, 3, usize::MAX, 4, 5];
let sum = numbers.into_iter().try_reduce(|x, y| x.checked_add(y));
assert_eq!(sum, None);
```
Determine when a reduction was not performed because there are no elements:
```
#![feature(iterator_try_reduce)]
let numbers: Vec<usize> = Vec::new();
let sum = numbers.into_iter().try_reduce(|x, y| x.checked_add(y));
assert_eq!(sum, Some(None));
```
Use a [`Result`](../result/enum.result "Result") instead of an [`Option`](../option/enum.option "Option"):
```
#![feature(iterator_try_reduce)]
let numbers = vec!["1", "2", "3", "4", "5"];
let max: Result<Option<_>, <usize as std::str::FromStr>::Err> =
numbers.into_iter().try_reduce(|x, y| {
if x.parse::<usize>()? > y.parse::<usize>()? { Ok(x) } else { Ok(y) }
});
assert_eq!(max, Ok(Some("5")));
```
[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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool),
Tests if every element of the iterator matches a predicate.
`all()` takes a closure that returns `true` or `false`. It applies this closure to each element of the iterator, and if they all return `true`, then so does `all()`. If any of them return `false`, it returns `false`.
`all()` is short-circuiting; in other words, it will stop processing as soon as it finds a `false`, given that no matter what else happens, the result will also be `false`.
An empty iterator returns `true`.
##### Examples
Basic usage:
```
let a = [1, 2, 3];
assert!(a.iter().all(|&x| x > 0));
assert!(!a.iter().all(|&x| x > 2));
```
Stopping at the first `false`:
```
let a = [1, 2, 3];
let mut iter = a.iter();
assert!(!iter.all(|&x| x != 2));
// we can still use `iter`, as there are more elements.
assert_eq!(iter.next(), Some(&3));
```
[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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool),
Tests if any element of the iterator matches a predicate.
`any()` takes a closure that returns `true` or `false`. It applies this closure to each element of the iterator, and if any of them return `true`, then so does `any()`. If they all return `false`, it returns `false`.
`any()` is short-circuiting; in other words, it will stop processing as soon as it finds a `true`, given that no matter what else happens, the result will also be `true`.
An empty iterator returns `false`.
##### Examples
Basic usage:
```
let a = [1, 2, 3];
assert!(a.iter().any(|&x| x > 0));
assert!(!a.iter().any(|&x| x > 5));
```
Stopping at the first `true`:
```
let a = [1, 2, 3];
let mut iter = a.iter();
assert!(iter.any(|&x| x != 2));
// we can still use `iter`, as there are more elements.
assert_eq!(iter.next(), Some(&2));
```
[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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool),
Searches for an element of an iterator that satisfies a predicate.
`find()` takes a closure that returns `true` or `false`. It applies this closure to each element of the iterator, and if any of them return `true`, then `find()` returns [`Some(element)`](../option/enum.option#variant.Some). If they all return `false`, it returns [`None`](../option/enum.option#variant.None "None").
`find()` is short-circuiting; in other words, it will stop processing as soon as the closure returns `true`.
Because `find()` takes a reference, and many iterators iterate over references, this leads to a possibly confusing situation where the argument is a double reference. You can see this effect in the examples below, with `&&x`.
##### Examples
Basic usage:
```
let a = [1, 2, 3];
assert_eq!(a.iter().find(|&&x| x == 2), Some(&2));
assert_eq!(a.iter().find(|&&x| x == 5), None);
```
Stopping at the first `true`:
```
let a = [1, 2, 3];
let mut iter = a.iter();
assert_eq!(iter.find(|&&x| x == 2), Some(&2));
// we can still use `iter`, as there are more elements.
assert_eq!(iter.next(), Some(&3));
```
Note that `iter.find(f)` is equivalent to `iter.filter(f).next()`.
[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](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.
`iter.find_map(f)` is equivalent to `iter.filter_map(f).next()`.
##### Examples
```
let a = ["lol", "NaN", "2", "5"];
let first_number = a.iter().find_map(|s| s.parse().ok());
assert_eq!(first_number, Some(2));
```
[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](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](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.
The return type of this method depends on the return type of the closure. If you return `Result<bool, E>` from the closure, you’ll get a `Result<Option<Self::Item>; E>`. If you return `Option<bool>` from the closure, you’ll get an `Option<Option<Self::Item>>`.
##### Examples
```
#![feature(try_find)]
let a = ["1", "2", "lol", "NaN", "5"];
let is_my_num = |s: &str, search: i32| -> Result<bool, std::num::ParseIntError> {
Ok(s.parse::<i32>()? == search)
};
let result = a.iter().try_find(|&&s| is_my_num(s, 2));
assert_eq!(result, Ok(Some(&"2")));
let result = a.iter().try_find(|&&s| is_my_num(s, 5));
assert!(result.is_err());
```
This also supports other types which implement `Try`, not just `Result`.
```
#![feature(try_find)]
use std::num::NonZeroU32;
let a = [3, 5, 7, 4, 9, 0, 11];
let result = a.iter().try_find(|&&x| NonZeroU32::new(x).map(|y| y.is_power_of_two()));
assert_eq!(result, Some(Some(&4)));
let result = a.iter().take(3).try_find(|&&x| NonZeroU32::new(x).map(|y| y.is_power_of_two()));
assert_eq!(result, Some(None));
let result = a.iter().rev().try_find(|&&x| NonZeroU32::new(x).map(|y| y.is_power_of_two()));
assert_eq!(result, None);
```
[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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool),
Searches for an element in an iterator, returning its index.
`position()` takes a closure that returns `true` or `false`. It applies this closure to each element of the iterator, and if one of them returns `true`, then `position()` returns [`Some(index)`](../option/enum.option#variant.Some). If all of them return `false`, it returns [`None`](../option/enum.option#variant.None "None").
`position()` is short-circuiting; in other words, it will stop processing as soon as it finds a `true`.
##### Overflow Behavior
The method does no guarding against overflows, so if there are more than [`usize::MAX`](../primitive.usize#associatedconstant.MAX "usize::MAX") non-matching elements, it either produces the wrong result or panics. If debug assertions are enabled, a panic is guaranteed.
##### Panics
This function might panic if the iterator has more than `usize::MAX` non-matching elements.
##### Examples
Basic usage:
```
let a = [1, 2, 3];
assert_eq!(a.iter().position(|&x| x == 2), Some(1));
assert_eq!(a.iter().position(|&x| x == 5), None);
```
Stopping at the first `true`:
```
let a = [1, 2, 3, 4];
let mut iter = a.iter();
assert_eq!(iter.position(|&x| x >= 2), Some(1));
// we can still use `iter`, as there are more elements.
assert_eq!(iter.next(), Some(&3));
// The returned index depends on iterator state
assert_eq!(iter.position(|&x| x == 4), Some(0));
```
[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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), Self: [ExactSizeIterator](trait.exactsizeiterator "trait std::iter::ExactSizeIterator") + [DoubleEndedIterator](trait.doubleendediterator "trait std::iter::DoubleEndedIterator"),
Searches for an element in an iterator from the right, returning its index.
`rposition()` takes a closure that returns `true` or `false`. It applies this closure to each element of the iterator, starting from the end, and if one of them returns `true`, then `rposition()` returns [`Some(index)`](../option/enum.option#variant.Some). If all of them return `false`, it returns [`None`](../option/enum.option#variant.None "None").
`rposition()` is short-circuiting; in other words, it will stop processing as soon as it finds a `true`.
##### Examples
Basic usage:
```
let a = [1, 2, 3];
assert_eq!(a.iter().rposition(|&x| x == 3), Some(2));
assert_eq!(a.iter().rposition(|&x| x == 5), None);
```
Stopping at the first `true`:
```
let a = [1, 2, 3];
let mut iter = a.iter();
assert_eq!(iter.rposition(|&x| x == 2), Some(1));
// we can still use `iter`, as there are more elements.
assert_eq!(iter.next(), Some(&1));
```
[source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#2971-2974)#### fn max(self) -> Option<Self::Item>where Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [Ord](../cmp/trait.ord "trait std::cmp::Ord"),
Returns the maximum element of an iterator.
If several elements are equally maximum, the last element is returned. If the iterator is empty, [`None`](../option/enum.option#variant.None "None") is returned.
Note that [`f32`](../primitive.f32 "f32")/[`f64`](../primitive.f64 "f64") doesn’t implement [`Ord`](../cmp/trait.ord "Ord") due to NaN being incomparable. You can work around this by using [`Iterator::reduce`](trait.iterator#method.reduce "Iterator::reduce"):
```
assert_eq!(
[2.4, f32::NAN, 1.3]
.into_iter()
.reduce(f32::max)
.unwrap(),
2.4
);
```
##### Examples
Basic usage:
```
let a = [1, 2, 3];
let b: Vec<u32> = Vec::new();
assert_eq!(a.iter().max(), Some(&3));
assert_eq!(b.iter().max(), None);
```
[source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3009-3012)#### fn min(self) -> Option<Self::Item>where Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [Ord](../cmp/trait.ord "trait std::cmp::Ord"),
Returns the minimum element of an iterator.
If several elements are equally minimum, the first element is returned. If the iterator is empty, [`None`](../option/enum.option#variant.None "None") is returned.
Note that [`f32`](../primitive.f32 "f32")/[`f64`](../primitive.f64 "f64") doesn’t implement [`Ord`](../cmp/trait.ord "Ord") due to NaN being incomparable. You can work around this by using [`Iterator::reduce`](trait.iterator#method.reduce "Iterator::reduce"):
```
assert_eq!(
[2.4, f32::NAN, 1.3]
.into_iter()
.reduce(f32::min)
.unwrap(),
1.3
);
```
##### Examples
Basic usage:
```
let a = [1, 2, 3];
let b: Vec<u32> = Vec::new();
assert_eq!(a.iter().min(), Some(&1));
assert_eq!(b.iter().min(), None);
```
[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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> B,
Returns the element that gives the maximum value from the specified function.
If several elements are equally maximum, the last element is returned. If the iterator is empty, [`None`](../option/enum.option#variant.None "None") is returned.
##### Examples
```
let a = [-3_i32, 0, 1, 5, -10];
assert_eq!(*a.iter().max_by_key(|x| x.abs()).unwrap(), -10);
```
[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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), &Self::[Item](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.
If several elements are equally maximum, the last element is returned. If the iterator is empty, [`None`](../option/enum.option#variant.None "None") is returned.
##### Examples
```
let a = [-3_i32, 0, 1, 5, -10];
assert_eq!(*a.iter().max_by(|x, y| x.cmp(y)).unwrap(), 5);
```
[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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> B,
Returns the element that gives the minimum value from the specified function.
If several elements are equally minimum, the first element is returned. If the iterator is empty, [`None`](../option/enum.option#variant.None "None") is returned.
##### Examples
```
let a = [-3_i32, 0, 1, 5, -10];
assert_eq!(*a.iter().min_by_key(|x| x.abs()).unwrap(), 0);
```
[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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), &Self::[Item](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.
If several elements are equally minimum, the first element is returned. If the iterator is empty, [`None`](../option/enum.option#variant.None "None") is returned.
##### Examples
```
let a = [-3_i32, 0, 1, 5, -10];
assert_eq!(*a.iter().min_by(|x, y| x.cmp(y)).unwrap(), -10);
```
[source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3161-3163)#### fn rev(self) -> Rev<Self>where Self: [DoubleEndedIterator](trait.doubleendediterator "trait std::iter::DoubleEndedIterator"),
Notable traits for [Rev](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.
Usually, iterators iterate from left to right. After using `rev()`, an iterator will instead iterate from right to left.
This is only possible if the iterator has an end, so `rev()` only works on [`DoubleEndedIterator`](trait.doubleendediterator "DoubleEndedIterator")s.
##### Examples
```
let a = [1, 2, 3];
let mut iter = a.iter().rev();
assert_eq!(iter.next(), Some(&3));
assert_eq!(iter.next(), Some(&2));
assert_eq!(iter.next(), Some(&1));
assert_eq!(iter.next(), None);
```
[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](trait.extend "trait std::iter::Extend")<A>, FromB: [Default](../default/trait.default "trait std::default::Default") + [Extend](trait.extend "trait std::iter::Extend")<B>, Self: [Iterator](trait.iterator "trait std::iter::Iterator")<Item = [(A, B)](../primitive.tuple)>,
Converts an iterator of pairs into a pair of containers.
`unzip()` consumes an entire iterator of pairs, producing two collections: one from the left elements of the pairs, and one from the right elements.
This function is, in some sense, the opposite of [`zip`](trait.iterator#method.zip).
##### Examples
Basic usage:
```
let a = [(1, 2), (3, 4), (5, 6)];
let (left, right): (Vec<_>, Vec<_>) = a.iter().cloned().unzip();
assert_eq!(left, [1, 3, 5]);
assert_eq!(right, [2, 4, 6]);
// you can also unzip multiple nested tuples at once
let a = [(1, (2, 3)), (4, (5, 6))];
let (x, (y, z)): (Vec<_>, (Vec<_>, Vec<_>)) = a.iter().cloned().unzip();
assert_eq!(x, [1, 4]);
assert_eq!(y, [2, 5]);
assert_eq!(z, [3, 6]);
```
[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](trait.iterator "trait std::iter::Iterator")<Item = [&'a](../primitive.reference) T>,
Notable traits for [Copied](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.
This is useful when you have an iterator over `&T`, but you need an iterator over `T`.
##### Examples
Basic usage:
```
let a = [1, 2, 3];
let v_copied: Vec<_> = a.iter().copied().collect();
// copied is the same as .map(|&x| x)
let v_map: Vec<_> = a.iter().map(|&x| x).collect();
assert_eq!(v_copied, vec![1, 2, 3]);
assert_eq!(v_map, vec![1, 2, 3]);
```
[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](trait.iterator "trait std::iter::Iterator")<Item = [&'a](../primitive.reference) T>,
Notable traits for [Cloned](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.
This is useful when you have an iterator over `&T`, but you need an iterator over `T`.
There is no guarantee whatsoever about the `clone` method actually being called *or* optimized away. So code should not depend on either.
##### Examples
Basic usage:
```
let a = [1, 2, 3];
let v_cloned: Vec<_> = a.iter().cloned().collect();
// cloned is the same as .map(|&x| x), for integers
let v_map: Vec<_> = a.iter().map(|&x| x).collect();
assert_eq!(v_cloned, vec![1, 2, 3]);
assert_eq!(v_map, vec![1, 2, 3]);
```
To get the best performance, try to clone late:
```
let a = [vec![0_u8, 1, 2], vec![3, 4], vec![23]];
// don't do this:
let slower: Vec<_> = a.iter().cloned().filter(|s| s.len() == 1).collect();
assert_eq!(&[vec![23]], &slower[..]);
// instead call `cloned` late
let faster: Vec<_> = a.iter().filter(|s| s.len() == 1).cloned().collect();
assert_eq!(&[vec![23]], &faster[..]);
```
[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](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.
Instead of stopping at [`None`](../option/enum.option#variant.None "None"), the iterator will instead start again, from the beginning. After iterating again, it will start at the beginning again. And again. And again. Forever. Note that in case the original iterator is empty, the resulting iterator will also be empty.
##### Examples
Basic usage:
```
let a = [1, 2, 3];
let mut it = a.iter().cycle();
assert_eq!(it.next(), Some(&1));
assert_eq!(it.next(), Some(&2));
assert_eq!(it.next(), Some(&3));
assert_eq!(it.next(), Some(&1));
assert_eq!(it.next(), Some(&2));
assert_eq!(it.next(), Some(&3));
assert_eq!(it.next(), Some(&1));
```
[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](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.
The chunks do not overlap. If `N` does not divide the length of the iterator, then the last up to `N-1` elements will be omitted and can be retrieved from the [`.into_remainder()`](struct.arraychunks#method.into_remainder "ArrayChunks::into_remainder") function of the iterator.
##### Panics
Panics if `N` is 0.
##### Examples
Basic usage:
```
#![feature(iter_array_chunks)]
let mut iter = "lorem".chars().array_chunks();
assert_eq!(iter.next(), Some(['l', 'o']));
assert_eq!(iter.next(), Some(['r', 'e']));
assert_eq!(iter.next(), None);
assert_eq!(iter.into_remainder().unwrap().as_slice(), &['m']);
```
```
#![feature(iter_array_chunks)]
let data = [1, 1, 2, -2, 6, 0, 3, 1];
// ^-----^ ^------^
for [x, y, z] in data.iter().array_chunks() {
assert_eq!(x + y + z, 4);
}
```
[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](trait.sum "trait std::iter::Sum")<Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>,
Sums the elements of an iterator.
Takes each element, adds them together, and returns the result.
An empty iterator returns the zero value of the type.
##### Panics
When calling `sum()` and a primitive integer type is being returned, this method will panic if the computation overflows and debug assertions are enabled.
##### Examples
Basic usage:
```
let a = [1, 2, 3];
let sum: i32 = a.iter().sum();
assert_eq!(sum, 6);
```
[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](trait.product "trait std::iter::Product")<Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>,
Iterates over the entire iterator, multiplying all the elements
An empty iterator returns the one value of the type.
##### Panics
When calling `product()` and a primitive integer type is being returned, method will panic if the computation overflows and debug assertions are enabled.
##### Examples
```
fn factorial(n: u32) -> u32 {
(1..=n).product()
}
assert_eq!(factorial(0), 1);
assert_eq!(factorial(1), 1);
assert_eq!(factorial(5), 120);
```
[source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3435-3439)1.5.0 · #### fn cmp<I>(self, other: I) -> Orderingwhere I: [IntoIterator](trait.intoiterator "trait std::iter::IntoIterator")<Item = Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>, Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [Ord](../cmp/trait.ord "trait std::cmp::Ord"),
[Lexicographically](../cmp/trait.ord#lexicographical-comparison) compares the elements of this [`Iterator`](trait.iterator "Iterator") with those of another.
##### Examples
```
use std::cmp::Ordering;
assert_eq!([1].iter().cmp([1].iter()), Ordering::Equal);
assert_eq!([1].iter().cmp([1, 2].iter()), Ordering::Less);
assert_eq!([1, 2].iter().cmp([1].iter()), Ordering::Greater);
```
[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](trait.intoiterator "trait std::iter::IntoIterator"), F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), <I as [IntoIterator](trait.intoiterator "trait std::iter::IntoIterator")>::[Item](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`](trait.iterator "Iterator") with those of another with respect to the specified comparison function.
##### Examples
Basic usage:
```
#![feature(iter_order_by)]
use std::cmp::Ordering;
let xs = [1, 2, 3, 4];
let ys = [1, 4, 9, 16];
assert_eq!(xs.iter().cmp_by(&ys, |&x, &y| x.cmp(&y)), Ordering::Less);
assert_eq!(xs.iter().cmp_by(&ys, |&x, &y| (x * x).cmp(&y)), Ordering::Equal);
assert_eq!(xs.iter().cmp_by(&ys, |&x, &y| (2 * x).cmp(&y)), Ordering::Greater);
```
[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](trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<<I as [IntoIterator](trait.intoiterator "trait std::iter::IntoIterator")>::[Item](trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>,
[Lexicographically](../cmp/trait.ord#lexicographical-comparison) compares the elements of this [`Iterator`](trait.iterator "Iterator") with those of another.
##### Examples
```
use std::cmp::Ordering;
assert_eq!([1.].iter().partial_cmp([1.].iter()), Some(Ordering::Equal));
assert_eq!([1.].iter().partial_cmp([1., 2.].iter()), Some(Ordering::Less));
assert_eq!([1., 2.].iter().partial_cmp([1.].iter()), Some(Ordering::Greater));
assert_eq!([f64::NAN].iter().partial_cmp([1.].iter()), None);
```
[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](trait.intoiterator "trait std::iter::IntoIterator"), F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), <I as [IntoIterator](trait.intoiterator "trait std::iter::IntoIterator")>::[Item](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`](trait.iterator "Iterator") with those of another with respect to the specified comparison function.
##### Examples
Basic usage:
```
#![feature(iter_order_by)]
use std::cmp::Ordering;
let xs = [1.0, 2.0, 3.0, 4.0];
let ys = [1.0, 4.0, 9.0, 16.0];
assert_eq!(
xs.iter().partial_cmp_by(&ys, |&x, &y| x.partial_cmp(&y)),
Some(Ordering::Less)
);
assert_eq!(
xs.iter().partial_cmp_by(&ys, |&x, &y| (x * x).partial_cmp(&y)),
Some(Ordering::Equal)
);
assert_eq!(
xs.iter().partial_cmp_by(&ys, |&x, &y| (2.0 * x).partial_cmp(&y)),
Some(Ordering::Greater)
);
```
[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](trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialEq](../cmp/trait.partialeq "trait std::cmp::PartialEq")<<I as [IntoIterator](trait.intoiterator "trait std::iter::IntoIterator")>::[Item](trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>,
Determines if the elements of this [`Iterator`](trait.iterator "Iterator") are equal to those of another.
##### Examples
```
assert_eq!([1].iter().eq([1].iter()), true);
assert_eq!([1].iter().eq([1, 2].iter()), false);
```
[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](trait.intoiterator "trait std::iter::IntoIterator"), F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), <I as [IntoIterator](trait.intoiterator "trait std::iter::IntoIterator")>::[Item](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`](trait.iterator "Iterator") are equal to those of another with respect to the specified equality function.
##### Examples
Basic usage:
```
#![feature(iter_order_by)]
let xs = [1, 2, 3, 4];
let ys = [1, 4, 9, 16];
assert!(xs.iter().eq_by(&ys, |&x, &y| x * x == y));
```
[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](trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialEq](../cmp/trait.partialeq "trait std::cmp::PartialEq")<<I as [IntoIterator](trait.intoiterator "trait std::iter::IntoIterator")>::[Item](trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>,
Determines if the elements of this [`Iterator`](trait.iterator "Iterator") are unequal to those of another.
##### Examples
```
assert_eq!([1].iter().ne([1].iter()), false);
assert_eq!([1].iter().ne([1, 2].iter()), true);
```
[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](trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<<I as [IntoIterator](trait.intoiterator "trait std::iter::IntoIterator")>::[Item](trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>,
Determines if the elements of this [`Iterator`](trait.iterator "Iterator") are [lexicographically](../cmp/trait.ord#lexicographical-comparison) less than those of another.
##### Examples
```
assert_eq!([1].iter().lt([1].iter()), false);
assert_eq!([1].iter().lt([1, 2].iter()), true);
assert_eq!([1, 2].iter().lt([1].iter()), false);
assert_eq!([1, 2].iter().lt([1, 2].iter()), false);
```
[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](trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<<I as [IntoIterator](trait.intoiterator "trait std::iter::IntoIterator")>::[Item](trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>,
Determines if the elements of this [`Iterator`](trait.iterator "Iterator") are [lexicographically](../cmp/trait.ord#lexicographical-comparison) less or equal to those of another.
##### Examples
```
assert_eq!([1].iter().le([1].iter()), true);
assert_eq!([1].iter().le([1, 2].iter()), true);
assert_eq!([1, 2].iter().le([1].iter()), false);
assert_eq!([1, 2].iter().le([1, 2].iter()), true);
```
[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](trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<<I as [IntoIterator](trait.intoiterator "trait std::iter::IntoIterator")>::[Item](trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>,
Determines if the elements of this [`Iterator`](trait.iterator "Iterator") are [lexicographically](../cmp/trait.ord#lexicographical-comparison) greater than those of another.
##### Examples
```
assert_eq!([1].iter().gt([1].iter()), false);
assert_eq!([1].iter().gt([1, 2].iter()), false);
assert_eq!([1, 2].iter().gt([1].iter()), true);
assert_eq!([1, 2].iter().gt([1, 2].iter()), false);
```
[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](trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<<I as [IntoIterator](trait.intoiterator "trait std::iter::IntoIterator")>::[Item](trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>,
Determines if the elements of this [`Iterator`](trait.iterator "Iterator") are [lexicographically](../cmp/trait.ord#lexicographical-comparison) greater than or equal to those of another.
##### Examples
```
assert_eq!([1].iter().ge([1].iter()), true);
assert_eq!([1].iter().ge([1, 2].iter()), false);
assert_eq!([1, 2].iter().ge([1].iter()), true);
assert_eq!([1, 2].iter().ge([1, 2].iter()), true);
```
[source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3766-3769)#### fn is\_sorted(self) -> boolwhere Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>,
🔬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.
That is, for each element `a` and its following element `b`, `a <= b` must hold. If the iterator 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)]
assert!([1, 2, 2, 9].iter().is_sorted());
assert!(![1, 3, 2, 4].iter().is_sorted());
assert!([0].iter().is_sorted());
assert!(std::iter::empty::<i32>().is_sorted());
assert!(![0.0, 1.0, f32::NAN].iter().is_sorted());
```
[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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), &Self::[Item](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.
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`](trait.iterator#method.is_sorted); see its documentation for more information.
##### Examples
```
#![feature(is_sorted)]
assert!([1, 2, 2, 9].iter().is_sorted_by(|a, b| a.partial_cmp(b)));
assert!(![1, 3, 2, 4].iter().is_sorted_by(|a, b| a.partial_cmp(b)));
assert!([0].iter().is_sorted_by(|a, b| a.partial_cmp(b)));
assert!(std::iter::empty::<i32>().is_sorted_by(|a, b| a.partial_cmp(b)));
assert!(![0.0, 1.0, f32::NAN].iter().is_sorted_by(|a, b| a.partial_cmp(b)));
```
[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](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.
Instead of comparing the iterator’s elements directly, this function compares the keys of the elements, as determined by `f`. Apart from that, it’s equivalent to [`is_sorted`](trait.iterator#method.is_sorted); see its documentation for more information.
##### Examples
```
#![feature(is_sorted)]
assert!(["c", "bb", "aaa"].iter().is_sorted_by_key(|s| s.len()));
assert!(![-2i32, -1, 0, 3].iter().is_sorted_by_key(|n| n.abs()));
```
Implementors
------------
[source](https://doc.rust-lang.org/src/core/ascii.rs.html#111)### impl Iterator for std::ascii::EscapeDefault
#### type Item = u8
[source](https://doc.rust-lang.org/src/core/char/mod.rs.html#382)1.20.0 · ### impl Iterator for std::char::EscapeDebug
#### type Item = char
[source](https://doc.rust-lang.org/src/core/char/mod.rs.html#284)### impl Iterator for std::char::EscapeDefault
#### type Item = char
[source](https://doc.rust-lang.org/src/core/char/mod.rs.html#174)### impl Iterator for std::char::EscapeUnicode
#### type Item = char
[source](https://doc.rust-lang.org/src/core/char/mod.rs.html#416)### impl Iterator for ToLowercase
#### type Item = char
[source](https://doc.rust-lang.org/src/core/char/mod.rs.html#450)### impl Iterator for ToUppercase
#### type Item = char
[source](https://doc.rust-lang.org/src/std/env.rs.html#802-810)### impl Iterator for Args
#### type Item = String
[source](https://doc.rust-lang.org/src/std/env.rs.html#843-851)### impl Iterator for ArgsOs
#### type Item = OsString
[source](https://doc.rust-lang.org/src/std/env.rs.html#168-176)### impl Iterator for Vars
#### type Item = (String, String)
[source](https://doc.rust-lang.org/src/std/env.rs.html#186-194)### impl Iterator for VarsOs
#### type Item = (OsString, OsString)
[source](https://doc.rust-lang.org/src/std/fs.rs.html#1539-1545)### impl Iterator for ReadDir
#### type Item = Result<DirEntry, Error>
[source](https://doc.rust-lang.org/src/std/net/tcp.rs.html#1017-1022)### impl Iterator for IntoIncoming
#### type Item = Result<TcpStream, Error>
[source](https://doc.rust-lang.org/src/core/str/iter.rs.html#232)### impl Iterator for std::str::Bytes<'\_>
#### type Item = u8
[source](https://doc.rust-lang.org/src/alloc/string.rs.html#2928)1.6.0 · ### impl Iterator for std::string::Drain<'\_>
#### type Item = char
[source](https://doc.rust-lang.org/src/core/error.rs.html#425)### impl<'a> Iterator for Source<'a>
#### type Item = &'a (dyn Error + 'static)
[source](https://doc.rust-lang.org/src/std/env.rs.html#440-448)### impl<'a> Iterator for SplitPaths<'a>
#### type Item = PathBuf
[source](https://doc.rust-lang.org/src/std/net/tcp.rs.html#1006-1011)### impl<'a> Iterator for std::net::Incoming<'a>
#### type Item = Result<TcpStream, Error>
[source](https://doc.rust-lang.org/src/std/os/unix/net/listener.rs.html#381-391)1.10.0 · ### impl<'a> Iterator for std::os::unix::net::Incoming<'a>
Available on **Unix** only.#### type Item = Result<UnixStream, Error>
[source](https://doc.rust-lang.org/src/std/os/unix/net/ancillary.rs.html#421-452)### impl<'a> Iterator for Messages<'a>
Available on **(Android or Linux) and Unix** only.#### type Item = Result<AncillaryData<'a>, AncillaryError>
[source](https://doc.rust-lang.org/src/std/os/unix/net/ancillary.rs.html#336-342)### impl<'a> Iterator for ScmCredentials<'a>
Available on **(Android or Linux) and Unix** only.#### type Item = SocketCred
[source](https://doc.rust-lang.org/src/std/os/unix/net/ancillary.rs.html#311-317)### impl<'a> Iterator for ScmRights<'a>
Available on **(Android or Linux) and Unix** only.#### type Item = i32
[source](https://doc.rust-lang.org/src/std/sys_common/wtf8.rs.html#929-959)### impl<'a> Iterator for EncodeWide<'a>
#### type Item = u16
[source](https://doc.rust-lang.org/src/std/path.rs.html#1094-1103)1.28.0 · ### impl<'a> Iterator for Ancestors<'a>
#### type Item = &'a Path
[source](https://doc.rust-lang.org/src/std/path.rs.html#888-938)### impl<'a> Iterator for Components<'a>
#### type Item = Component<'a>
[source](https://doc.rust-lang.org/src/std/path.rs.html#867-874)### impl<'a> Iterator for std::path::Iter<'a>
#### type Item = &'a OsStr
[source](https://doc.rust-lang.org/src/std/process.rs.html#1068-1076)1.57.0 · ### impl<'a> Iterator for CommandArgs<'a>
#### type Item = &'a OsStr
[source](https://doc.rust-lang.org/src/std/sys_common/process.rs.html#101-109)1.57.0 · ### impl<'a> Iterator for CommandEnvs<'a>
#### type Item = (&'a OsStr, Option<&'a OsStr>)
[source](https://doc.rust-lang.org/src/core/slice/ascii.rs.html#180)1.60.0 · ### impl<'a> Iterator for EscapeAscii<'a>
#### type Item = u8
[source](https://doc.rust-lang.org/src/core/str/iter.rs.html#134)### impl<'a> Iterator for CharIndices<'a>
#### type Item = (usize, char)
[source](https://doc.rust-lang.org/src/core/str/iter.rs.html#37)### impl<'a> Iterator for Chars<'a>
#### type Item = char
[source](https://doc.rust-lang.org/src/core/str/iter.rs.html#1402)1.8.0 · ### impl<'a> Iterator for EncodeUtf16<'a>
#### type Item = u16
[source](https://doc.rust-lang.org/src/core/str/iter.rs.html#1499)1.34.0 · ### impl<'a> Iterator for std::str::EscapeDebug<'a>
#### type Item = char
[source](https://doc.rust-lang.org/src/core/str/iter.rs.html#1499)1.34.0 · ### impl<'a> Iterator for std::str::EscapeDefault<'a>
#### type Item = char
[source](https://doc.rust-lang.org/src/core/str/iter.rs.html#1499)1.34.0 · ### impl<'a> Iterator for std::str::EscapeUnicode<'a>
#### type Item = char
[source](https://doc.rust-lang.org/src/core/str/iter.rs.html#1097)### impl<'a> Iterator for std::str::Lines<'a>
#### type Item = &'a str
[source](https://doc.rust-lang.org/src/core/str/iter.rs.html#1139)### impl<'a> Iterator for LinesAny<'a>
#### type Item = &'a str
[source](https://doc.rust-lang.org/src/core/str/iter.rs.html#1262)1.34.0 · ### impl<'a> Iterator for SplitAsciiWhitespace<'a>
#### type Item = &'a str
[source](https://doc.rust-lang.org/src/core/str/iter.rs.html#1206)1.1.0 · ### impl<'a> Iterator for SplitWhitespace<'a>
#### type Item = &'a str
[source](https://doc.rust-lang.org/src/core/str/lossy.rs.html#164)### impl<'a> Iterator for Utf8Chunks<'a>
#### type Item = Utf8Chunk<'a>
[source](https://doc.rust-lang.org/src/core/option.rs.html#2088)### impl<'a, A> Iterator for std::option::Iter<'a, A>
#### type Item = &'a A
[source](https://doc.rust-lang.org/src/core/option.rs.html#2138)### impl<'a, A> Iterator for std::option::IterMut<'a, A>
#### type Item = &'a mut A
[source](https://doc.rust-lang.org/src/core/iter/adapters/cloned.rs.html#32)1.1.0 · ### impl<'a, I, T> Iterator for Cloned<I>where T: 'a + [Clone](../clone/trait.clone "trait std::clone::Clone"), I: [Iterator](trait.iterator "trait std::iter::Iterator")<Item = [&'a](../primitive.reference) T>,
#### type Item = T
[source](https://doc.rust-lang.org/src/core/iter/adapters/copied.rs.html#36)1.36.0 · ### impl<'a, I, T> Iterator for Copied<I>where T: 'a + [Copy](../marker/trait.copy "trait std::marker::Copy"), I: [Iterator](trait.iterator "trait std::iter::Iterator")<Item = [&'a](../primitive.reference) T>,
#### type Item = T
[source](https://doc.rust-lang.org/src/std/collections/hash/set.rs.html#1557-1568)### impl<'a, K> Iterator for std::collections::hash\_set::Drain<'a, K>
#### type Item = K
[source](https://doc.rust-lang.org/src/std/collections/hash/set.rs.html#1497-1508)### impl<'a, K> Iterator for std::collections::hash\_set::Iter<'a, K>
#### type Item = &'a K
[source](https://doc.rust-lang.org/src/alloc/collections/btree/map.rs.html#1485)### impl<'a, K, V> Iterator for std::collections::btree\_map::Iter<'a, K, V>where K: 'a, V: 'a,
#### type Item = (&'a K, &'a V)
[source](https://doc.rust-lang.org/src/alloc/collections/btree/map.rs.html#1554)### impl<'a, K, V> Iterator for std::collections::btree\_map::IterMut<'a, K, V>
#### type Item = (&'a K, &'a mut V)
[source](https://doc.rust-lang.org/src/alloc/collections/btree/map.rs.html#1726)### impl<'a, K, V> Iterator for std::collections::btree\_map::Keys<'a, K, V>
#### type Item = &'a K
[source](https://doc.rust-lang.org/src/alloc/collections/btree/map.rs.html#1931)1.17.0 · ### impl<'a, K, V> Iterator for std::collections::btree\_map::Range<'a, K, V>
#### type Item = (&'a K, &'a V)
[source](https://doc.rust-lang.org/src/alloc/collections/btree/map.rs.html#2079)1.17.0 · ### impl<'a, K, V> Iterator for RangeMut<'a, K, V>
#### type Item = (&'a K, &'a mut V)
[source](https://doc.rust-lang.org/src/alloc/collections/btree/map.rs.html#1775)### impl<'a, K, V> Iterator for std::collections::btree\_map::Values<'a, K, V>
#### type Item = &'a V
[source](https://doc.rust-lang.org/src/alloc/collections/btree/map.rs.html#1952)1.10.0 · ### impl<'a, K, V> Iterator for std::collections::btree\_map::ValuesMut<'a, K, V>
#### type Item = &'a mut V
[source](https://doc.rust-lang.org/src/std/collections/hash/map.rs.html#2451-2462)1.6.0 · ### impl<'a, K, V> Iterator for std::collections::hash\_map::Drain<'a, K, V>
#### type Item = (K, V)
[source](https://doc.rust-lang.org/src/std/collections/hash/map.rs.html#2227-2238)### impl<'a, K, V> Iterator for std::collections::hash\_map::Iter<'a, K, V>
#### type Item = (&'a K, &'a V)
[source](https://doc.rust-lang.org/src/std/collections/hash/map.rs.html#2251-2262)### impl<'a, K, V> Iterator for std::collections::hash\_map::IterMut<'a, K, V>
#### type Item = (&'a K, &'a mut V)
[source](https://doc.rust-lang.org/src/std/collections/hash/map.rs.html#2315-2326)### impl<'a, K, V> Iterator for std::collections::hash\_map::Keys<'a, K, V>
#### type Item = &'a K
[source](https://doc.rust-lang.org/src/std/collections/hash/map.rs.html#2338-2349)### impl<'a, K, V> Iterator for std::collections::hash\_map::Values<'a, K, V>
#### type Item = &'a V
[source](https://doc.rust-lang.org/src/std/collections/hash/map.rs.html#2361-2372)1.10.0 · ### impl<'a, K, V> Iterator for std::collections::hash\_map::ValuesMut<'a, K, V>
#### type Item = &'a mut V
[source](https://doc.rust-lang.org/src/core/str/iter.rs.html#1010-1026)1.5.0 · ### impl<'a, P> Iterator for MatchIndices<'a, P>where P: [Pattern](../str/pattern/trait.pattern "trait std::str::pattern::Pattern")<'a>,
#### type Item = (usize, &'a str)
[source](https://doc.rust-lang.org/src/core/str/iter.rs.html#1067-1083)1.2.0 · ### impl<'a, P> Iterator for Matches<'a, P>where P: [Pattern](../str/pattern/trait.pattern "trait std::str::pattern::Pattern")<'a>,
#### type Item = &'a str
[source](https://doc.rust-lang.org/src/core/str/iter.rs.html#1010-1026)1.5.0 · ### impl<'a, P> Iterator 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"): [ReverseSearcher](../str/pattern/trait.reversesearcher "trait std::str::pattern::ReverseSearcher")<'a>,
#### type Item = (usize, &'a str)
[source](https://doc.rust-lang.org/src/core/str/iter.rs.html#1067-1083)1.2.0 · ### impl<'a, P> Iterator 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"): [ReverseSearcher](../str/pattern/trait.reversesearcher "trait std::str::pattern::ReverseSearcher")<'a>,
#### type Item = &'a str
[source](https://doc.rust-lang.org/src/core/str/iter.rs.html#730-746)### impl<'a, P> Iterator 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"): [ReverseSearcher](../str/pattern/trait.reversesearcher "trait std::str::pattern::ReverseSearcher")<'a>,
#### type Item = &'a str
[source](https://doc.rust-lang.org/src/core/str/iter.rs.html#913-929)### impl<'a, P> Iterator for std::str::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"): [ReverseSearcher](../str/pattern/trait.reversesearcher "trait std::str::pattern::ReverseSearcher")<'a>,
#### type Item = &'a str
[source](https://doc.rust-lang.org/src/core/str/iter.rs.html#790-806)### impl<'a, P> Iterator 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"): [ReverseSearcher](../str/pattern/trait.reversesearcher "trait std::str::pattern::ReverseSearcher")<'a>,
#### type Item = &'a str
[source](https://doc.rust-lang.org/src/core/str/iter.rs.html#730-746)### impl<'a, P> Iterator for std::str::Split<'a, P>where P: [Pattern](../str/pattern/trait.pattern "trait std::str::pattern::Pattern")<'a>,
#### type Item = &'a str
[source](https://doc.rust-lang.org/src/core/str/iter.rs.html#1323)1.51.0 · ### impl<'a, P> Iterator for std::str::SplitInclusive<'a, P>where P: [Pattern](../str/pattern/trait.pattern "trait std::str::pattern::Pattern")<'a>,
#### type Item = &'a str
[source](https://doc.rust-lang.org/src/core/str/iter.rs.html#913-929)### impl<'a, P> Iterator for std::str::SplitN<'a, P>where P: [Pattern](../str/pattern/trait.pattern "trait std::str::pattern::Pattern")<'a>,
#### type Item = &'a str
[source](https://doc.rust-lang.org/src/core/str/iter.rs.html#790-806)### impl<'a, P> Iterator for SplitTerminator<'a, P>where P: [Pattern](../str/pattern/trait.pattern "trait std::str::pattern::Pattern")<'a>,
#### type Item = &'a str
[source](https://doc.rust-lang.org/src/alloc/collections/binary_heap.rs.html#1324)### impl<'a, T> Iterator for std::collections::binary\_heap::Iter<'a, T>
#### type Item = &'a T
[source](https://doc.rust-lang.org/src/alloc/collections/btree/set.rs.html#1492)### impl<'a, T> Iterator for std::collections::btree\_set::Iter<'a, T>
#### type Item = &'a T
[source](https://doc.rust-lang.org/src/alloc/collections/btree/set.rs.html#1567)1.17.0 · ### impl<'a, T> Iterator for std::collections::btree\_set::Range<'a, T>
#### type Item = &'a T
[source](https://doc.rust-lang.org/src/alloc/collections/btree/set.rs.html#1671)### impl<'a, T> Iterator for std::collections::btree\_set::SymmetricDifference<'a, T>where T: [Ord](../cmp/trait.ord "trait std::cmp::Ord"),
#### type Item = &'a T
[source](https://doc.rust-lang.org/src/alloc/collections/btree/set.rs.html#1766)### impl<'a, T> Iterator for std::collections::btree\_set::Union<'a, T>where T: [Ord](../cmp/trait.ord "trait std::cmp::Ord"),
#### type Item = &'a T
[source](https://doc.rust-lang.org/src/alloc/collections/linked_list.rs.html#1025)### impl<'a, T> Iterator for std::collections::linked\_list::Iter<'a, T>
#### type Item = &'a T
[source](https://doc.rust-lang.org/src/alloc/collections/linked_list.rs.html#1079)### impl<'a, T> Iterator for std::collections::linked\_list::IterMut<'a, T>
#### type Item = &'a mut T
[source](https://doc.rust-lang.org/src/alloc/collections/vec_deque/iter.rs.html#52)### impl<'a, T> Iterator for std::collections::vec\_deque::Iter<'a, T>
#### type Item = &'a T
[source](https://doc.rust-lang.org/src/alloc/collections/vec_deque/iter_mut.rs.html#52)### impl<'a, T> Iterator for std::collections::vec\_deque::IterMut<'a, T>
#### type Item = &'a mut T
[source](https://doc.rust-lang.org/src/core/result.rs.html#1893)### impl<'a, T> Iterator for std::result::Iter<'a, T>
#### type Item = &'a T
[source](https://doc.rust-lang.org/src/core/result.rs.html#1942)### impl<'a, T> Iterator for std::result::IterMut<'a, T>
#### type Item = &'a mut T
[source](https://doc.rust-lang.org/src/core/slice/iter.rs.html#1468)### impl<'a, T> Iterator for Chunks<'a, T>
#### type Item = &'a [T]
[source](https://doc.rust-lang.org/src/core/slice/iter.rs.html#1854)1.31.0 · ### impl<'a, T> Iterator for ChunksExact<'a, T>
#### type Item = &'a [T]
[source](https://doc.rust-lang.org/src/core/slice/iter.rs.html#2012)1.31.0 · ### impl<'a, T> Iterator for ChunksExactMut<'a, T>
#### type Item = &'a mut [T]
[source](https://doc.rust-lang.org/src/core/slice/iter.rs.html#1650)### impl<'a, T> Iterator for ChunksMut<'a, T>
#### type Item = &'a mut [T]
[source](https://doc.rust-lang.org/src/core/slice/iter.rs.html#135-145)### impl<'a, T> Iterator for std::slice::Iter<'a, T>
#### type Item = &'a T
[source](https://doc.rust-lang.org/src/core/slice/iter.rs.html#366)### impl<'a, T> Iterator for std::slice::IterMut<'a, T>
#### type Item = &'a mut T
[source](https://doc.rust-lang.org/src/core/slice/iter.rs.html#2532)1.31.0 · ### impl<'a, T> Iterator for RChunks<'a, T>
#### type Item = &'a [T]
[source](https://doc.rust-lang.org/src/core/slice/iter.rs.html#2912)1.31.0 · ### impl<'a, T> Iterator for RChunksExact<'a, T>
#### type Item = &'a [T]
[source](https://doc.rust-lang.org/src/core/slice/iter.rs.html#3072)1.31.0 · ### impl<'a, T> Iterator for RChunksExactMut<'a, T>
#### type Item = &'a mut [T]
[source](https://doc.rust-lang.org/src/core/slice/iter.rs.html#2704)1.31.0 · ### impl<'a, T> Iterator for RChunksMut<'a, T>
#### type Item = &'a mut [T]
[source](https://doc.rust-lang.org/src/core/slice/iter.rs.html#1320)### impl<'a, T> Iterator for Windows<'a, T>
#### type Item = &'a [T]
[source](https://doc.rust-lang.org/src/std/sync/mpsc/mod.rs.html#1455-1461)### impl<'a, T> Iterator for std::sync::mpsc::Iter<'a, T>
#### type Item = T
[source](https://doc.rust-lang.org/src/std/sync/mpsc/mod.rs.html#1464-1470)1.15.0 · ### impl<'a, T> Iterator for TryIter<'a, T>
#### type Item = T
[source](https://doc.rust-lang.org/src/alloc/collections/btree/set.rs.html#1615)### impl<'a, T, A> Iterator for std::collections::btree\_set::Difference<'a, T, A>where T: [Ord](../cmp/trait.ord "trait std::cmp::Ord"), A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator") + [Clone](../clone/trait.clone "trait std::clone::Clone"),
#### type Item = &'a T
[source](https://doc.rust-lang.org/src/alloc/collections/btree/set.rs.html#1716)### impl<'a, T, A> Iterator for std::collections::btree\_set::Intersection<'a, T, A>where T: [Ord](../cmp/trait.ord "trait std::cmp::Ord"), A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator") + [Clone](../clone/trait.clone "trait std::clone::Clone"),
#### type Item = &'a T
[source](https://doc.rust-lang.org/src/alloc/collections/btree/set.rs.html#1320)### impl<'a, T, F, A> Iterator 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: 'a + [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")([&](../primitive.reference)T) -> [bool](../primitive.bool),
#### type Item = T
[source](https://doc.rust-lang.org/src/core/slice/iter.rs.html#3236)### impl<'a, T, P> Iterator for GroupBy<'a, T, P>where T: 'a, P: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")([&](../primitive.reference)T, [&](../primitive.reference)T) -> [bool](../primitive.bool),
#### type Item = &'a [T]
[source](https://doc.rust-lang.org/src/core/slice/iter.rs.html#3323)### impl<'a, T, P> Iterator for GroupByMut<'a, T, P>where T: 'a, P: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")([&](../primitive.reference)T, [&](../primitive.reference)T) -> [bool](../primitive.bool),
#### type Item = &'a mut [T]
[source](https://doc.rust-lang.org/src/core/slice/iter.rs.html#951)1.27.0 · ### impl<'a, T, P> Iterator for std::slice::RSplit<'a, T, P>where P: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")([&](../primitive.reference)T) -> [bool](../primitive.bool),
#### type Item = &'a [T]
[source](https://doc.rust-lang.org/src/core/slice/iter.rs.html#1048)1.27.0 · ### impl<'a, T, P> Iterator for RSplitMut<'a, T, P>where P: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")([&](../primitive.reference)T) -> [bool](../primitive.bool),
#### type Item = &'a mut [T]
[source](https://doc.rust-lang.org/src/core/slice/iter.rs.html#1279)### impl<'a, T, P> Iterator for std::slice::RSplitN<'a, T, P>where P: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")([&](../primitive.reference)T) -> [bool](../primitive.bool),
#### type Item = &'a [T]
[source](https://doc.rust-lang.org/src/core/slice/iter.rs.html#1281)### impl<'a, T, P> Iterator for RSplitNMut<'a, T, P>where P: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")([&](../primitive.reference)T) -> [bool](../primitive.bool),
#### type Item = &'a mut [T]
[source](https://doc.rust-lang.org/src/core/slice/iter.rs.html#447)### impl<'a, T, P> Iterator for std::slice::Split<'a, T, P>where P: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")([&](../primitive.reference)T) -> [bool](../primitive.bool),
#### type Item = &'a [T]
[source](https://doc.rust-lang.org/src/core/slice/iter.rs.html#580)1.51.0 · ### impl<'a, T, P> Iterator for std::slice::SplitInclusive<'a, T, P>where P: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")([&](../primitive.reference)T) -> [bool](../primitive.bool),
#### type Item = &'a [T]
[source](https://doc.rust-lang.org/src/core/slice/iter.rs.html#819)1.51.0 · ### impl<'a, T, P> Iterator for SplitInclusiveMut<'a, T, P>where P: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")([&](../primitive.reference)T) -> [bool](../primitive.bool),
#### type Item = &'a mut [T]
[source](https://doc.rust-lang.org/src/core/slice/iter.rs.html#701)### impl<'a, T, P> Iterator for SplitMut<'a, T, P>where P: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")([&](../primitive.reference)T) -> [bool](../primitive.bool),
#### type Item = &'a mut [T]
[source](https://doc.rust-lang.org/src/core/slice/iter.rs.html#1278)### impl<'a, T, P> Iterator for std::slice::SplitN<'a, T, P>where P: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")([&](../primitive.reference)T) -> [bool](../primitive.bool),
#### type Item = &'a [T]
[source](https://doc.rust-lang.org/src/core/slice/iter.rs.html#1280)### impl<'a, T, P> Iterator for SplitNMut<'a, T, P>where P: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")([&](../primitive.reference)T) -> [bool](../primitive.bool),
#### type Item = &'a mut [T]
[source](https://doc.rust-lang.org/src/std/collections/hash/set.rs.html#1677-1699)### impl<'a, T, S> Iterator for std::collections::hash\_set::Difference<'a, T, S>where T: [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 Item = &'a T
[source](https://doc.rust-lang.org/src/std/collections/hash/set.rs.html#1625-1647)### impl<'a, T, S> Iterator for std::collections::hash\_set::Intersection<'a, T, S>where T: [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 Item = &'a T
[source](https://doc.rust-lang.org/src/std/collections/hash/set.rs.html#1729-1744)### impl<'a, T, S> Iterator for std::collections::hash\_set::SymmetricDifference<'a, T, S>where T: [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 Item = &'a T
[source](https://doc.rust-lang.org/src/std/collections/hash/set.rs.html#1793-1808)### impl<'a, T, S> Iterator for std::collections::hash\_set::Union<'a, T, S>where T: [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 Item = &'a T
[source](https://doc.rust-lang.org/src/core/slice/iter.rs.html#2302)### impl<'a, T, const N: usize> Iterator for std::slice::ArrayChunks<'a, T, N>
#### type Item = &'a [T; N]
[source](https://doc.rust-lang.org/src/core/slice/iter.rs.html#2420)### impl<'a, T, const N: usize> Iterator for ArrayChunksMut<'a, T, N>
#### type Item = &'a mut [T; N]
[source](https://doc.rust-lang.org/src/core/slice/iter.rs.html#2163)### impl<'a, T, const N: usize> Iterator for ArrayWindows<'a, T, N>
#### type Item = &'a [T; N]
[source](https://doc.rust-lang.org/src/core/iter/range.rs.html#706)### impl<A> Iterator for std::ops::Range<A>where A: [Step](trait.step "trait std::iter::Step"),
#### type Item = A
[source](https://doc.rust-lang.org/src/core/iter/range.rs.html#859)### impl<A> Iterator for RangeFrom<A>where A: [Step](trait.step "trait std::iter::Step"),
#### type Item = A
[source](https://doc.rust-lang.org/src/core/iter/range.rs.html#1095)1.26.0 · ### impl<A> Iterator for RangeInclusive<A>where A: [Step](trait.step "trait std::iter::Step"),
#### type Item = A
[source](https://doc.rust-lang.org/src/core/option.rs.html#2179)### impl<A> Iterator for std::option::IntoIter<A>
#### type Item = A
[source](https://doc.rust-lang.org/src/core/iter/sources/repeat.rs.html#69)### impl<A> Iterator for Repeat<A>where A: [Clone](../clone/trait.clone "trait std::clone::Clone"),
#### type Item = A
[source](https://doc.rust-lang.org/src/core/iter/adapters/chain.rs.html#41)### impl<A, B> Iterator for Chain<A, B>where A: [Iterator](trait.iterator "trait std::iter::Iterator"), B: [Iterator](trait.iterator "trait std::iter::Iterator")<Item = <A as [Iterator](trait.iterator "trait std::iter::Iterator")>::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>,
#### type Item = <A as Iterator>::Item
[source](https://doc.rust-lang.org/src/core/iter/adapters/zip.rs.html#75)### impl<A, B> Iterator for Zip<A, B>where A: [Iterator](trait.iterator "trait std::iter::Iterator"), B: [Iterator](trait.iterator "trait std::iter::Iterator"),
#### type Item = (<A as Iterator>::Item, <B as Iterator>::Item)
[source](https://doc.rust-lang.org/src/core/iter/sources/once_with.rs.html#76)1.43.0 · ### impl<A, F> Iterator for OnceWith<F>where F: [FnOnce](../ops/trait.fnonce "trait std::ops::FnOnce")() -> A,
#### type Item = A
[source](https://doc.rust-lang.org/src/core/iter/sources/repeat_with.rs.html#80)1.28.0 · ### impl<A, F> Iterator for RepeatWith<F>where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")() -> A,
#### type Item = A
[source](https://doc.rust-lang.org/src/core/iter/adapters/filter_map.rs.html#53)### impl<B, I, F> Iterator for FilterMap<I, F>where I: [Iterator](trait.iterator "trait std::iter::Iterator"), F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(<I as [Iterator](trait.iterator "trait std::iter::Iterator")>::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Option](../option/enum.option "enum std::option::Option")<B>,
#### type Item = B
[source](https://doc.rust-lang.org/src/core/iter/adapters/map.rs.html#95)### impl<B, I, F> Iterator for Map<I, F>where I: [Iterator](trait.iterator "trait std::iter::Iterator"), F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(<I as [Iterator](trait.iterator "trait std::iter::Iterator")>::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> B,
#### type Item = B
[source](https://doc.rust-lang.org/src/core/iter/adapters/map_while.rs.html#34)1.57.0 · ### impl<B, I, P> Iterator for MapWhile<I, P>where I: [Iterator](trait.iterator "trait std::iter::Iterator"), P: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(<I as [Iterator](trait.iterator "trait std::iter::Iterator")>::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Option](../option/enum.option "enum std::option::Option")<B>,
#### type Item = B
[source](https://doc.rust-lang.org/src/core/iter/adapters/scan.rs.html#35)### impl<B, I, St, F> Iterator for Scan<I, St, F>where I: [Iterator](trait.iterator "trait std::iter::Iterator"), F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")([&mut](../primitive.reference) St, <I as [Iterator](trait.iterator "trait std::iter::Iterator")>::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Option](../option/enum.option "enum std::option::Option")<B>,
#### type Item = B
[source](https://doc.rust-lang.org/src/std/io/mod.rs.html#2813-2832)### impl<B: BufRead> Iterator for std::io::Lines<B>
#### type Item = Result<String, Error>
[source](https://doc.rust-lang.org/src/std/io/mod.rs.html#2782-2798)### impl<B: BufRead> Iterator for std::io::Split<B>
#### type Item = Result<Vec<u8, Global>, Error>
[source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#3864)### impl<I> Iterator for &mut Iwhere I: [Iterator](trait.iterator "trait std::iter::Iterator") + ?[Sized](../marker/trait.sized "trait std::marker::Sized"),
#### type Item = <I as Iterator>::Item
[source](https://doc.rust-lang.org/src/core/char/decode.rs.html#42)1.9.0 · ### impl<I> Iterator for DecodeUtf16<I>where I: [Iterator](trait.iterator "trait std::iter::Iterator")<Item = [u16](../primitive.u16)>,
#### type Item = Result<char, DecodeUtf16Error>
[source](https://doc.rust-lang.org/src/core/iter/adapters/by_ref_sized.rs.html#15)### impl<I> Iterator for ByRefSized<'\_, I>where I: [Iterator](trait.iterator "trait std::iter::Iterator"),
#### type Item = <I as Iterator>::Item
[source](https://doc.rust-lang.org/src/core/iter/adapters/cycle.rs.html#25)### impl<I> Iterator for Cycle<I>where I: [Clone](../clone/trait.clone "trait std::clone::Clone") + [Iterator](trait.iterator "trait std::iter::Iterator"),
#### type Item = <I as Iterator>::Item
[source](https://doc.rust-lang.org/src/core/iter/adapters/enumerate.rs.html#28)### impl<I> Iterator for Enumerate<I>where I: [Iterator](trait.iterator "trait std::iter::Iterator"),
#### type Item = (usize, <I as Iterator>::Item)
[source](https://doc.rust-lang.org/src/core/iter/adapters/fuse.rs.html#35)### impl<I> Iterator for Fuse<I>where I: [Iterator](trait.iterator "trait std::iter::Iterator"),
#### type Item = <I as Iterator>::Item
[source](https://doc.rust-lang.org/src/core/iter/adapters/intersperse.rs.html#28)### impl<I> Iterator for Intersperse<I>where I: [Iterator](trait.iterator "trait std::iter::Iterator"), <I as [Iterator](trait.iterator "trait std::iter::Iterator")>::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [Clone](../clone/trait.clone "trait std::clone::Clone"),
#### type Item = <I as Iterator>::Item
[source](https://doc.rust-lang.org/src/core/iter/adapters/peekable.rs.html#32)### impl<I> Iterator for Peekable<I>where I: [Iterator](trait.iterator "trait std::iter::Iterator"),
#### type Item = <I as Iterator>::Item
[source](https://doc.rust-lang.org/src/core/iter/adapters/rev.rs.html#25)### impl<I> Iterator for Rev<I>where I: [DoubleEndedIterator](trait.doubleendediterator "trait std::iter::DoubleEndedIterator"),
#### type Item = <I as Iterator>::Item
[source](https://doc.rust-lang.org/src/core/iter/adapters/skip.rs.html#27)### impl<I> Iterator for Skip<I>where I: [Iterator](trait.iterator "trait std::iter::Iterator"),
#### type Item = <I as Iterator>::Item
[source](https://doc.rust-lang.org/src/core/iter/adapters/step_by.rs.html#27)1.28.0 · ### impl<I> Iterator for StepBy<I>where I: [Iterator](trait.iterator "trait std::iter::Iterator"),
#### type Item = <I as Iterator>::Item
[source](https://doc.rust-lang.org/src/core/iter/adapters/take.rs.html#27)### impl<I> Iterator for Take<I>where I: [Iterator](trait.iterator "trait std::iter::Iterator"),
#### type Item = <I as Iterator>::Item
[source](https://doc.rust-lang.org/src/alloc/boxed.rs.html#1871)### impl<I, A> Iterator for Box<I, A>where I: [Iterator](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
[source](https://doc.rust-lang.org/src/alloc/vec/splice.rs.html#31)1.21.0 · ### impl<I, A> Iterator for Splice<'\_, I, A>where I: [Iterator](trait.iterator "trait std::iter::Iterator"), A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"),
#### type Item = <I as Iterator>::Item
[source](https://doc.rust-lang.org/src/core/iter/adapters/inspect.rs.html#68)### impl<I, F> Iterator for Inspect<I, F>where I: [Iterator](trait.iterator "trait std::iter::Iterator"), F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&<I as [Iterator](trait.iterator "trait std::iter::Iterator")>::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")),
#### type Item = <I as Iterator>::Item
[source](https://doc.rust-lang.org/src/core/iter/adapters/intersperse.rs.html#117)### impl<I, G> Iterator for IntersperseWith<I, G>where I: [Iterator](trait.iterator "trait std::iter::Iterator"), G: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")() -> <I as [Iterator](trait.iterator "trait std::iter::Iterator")>::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"),
#### type Item = <I as Iterator>::Item
[source](https://doc.rust-lang.org/src/core/iter/adapters/filter.rs.html#48)### impl<I, P> Iterator for Filter<I, P>where I: [Iterator](trait.iterator "trait std::iter::Iterator"), P: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&<I as [Iterator](trait.iterator "trait std::iter::Iterator")>::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool),
#### type Item = <I as Iterator>::Item
[source](https://doc.rust-lang.org/src/core/iter/adapters/skip_while.rs.html#35)### impl<I, P> Iterator for SkipWhile<I, P>where I: [Iterator](trait.iterator "trait std::iter::Iterator"), P: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&<I as [Iterator](trait.iterator "trait std::iter::Iterator")>::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool),
#### type Item = <I as Iterator>::Item
[source](https://doc.rust-lang.org/src/core/iter/adapters/take_while.rs.html#35)### impl<I, P> Iterator for TakeWhile<I, P>where I: [Iterator](trait.iterator "trait std::iter::Iterator"), P: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&<I as [Iterator](trait.iterator "trait std::iter::Iterator")>::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool),
#### type Item = <I as Iterator>::Item
[source](https://doc.rust-lang.org/src/core/iter/adapters/flatten.rs.html#203)1.29.0 · ### impl<I, U> Iterator for Flatten<I>where I: [Iterator](trait.iterator "trait std::iter::Iterator"), U: [Iterator](trait.iterator "trait std::iter::Iterator"), <I as [Iterator](trait.iterator "trait std::iter::Iterator")>::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [IntoIterator](trait.intoiterator "trait std::iter::IntoIterator"), <<I as [Iterator](trait.iterator "trait std::iter::Iterator")>::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item") as [IntoIterator](trait.intoiterator "trait std::iter::IntoIterator")>::[IntoIter](trait.intoiterator#associatedtype.IntoIter "type std::iter::IntoIterator::IntoIter") == U, <<I as [Iterator](trait.iterator "trait std::iter::Iterator")>::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item") as [IntoIterator](trait.intoiterator "trait std::iter::IntoIterator")>::[Item](trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item") == <U as [Iterator](trait.iterator "trait std::iter::Iterator")>::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"),
#### type Item = <U as Iterator>::Item
[source](https://doc.rust-lang.org/src/core/iter/adapters/flatten.rs.html#43)### impl<I, U, F> Iterator for FlatMap<I, U, F>where I: [Iterator](trait.iterator "trait std::iter::Iterator"), U: [IntoIterator](trait.intoiterator "trait std::iter::IntoIterator"), F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(<I as [Iterator](trait.iterator "trait std::iter::Iterator")>::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> U,
#### type Item = <U as IntoIterator>::Item
[source](https://doc.rust-lang.org/src/core/iter/adapters/array_chunks.rs.html#41)### impl<I, const N: usize> Iterator for std::iter::ArrayChunks<I, N>where I: [Iterator](trait.iterator "trait std::iter::Iterator"),
#### type Item = [<I as Iterator>::Item; N]
[source](https://doc.rust-lang.org/src/std/collections/hash/set.rs.html#1527-1538)### impl<K> Iterator for std::collections::hash\_set::IntoIter<K>
#### type Item = K
[source](https://doc.rust-lang.org/src/std/collections/hash/set.rs.html#1587-1601)### impl<K, F> Iterator for std::collections::hash\_set::DrainFilter<'\_, K, F>where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")([&](../primitive.reference)K) -> [bool](../primitive.bool),
#### type Item = K
[source](https://doc.rust-lang.org/src/std/collections/hash/map.rs.html#2285-2296)### impl<K, V> Iterator for std::collections::hash\_map::IntoIter<K, V>
#### type Item = (K, V)
[source](https://doc.rust-lang.org/src/std/collections/hash/map.rs.html#2391-2402)1.54.0 · ### impl<K, V> Iterator for std::collections::hash\_map::IntoKeys<K, V>
#### type Item = K
[source](https://doc.rust-lang.org/src/std/collections/hash/map.rs.html#2421-2432)1.54.0 · ### impl<K, V> Iterator for std::collections::hash\_map::IntoValues<K, V>
#### type Item = V
[source](https://doc.rust-lang.org/src/alloc/collections/btree/map.rs.html#1694)### impl<K, V, A> Iterator 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"),
#### type Item = (K, V)
[source](https://doc.rust-lang.org/src/alloc/collections/btree/map.rs.html#1986)1.54.0 · ### impl<K, V, A> Iterator for std::collections::btree\_map::IntoKeys<K, V, A>where A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator") + [Clone](../clone/trait.clone "trait std::clone::Clone"),
#### type Item = K
[source](https://doc.rust-lang.org/src/alloc/collections/btree/map.rs.html#2028)1.54.0 · ### impl<K, V, A> Iterator for std::collections::btree\_map::IntoValues<K, V, A>where A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator") + [Clone](../clone/trait.clone "trait std::clone::Clone"),
#### type Item = V
[source](https://doc.rust-lang.org/src/std/collections/hash/map.rs.html#2485-2499)### impl<K, V, F> Iterator for std::collections::hash\_map::DrainFilter<'\_, K, V, F>where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")([&](../primitive.reference)K, [&mut](../primitive.reference) V) -> [bool](../primitive.bool),
#### type Item = (K, V)
[source](https://doc.rust-lang.org/src/alloc/collections/btree/map.rs.html#1868)### impl<K, V, F, A> Iterator 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](../ops/trait.fnmut "trait std::ops::FnMut")([&](../primitive.reference)K, [&mut](../primitive.reference) V) -> [bool](../primitive.bool),
#### type Item = (K, V)
[source](https://doc.rust-lang.org/src/std/io/mod.rs.html#2689-2707)### impl<R: Read> Iterator for std::io::Bytes<R>
#### type Item = Result<u8, Error>
[source](https://doc.rust-lang.org/src/alloc/collections/binary_heap.rs.html#1484)1.6.0 · ### impl<T> Iterator for std::collections::binary\_heap::Drain<'\_, T>
#### type Item = T
[source](https://doc.rust-lang.org/src/alloc/collections/binary_heap.rs.html#1549)### impl<T> Iterator for DrainSorted<'\_, T>where T: [Ord](../cmp/trait.ord "trait std::cmp::Ord"),
#### type Item = T
[source](https://doc.rust-lang.org/src/alloc/collections/binary_heap.rs.html#1382)### impl<T> Iterator for std::collections::binary\_heap::IntoIter<T>
#### type Item = T
[source](https://doc.rust-lang.org/src/alloc/collections/binary_heap.rs.html#1447)### impl<T> Iterator for IntoIterSorted<T>where T: [Ord](../cmp/trait.ord "trait std::cmp::Ord"),
#### type Item = T
[source](https://doc.rust-lang.org/src/alloc/collections/linked_list.rs.html#1783)### impl<T> Iterator for std::collections::linked\_list::IntoIter<T>
#### type Item = T
[source](https://doc.rust-lang.org/src/core/result.rs.html#1988)### impl<T> Iterator for std::result::IntoIter<T>
#### type Item = T
[source](https://doc.rust-lang.org/src/std/sync/mpsc/mod.rs.html#1483-1488)1.1.0 · ### impl<T> Iterator for std::sync::mpsc::IntoIter<T>
#### type Item = T
[source](https://doc.rust-lang.org/src/core/iter/sources/empty.rs.html#45)1.2.0 · ### impl<T> Iterator for Empty<T>
#### type Item = T
[source](https://doc.rust-lang.org/src/core/iter/sources/once.rs.html#69)1.2.0 · ### impl<T> Iterator for Once<T>
#### type Item = T
[source](https://doc.rust-lang.org/src/alloc/collections/btree/set.rs.html#1532)### impl<T, A> Iterator for std::collections::btree\_set::IntoIter<T, A>where A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator") + [Clone](../clone/trait.clone "trait std::clone::Clone"),
#### type Item = T
[source](https://doc.rust-lang.org/src/alloc/collections/vec_deque/drain.rs.html#126)1.6.0 · ### impl<T, A> Iterator for std::collections::vec\_deque::Drain<'\_, T, A>where A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"),
#### type Item = T
[source](https://doc.rust-lang.org/src/alloc/collections/vec_deque/into_iter.rs.html#38)### impl<T, A> Iterator for std::collections::vec\_deque::IntoIter<T, A>where A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"),
#### type Item = T
[source](https://doc.rust-lang.org/src/alloc/vec/drain.rs.html#154)1.6.0 · ### impl<T, A> Iterator for std::vec::Drain<'\_, T, A>where A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"),
#### type Item = T
[source](https://doc.rust-lang.org/src/alloc/vec/into_iter.rs.html#145)### impl<T, A> Iterator for std::vec::IntoIter<T, A>where A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"),
#### type Item = T
[source](https://doc.rust-lang.org/src/alloc/collections/linked_list.rs.html#1717)### impl<T, F> Iterator for std::collections::linked\_list::DrainFilter<'\_, T, F>where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")([&mut](../primitive.reference) T) -> [bool](../primitive.bool),
#### type Item = T
[source](https://doc.rust-lang.org/src/core/iter/sources/from_fn.rs.html#61)1.34.0 · ### impl<T, F> Iterator for FromFn<F>where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")() -> [Option](../option/enum.option "enum std::option::Option")<T>,
#### type Item = T
[source](https://doc.rust-lang.org/src/core/iter/sources/successors.rs.html#39)1.34.0 · ### impl<T, F> Iterator for Successors<T, F>where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")([&](../primitive.reference)T) -> [Option](../option/enum.option "enum std::option::Option")<T>,
#### type Item = T
[source](https://doc.rust-lang.org/src/alloc/vec/drain_filter.rs.html#116)### impl<T, F, A> Iterator for std::vec::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
[source](https://doc.rust-lang.org/src/core/array/iter.rs.html#239)1.40.0 · ### impl<T, const N: usize> Iterator for std::array::IntoIter<T, N>
#### type Item = T
| programming_docs |
rust Trait std::iter::TrustedLen Trait std::iter::TrustedLen
===========================
```
pub unsafe trait TrustedLen: Iterator { }
```
🔬This is a nightly-only experimental API. (`trusted_len` [#37572](https://github.com/rust-lang/rust/issues/37572))
An iterator that reports an accurate length using size\_hint.
The iterator reports a size hint where it is either exact (lower bound is equal to upper bound), or the upper bound is [`None`](../option/enum.option#variant.None "None"). The upper bound must only be [`None`](../option/enum.option#variant.None "None") if the actual iterator length is larger than [`usize::MAX`](../primitive.usize#associatedconstant.MAX "usize::MAX"). In that case, the lower bound must be [`usize::MAX`](../primitive.usize#associatedconstant.MAX "usize::MAX"), resulting in an [`Iterator::size_hint()`](trait.iterator#method.size_hint "Iterator::size_hint()") of `(usize::MAX, None)`.
The iterator must produce exactly the number of elements it reported or diverge before reaching the end.
Safety
------
This trait must only be implemented when the contract is upheld. Consumers of this trait must inspect [`Iterator::size_hint()`](trait.iterator#method.size_hint "Iterator::size_hint()")’s upper bound.
Implementors
------------
[source](https://doc.rust-lang.org/src/core/str/iter.rs.html#346)### impl TrustedLen for Bytes<'\_>
[source](https://doc.rust-lang.org/src/core/iter/adapters/cloned.rs.html#137)### impl<'a, I, T> TrustedLen for Cloned<I>where T: 'a + [Clone](../clone/trait.clone "trait std::clone::Clone"), I: [TrustedLen](trait.trustedlen "trait std::iter::TrustedLen")<Item = [&'a](../primitive.reference) T>,
[source](https://doc.rust-lang.org/src/core/iter/adapters/copied.rs.html#163)1.36.0 · ### impl<'a, I, T> TrustedLen for Copied<I>where T: 'a + [Copy](../marker/trait.copy "trait std::marker::Copy"), I: [TrustedLen](trait.trustedlen "trait std::iter::TrustedLen")<Item = [&'a](../primitive.reference) T>,
[source](https://doc.rust-lang.org/src/core/iter/adapters/flatten.rs.html#146)### impl<'a, T, I, F, const N: usize> TrustedLen for FlatMap<I, &'a [T; N], F>where I: [TrustedLen](trait.trustedlen "trait std::iter::TrustedLen"), F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(<I as [Iterator](trait.iterator "trait std::iter::Iterator")>::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> &'a [[](../primitive.array)T[; N]](../primitive.array),
[source](https://doc.rust-lang.org/src/core/iter/adapters/flatten.rs.html#154)### impl<'a, T, I, F, const N: usize> TrustedLen for FlatMap<I, &'a mut [T; N], F>where I: [TrustedLen](trait.trustedlen "trait std::iter::TrustedLen"), F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(<I as [Iterator](trait.iterator "trait std::iter::Iterator")>::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> &'a mut [[](../primitive.array)T[; N]](../primitive.array),
[source](https://doc.rust-lang.org/src/core/iter/range.rs.html#853)### impl<A> TrustedLen for Range<A>where A: [TrustedStep](trait.trustedstep "trait std::iter::TrustedStep"),
[source](https://doc.rust-lang.org/src/core/iter/range.rs.html#883)### impl<A> TrustedLen for RangeFrom<A>where A: [TrustedStep](trait.trustedstep "trait std::iter::TrustedStep"),
[source](https://doc.rust-lang.org/src/core/iter/range.rs.html#1250)### impl<A> TrustedLen for RangeInclusive<A>where A: [TrustedStep](trait.trustedstep "trait std::iter::TrustedStep"),
[source](https://doc.rust-lang.org/src/core/option.rs.html#2207)### impl<A> TrustedLen for std::option::IntoIter<A>
[source](https://doc.rust-lang.org/src/core/option.rs.html#2116)### impl<A> TrustedLen for std::option::Iter<'\_, A>
[source](https://doc.rust-lang.org/src/core/option.rs.html#2165)### impl<A> TrustedLen for std::option::IterMut<'\_, A>
[source](https://doc.rust-lang.org/src/core/result.rs.html#2017)### impl<A> TrustedLen for std::result::IntoIter<A>
[source](https://doc.rust-lang.org/src/core/result.rs.html#1922)### impl<A> TrustedLen for std::result::Iter<'\_, A>
[source](https://doc.rust-lang.org/src/core/result.rs.html#1971)### impl<A> TrustedLen for std::result::IterMut<'\_, A>
[source](https://doc.rust-lang.org/src/core/iter/sources/repeat.rs.html#129)### impl<A> TrustedLen for Repeat<A>where A: [Clone](../clone/trait.clone "trait std::clone::Clone"),
[source](https://doc.rust-lang.org/src/core/iter/adapters/chain.rs.html#278)### impl<A, B> TrustedLen for Chain<A, B>where A: [TrustedLen](trait.trustedlen "trait std::iter::TrustedLen"), B: [TrustedLen](trait.trustedlen "trait std::iter::TrustedLen")<Item = <A as [Iterator](trait.iterator "trait std::iter::Iterator")>::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>,
[source](https://doc.rust-lang.org/src/core/iter/adapters/zip.rs.html#413)### impl<A, B> TrustedLen for Zip<A, B>where A: [TrustedLen](trait.trustedlen "trait std::iter::TrustedLen"), B: [TrustedLen](trait.trustedlen "trait std::iter::TrustedLen"),
[source](https://doc.rust-lang.org/src/core/iter/sources/once_with.rs.html#109)1.43.0 · ### impl<A, F> TrustedLen for OnceWith<F>where F: [FnOnce](../ops/trait.fnonce "trait std::ops::FnOnce")() -> A,
[source](https://doc.rust-lang.org/src/core/iter/sources/repeat_with.rs.html#98)### impl<A, F> TrustedLen for RepeatWith<F>where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")() -> A,
[source](https://doc.rust-lang.org/src/core/iter/adapters/map.rs.html#183)### impl<B, I, F> TrustedLen for Map<I, F>where I: [TrustedLen](trait.trustedlen "trait std::iter::TrustedLen"), F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(<I as [Iterator](trait.iterator "trait std::iter::Iterator")>::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> B,
[source](https://doc.rust-lang.org/src/core/iter/traits/marker.rs.html#43)### impl<I> TrustedLen for &mut Iwhere I: [TrustedLen](trait.trustedlen "trait std::iter::TrustedLen") + ?[Sized](../marker/trait.sized "trait std::marker::Sized"),
[source](https://doc.rust-lang.org/src/core/iter/adapters/enumerate.rs.html#249)### impl<I> TrustedLen for Enumerate<I>where I: [TrustedLen](trait.trustedlen "trait std::iter::TrustedLen"),
[source](https://doc.rust-lang.org/src/core/iter/adapters/flatten.rs.html#298)### impl<I> TrustedLen for Flatten<I>where I: [TrustedLen](trait.trustedlen "trait std::iter::TrustedLen"), <I as [Iterator](trait.iterator "trait std::iter::Iterator")>::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): TrustedConstSize,
[source](https://doc.rust-lang.org/src/core/iter/adapters/fuse.rs.html#188)### impl<I> TrustedLen for Fuse<I>where I: [TrustedLen](trait.trustedlen "trait std::iter::TrustedLen"),
[source](https://doc.rust-lang.org/src/core/iter/adapters/peekable.rs.html#321)### impl<I> TrustedLen for Peekable<I>where I: [TrustedLen](trait.trustedlen "trait std::iter::TrustedLen"),
[source](https://doc.rust-lang.org/src/core/iter/adapters/rev.rs.html#137)### impl<I> TrustedLen for Rev<I>where I: [TrustedLen](trait.trustedlen "trait std::iter::TrustedLen") + [DoubleEndedIterator](trait.doubleendediterator "trait std::iter::DoubleEndedIterator"),
[source](https://doc.rust-lang.org/src/core/iter/adapters/take.rs.html#244)### impl<I> TrustedLen for Take<I>where I: [TrustedLen](trait.trustedlen "trait std::iter::TrustedLen"),
[source](https://doc.rust-lang.org/src/alloc/collections/binary_heap.rs.html#1571)### impl<T> TrustedLen for DrainSorted<'\_, T>where T: [Ord](../cmp/trait.ord "trait std::cmp::Ord"),
[source](https://doc.rust-lang.org/src/alloc/collections/binary_heap.rs.html#1469)### impl<T> TrustedLen for IntoIterSorted<T>where T: [Ord](../cmp/trait.ord "trait std::cmp::Ord"),
[source](https://doc.rust-lang.org/src/alloc/collections/vec_deque/iter.rs.html#209)### impl<T> TrustedLen for std::collections::vec\_deque::Iter<'\_, T>
[source](https://doc.rust-lang.org/src/alloc/collections/vec_deque/iter_mut.rs.html#152)### impl<T> TrustedLen for std::collections::vec\_deque::IterMut<'\_, T>
[source](https://doc.rust-lang.org/src/core/slice/iter.rs.html#1595)### impl<T> TrustedLen for Chunks<'\_, T>
[source](https://doc.rust-lang.org/src/core/slice/iter.rs.html#1941)### impl<T> TrustedLen for ChunksExact<'\_, T>
[source](https://doc.rust-lang.org/src/core/slice/iter.rs.html#2108)### impl<T> TrustedLen for ChunksExactMut<'\_, T>
[source](https://doc.rust-lang.org/src/core/slice/iter.rs.html#1776)### impl<T> TrustedLen for ChunksMut<'\_, T>
[source](https://doc.rust-lang.org/src/core/slice/iter.rs.html#135-145)### impl<T> TrustedLen for std::slice::Iter<'\_, T>
[source](https://doc.rust-lang.org/src/core/slice/iter.rs.html#366)### impl<T> TrustedLen for std::slice::IterMut<'\_, T>
[source](https://doc.rust-lang.org/src/core/slice/iter.rs.html#2649)### impl<T> TrustedLen for RChunks<'\_, T>
[source](https://doc.rust-lang.org/src/core/slice/iter.rs.html#3003)### impl<T> TrustedLen for RChunksExact<'\_, T>
[source](https://doc.rust-lang.org/src/core/slice/iter.rs.html#3174)### impl<T> TrustedLen for RChunksExactMut<'\_, T>
[source](https://doc.rust-lang.org/src/core/slice/iter.rs.html#2835)### impl<T> TrustedLen for RChunksMut<'\_, T>
[source](https://doc.rust-lang.org/src/core/slice/iter.rs.html#1412)### impl<T> TrustedLen for Windows<'\_, T>
[source](https://doc.rust-lang.org/src/core/iter/sources/empty.rs.html#72)### impl<T> TrustedLen for Empty<T>
[source](https://doc.rust-lang.org/src/core/iter/sources/once.rs.html#96)### impl<T> TrustedLen for Once<T>
[source](https://doc.rust-lang.org/src/alloc/collections/vec_deque/into_iter.rs.html#72)### impl<T, A> TrustedLen for std::collections::vec\_deque::IntoIter<T, A>where A: [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"),
[source](https://doc.rust-lang.org/src/alloc/vec/into_iter.rs.html#313)### impl<T, A> TrustedLen for std::vec::IntoIter<T, A>where A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"),
[source](https://doc.rust-lang.org/src/core/iter/adapters/flatten.rs.html#138)### impl<T, I, F, const N: usize> TrustedLen for FlatMap<I, [T; N], F>where I: [TrustedLen](trait.trustedlen "trait std::iter::TrustedLen"), F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(<I as [Iterator](trait.iterator "trait std::iter::Iterator")>::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [[](../primitive.array)T[; N]](../primitive.array),
[source](https://doc.rust-lang.org/src/core/array/iter.rs.html#392)1.40.0 · ### impl<T, const N: usize> TrustedLen for std::array::IntoIter<T, N>
[source](https://doc.rust-lang.org/src/core/slice/iter.rs.html#2358)### impl<T, const N: usize> TrustedLen for ArrayChunks<'\_, T, N>
[source](https://doc.rust-lang.org/src/core/slice/iter.rs.html#2476)### impl<T, const N: usize> TrustedLen for ArrayChunksMut<'\_, T, N>
rust Struct std::iter::StepBy Struct std::iter::StepBy
========================
```
pub struct StepBy<I> { /* private fields */ }
```
An iterator for stepping iterators by a custom amount.
This `struct` is created by the [`step_by`](trait.iterator#method.step_by) method on [`Iterator`](trait.iterator). See its documentation for more.
Trait Implementations
---------------------
[source](https://doc.rust-lang.org/src/core/iter/adapters/step_by.rs.html#12)### impl<I> Clone for StepBy<I>where I: [Clone](../clone/trait.clone "trait std::clone::Clone"),
[source](https://doc.rust-lang.org/src/core/iter/adapters/step_by.rs.html#12)#### fn clone(&self) -> StepBy<I>
Notable traits for [StepBy](struct.stepby "struct std::iter::StepBy")<I>
```
impl<I> Iterator for StepBy<I>where
I: Iterator,
type Item = <I as Iterator>::Item;
```
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/iter/adapters/step_by.rs.html#12)### impl<I> Debug for StepBy<I>where I: [Debug](../fmt/trait.debug "trait std::fmt::Debug"),
[source](https://doc.rust-lang.org/src/core/iter/adapters/step_by.rs.html#12)#### 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/iter/adapters/step_by.rs.html#168)1.38.0 · ### impl<I> DoubleEndedIterator for StepBy<I>where I: [DoubleEndedIterator](trait.doubleendediterator "trait std::iter::DoubleEndedIterator") + [ExactSizeIterator](trait.exactsizeiterator "trait std::iter::ExactSizeIterator"),
[source](https://doc.rust-lang.org/src/core/iter/adapters/step_by.rs.html#173)#### fn next\_back(&mut self) -> Option<<StepBy<I> as Iterator>::Item>
Removes and returns an element from the end of the iterator. [Read more](trait.doubleendediterator#tymethod.next_back)
[source](https://doc.rust-lang.org/src/core/iter/adapters/step_by.rs.html#178)#### fn nth\_back(&mut self, n: usize) -> Option<<StepBy<I> as Iterator>::Item>
Returns the `n`th element from the end of the iterator. [Read more](trait.doubleendediterator#method.nth_back)
[source](https://doc.rust-lang.org/src/core/iter/adapters/step_by.rs.html#187-190)#### fn try\_rfold<Acc, F, R>(&mut self, init: Acc, f: F) -> Rwhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Acc, <[StepBy](struct.stepby "struct std::iter::StepBy")<I> as [Iterator](trait.iterator "trait std::iter::Iterator")>::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> R, R: [Try](../ops/trait.try "trait std::ops::Try")<Output = Acc>,
This is the reverse version of [`Iterator::try_fold()`](trait.iterator#method.try_fold "Iterator::try_fold()"): it takes elements starting from the back of the iterator. [Read more](trait.doubleendediterator#method.try_rfold)
[source](https://doc.rust-lang.org/src/core/iter/adapters/step_by.rs.html#210-213)#### fn rfold<Acc, F>(self, init: Acc, f: F) -> Accwhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Acc, <[StepBy](struct.stepby "struct std::iter::StepBy")<I> as [Iterator](trait.iterator "trait std::iter::Iterator")>::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> Acc, [StepBy](struct.stepby "struct std::iter::StepBy")<I>: [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](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](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](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](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](trait.doubleendediterator#method.rfind)
[source](https://doc.rust-lang.org/src/core/iter/adapters/step_by.rs.html#235)### impl<I> ExactSizeIterator for StepBy<I>where I: [ExactSizeIterator](trait.exactsizeiterator "trait std::iter::ExactSizeIterator"),
[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](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](trait.exactsizeiterator#method.is_empty)
[source](https://doc.rust-lang.org/src/core/iter/adapters/step_by.rs.html#27)### impl<I> Iterator for StepBy<I>where I: [Iterator](trait.iterator "trait std::iter::Iterator"),
#### type Item = <I as Iterator>::Item
The type of the elements being iterated over.
[source](https://doc.rust-lang.org/src/core/iter/adapters/step_by.rs.html#34)#### fn next(&mut self) -> Option<<StepBy<I> as Iterator>::Item>
Advances the iterator and returns the next value. [Read more](trait.iterator#tymethod.next)
[source](https://doc.rust-lang.org/src/core/iter/adapters/step_by.rs.html#44)#### fn size\_hint(&self) -> (usize, Option<usize>)
Returns the bounds on the remaining length of the iterator. [Read more](trait.iterator#method.size_hint)
[source](https://doc.rust-lang.org/src/core/iter/adapters/step_by.rs.html#67)#### fn nth(&mut self, n: usize) -> Option<<StepBy<I> as Iterator>::Item>
Returns the `n`th element of the iterator. [Read more](trait.iterator#method.nth)
[source](https://doc.rust-lang.org/src/core/iter/adapters/step_by.rs.html#111-114)#### fn try\_fold<Acc, F, R>(&mut self, acc: Acc, f: F) -> Rwhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Acc, <[StepBy](struct.stepby "struct std::iter::StepBy")<I> as [Iterator](trait.iterator "trait std::iter::Iterator")>::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> R, R: [Try](../ops/trait.try "trait std::ops::Try")<Output = Acc>,
An iterator method that applies a function as long as it returns successfully, producing a single, final value. [Read more](trait.iterator#method.try_fold)
[source](https://doc.rust-lang.org/src/core/iter/adapters/step_by.rs.html#131-133)#### fn fold<Acc, F>(self, acc: Acc, f: F) -> Accwhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Acc, <[StepBy](struct.stepby "struct std::iter::StepBy")<I> as [Iterator](trait.iterator "trait std::iter::Iterator")>::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> Acc,
Folds every element into an accumulator by applying an operation, returning the final result. [Read more](trait.iterator#method.fold)
[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](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](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](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](trait.iterator#method.advance_by)
[source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#428-430)#### fn step\_by(self, step: usize) -> StepBy<Self>
Notable traits for [StepBy](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](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](trait.intoiterator "trait std::iter::IntoIterator")<Item = Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>,
Notable traits for [Chain](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](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](trait.intoiterator "trait std::iter::IntoIterator"),
Notable traits for [Zip](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](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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"),
Notable traits for [IntersperseWith](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](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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> B,
Notable traits for [Map](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](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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")),
Calls a closure on each element of an iterator. [Read more](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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool),
Notable traits for [Filter](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](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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Option](../option/enum.option "enum std::option::Option")<B>,
Notable traits for [FilterMap](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](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](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](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](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`](struct.peekable#method.peek) and [`peek_mut`](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](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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool),
Notable traits for [SkipWhile](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`](trait.iterator#method.skip)s elements based on a predicate. [Read more](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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool),
Notable traits for [TakeWhile](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](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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Option](../option/enum.option "enum std::option::Option")<B>,
Notable traits for [MapWhile](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](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](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](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](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](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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Option](../option/enum.option "enum std::option::Option")<B>,
Notable traits for [Scan](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`](trait.iterator#method.fold) that holds internal state and produces a new iterator. [Read more](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](trait.intoiterator "trait std::iter::IntoIterator"), F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> U,
Notable traits for [FlatMap](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](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](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](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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")),
Notable traits for [Inspect](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](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](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](trait.fromiterator "trait std::iter::FromIterator")<Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>,
Transforms an iterator into a collection. [Read more](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](trait.extend "trait std::iter::Extend")<Self::[Item](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](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](trait.extend "trait std::iter::Extend")<Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>, F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool),
Consumes an iterator, creating two collections from it. [Read more](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](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](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](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](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](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](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"),
Reduces the elements to a single one, by repeatedly applying a reducing operation. [Read more](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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> R, R: [Try](../ops/trait.try "trait std::ops::Try")<Output = Self::[Item](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](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](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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool),
Tests if every element of the iterator matches a predicate. [Read more](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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool),
Tests if any element of the iterator matches a predicate. [Read more](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](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](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](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](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](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](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](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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool),
Searches for an element in an iterator, returning its index. [Read more](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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> B,
Returns the element that gives the maximum value from the specified function. [Read more](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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), &Self::[Item](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](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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> B,
Returns the element that gives the minimum value from the specified function. [Read more](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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), &Self::[Item](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](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](trait.extend "trait std::iter::Extend")<A>, FromB: [Default](../default/trait.default "trait std::default::Default") + [Extend](trait.extend "trait std::iter::Extend")<B>, Self: [Iterator](trait.iterator "trait std::iter::Iterator")<Item = [(A, B)](../primitive.tuple)>,
Converts an iterator of pairs into a pair of containers. [Read more](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](trait.iterator "trait std::iter::Iterator")<Item = [&'a](../primitive.reference) T>,
Notable traits for [Copied](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](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](trait.iterator "trait std::iter::Iterator")<Item = [&'a](../primitive.reference) T>,
Notable traits for [Cloned](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](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](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](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](trait.sum "trait std::iter::Sum")<Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>,
Sums the elements of an iterator. [Read more](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](trait.product "trait std::iter::Product")<Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>,
Iterates over the entire iterator, multiplying all the elements [Read more](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](trait.intoiterator "trait std::iter::IntoIterator"), F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), <I as [IntoIterator](trait.intoiterator "trait std::iter::IntoIterator")>::[Item](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`](trait.iterator "Iterator") with those of another with respect to the specified comparison function. [Read more](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](trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<<I as [IntoIterator](trait.intoiterator "trait std::iter::IntoIterator")>::[Item](trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>,
[Lexicographically](../cmp/trait.ord#lexicographical-comparison) compares the elements of this [`Iterator`](trait.iterator "Iterator") with those of another. [Read more](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](trait.intoiterator "trait std::iter::IntoIterator"), F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), <I as [IntoIterator](trait.intoiterator "trait std::iter::IntoIterator")>::[Item](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`](trait.iterator "Iterator") with those of another with respect to the specified comparison function. [Read more](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](trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialEq](../cmp/trait.partialeq "trait std::cmp::PartialEq")<<I as [IntoIterator](trait.intoiterator "trait std::iter::IntoIterator")>::[Item](trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>,
Determines if the elements of this [`Iterator`](trait.iterator "Iterator") are equal to those of another. [Read more](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](trait.intoiterator "trait std::iter::IntoIterator"), F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), <I as [IntoIterator](trait.intoiterator "trait std::iter::IntoIterator")>::[Item](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`](trait.iterator "Iterator") are equal to those of another with respect to the specified equality function. [Read more](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](trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialEq](../cmp/trait.partialeq "trait std::cmp::PartialEq")<<I as [IntoIterator](trait.intoiterator "trait std::iter::IntoIterator")>::[Item](trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>,
Determines if the elements of this [`Iterator`](trait.iterator "Iterator") are unequal to those of another. [Read more](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](trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<<I as [IntoIterator](trait.intoiterator "trait std::iter::IntoIterator")>::[Item](trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>,
Determines if the elements of this [`Iterator`](trait.iterator "Iterator") are [lexicographically](../cmp/trait.ord#lexicographical-comparison) less than those of another. [Read more](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](trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<<I as [IntoIterator](trait.intoiterator "trait std::iter::IntoIterator")>::[Item](trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>,
Determines if the elements of this [`Iterator`](trait.iterator "Iterator") are [lexicographically](../cmp/trait.ord#lexicographical-comparison) less or equal to those of another. [Read more](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](trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<<I as [IntoIterator](trait.intoiterator "trait std::iter::IntoIterator")>::[Item](trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>,
Determines if the elements of this [`Iterator`](trait.iterator "Iterator") are [lexicographically](../cmp/trait.ord#lexicographical-comparison) greater than those of another. [Read more](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](trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<<I as [IntoIterator](trait.intoiterator "trait std::iter::IntoIterator")>::[Item](trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>,
Determines if the elements of this [`Iterator`](trait.iterator "Iterator") are [lexicographically](../cmp/trait.ord#lexicographical-comparison) greater than or equal to those of another. [Read more](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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), &Self::[Item](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](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](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](trait.iterator#method.is_sorted_by_key)
Auto Trait Implementations
--------------------------
### impl<I> RefUnwindSafe for StepBy<I>where I: [RefUnwindSafe](../panic/trait.refunwindsafe "trait std::panic::RefUnwindSafe"),
### impl<I> Send for StepBy<I>where I: [Send](../marker/trait.send "trait std::marker::Send"),
### impl<I> Sync for StepBy<I>where I: [Sync](../marker/trait.sync "trait std::marker::Sync"),
### impl<I> Unpin for StepBy<I>where I: [Unpin](../marker/trait.unpin "trait std::marker::Unpin"),
### impl<I> UnwindSafe for StepBy<I>where I: [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](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](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::iter::Chain Struct std::iter::Chain
=======================
```
pub struct Chain<A, B> { /* private fields */ }
```
An iterator that links two iterators together, in a chain.
This `struct` is created by [`Iterator::chain`](trait.iterator#method.chain "Iterator::chain"). See its documentation for more.
Examples
--------
```
use std::iter::Chain;
use std::slice::Iter;
let a1 = [1, 2, 3];
let a2 = [4, 5, 6];
let iter: Chain<Iter<_>, Iter<_>> = a1.iter().chain(a2.iter());
```
Trait Implementations
---------------------
[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](../clone/trait.clone "trait std::clone::Clone"), B: [Clone](../clone/trait.clone "trait std::clone::Clone"),
[source](https://doc.rust-lang.org/src/core/iter/adapters/chain.rs.html#19)#### fn clone(&self) -> Chain<A, B>
Notable traits for [Chain](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;
```
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/iter/adapters/chain.rs.html#19)### impl<A, B> Debug for Chain<A, B>where A: [Debug](../fmt/trait.debug "trait std::fmt::Debug"), B: [Debug](../fmt/trait.debug "trait std::fmt::Debug"),
[source](https://doc.rust-lang.org/src/core/iter/adapters/chain.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/core/iter/adapters/chain.rs.html#178)### impl<A, B> DoubleEndedIterator for Chain<A, B>where A: [DoubleEndedIterator](trait.doubleendediterator "trait std::iter::DoubleEndedIterator"), B: [DoubleEndedIterator](trait.doubleendediterator "trait std::iter::DoubleEndedIterator")<Item = <A as [Iterator](trait.iterator "trait std::iter::Iterator")>::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>,
[source](https://doc.rust-lang.org/src/core/iter/adapters/chain.rs.html#184)#### fn next\_back(&mut self) -> Option<<A as Iterator>::Item>
Removes and returns an element from the end of the iterator. [Read more](trait.doubleendediterator#tymethod.next_back)
[source](https://doc.rust-lang.org/src/core/iter/adapters/chain.rs.html#189)#### 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](trait.doubleendediterator#method.advance_back_by)
[source](https://doc.rust-lang.org/src/core/iter/adapters/chain.rs.html#212)#### fn nth\_back(&mut self, n: usize) -> Option<<Chain<A, B> as Iterator>::Item>
Returns the `n`th element from the end of the iterator. [Read more](trait.doubleendediterator#method.nth_back)
[source](https://doc.rust-lang.org/src/core/iter/adapters/chain.rs.html#229-231)#### fn rfind<P>(&mut self, predicate: P) -> Option<<Chain<A, B> as Iterator>::Item>where P: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&<[Chain](struct.chain "struct std::iter::Chain")<A, B> as [Iterator](trait.iterator "trait std::iter::Iterator")>::[Item](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](trait.doubleendediterator#method.rfind)
[source](https://doc.rust-lang.org/src/core/iter/adapters/chain.rs.html#237-241)#### fn try\_rfold<Acc, F, R>(&mut self, acc: Acc, f: F) -> Rwhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Acc, <[Chain](struct.chain "struct std::iter::Chain")<A, B> as [Iterator](trait.iterator "trait std::iter::Iterator")>::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> R, R: [Try](../ops/trait.try "trait std::ops::Try")<Output = Acc>, [Chain](struct.chain "struct std::iter::Chain")<A, B>: [Sized](../marker/trait.sized "trait std::marker::Sized"),
This is the reverse version of [`Iterator::try_fold()`](trait.iterator#method.try_fold "Iterator::try_fold()"): it takes elements starting from the back of the iterator. [Read more](trait.doubleendediterator#method.try_rfold)
[source](https://doc.rust-lang.org/src/core/iter/adapters/chain.rs.html#254-256)#### fn rfold<Acc, F>(self, acc: Acc, f: F) -> Accwhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Acc, <[Chain](struct.chain "struct std::iter::Chain")<A, B> as [Iterator](trait.iterator "trait std::iter::Iterator")>::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> Acc,
An iterator method that reduces the iterator’s elements to a single, final value, starting from the back. [Read more](trait.doubleendediterator#method.rfold)
[source](https://doc.rust-lang.org/src/core/iter/adapters/chain.rs.html#41)### impl<A, B> Iterator for Chain<A, B>where A: [Iterator](trait.iterator "trait std::iter::Iterator"), B: [Iterator](trait.iterator "trait std::iter::Iterator")<Item = <A as [Iterator](trait.iterator "trait std::iter::Iterator")>::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>,
#### type Item = <A as Iterator>::Item
The type of the elements being iterated over.
[source](https://doc.rust-lang.org/src/core/iter/adapters/chain.rs.html#49)#### fn next(&mut self) -> Option<<A as Iterator>::Item>
Advances the iterator and returns the next value. [Read more](trait.iterator#tymethod.next)
[source](https://doc.rust-lang.org/src/core/iter/adapters/chain.rs.html#55)#### fn count(self) -> usize
Consumes the iterator, counting the number of iterations and returning it. [Read more](trait.iterator#method.count)
[source](https://doc.rust-lang.org/src/core/iter/adapters/chain.rs.html#67-71)#### fn try\_fold<Acc, F, R>(&mut self, acc: Acc, f: F) -> Rwhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Acc, <[Chain](struct.chain "struct std::iter::Chain")<A, B> as [Iterator](trait.iterator "trait std::iter::Iterator")>::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> R, R: [Try](../ops/trait.try "trait std::ops::Try")<Output = Acc>, [Chain](struct.chain "struct std::iter::Chain")<A, B>: [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](trait.iterator#method.try_fold)
[source](https://doc.rust-lang.org/src/core/iter/adapters/chain.rs.html#84-86)#### fn fold<Acc, F>(self, acc: Acc, f: F) -> Accwhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Acc, <[Chain](struct.chain "struct std::iter::Chain")<A, B> as [Iterator](trait.iterator "trait std::iter::Iterator")>::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> Acc,
Folds every element into an accumulator by applying an operation, returning the final result. [Read more](trait.iterator#method.fold)
[source](https://doc.rust-lang.org/src/core/iter/adapters/chain.rs.html#98)#### 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](trait.iterator#method.advance_by)
[source](https://doc.rust-lang.org/src/core/iter/adapters/chain.rs.html#121)#### fn nth(&mut self, n: usize) -> Option<<Chain<A, B> as Iterator>::Item>
Returns the `n`th element of the iterator. [Read more](trait.iterator#method.nth)
[source](https://doc.rust-lang.org/src/core/iter/adapters/chain.rs.html#138-140)#### fn find<P>(&mut self, predicate: P) -> Option<<Chain<A, B> as Iterator>::Item>where P: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&<[Chain](struct.chain "struct std::iter::Chain")<A, B> as [Iterator](trait.iterator "trait std::iter::Iterator")>::[Item](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](trait.iterator#method.find)
[source](https://doc.rust-lang.org/src/core/iter/adapters/chain.rs.html#147)#### fn last(self) -> Option<<A as Iterator>::Item>
Consumes the iterator, returning the last element. [Read more](trait.iterator#method.last)
[source](https://doc.rust-lang.org/src/core/iter/adapters/chain.rs.html#155)#### fn size\_hint(&self) -> (usize, Option<usize>)
Returns the bounds on the remaining length of the iterator. [Read more](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](trait.iterator#method.next_chunk)
[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](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](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](trait.intoiterator "trait std::iter::IntoIterator")<Item = Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>,
Notable traits for [Chain](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](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](trait.intoiterator "trait std::iter::IntoIterator"),
Notable traits for [Zip](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](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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"),
Notable traits for [IntersperseWith](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](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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> B,
Notable traits for [Map](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](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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")),
Calls a closure on each element of an iterator. [Read more](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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool),
Notable traits for [Filter](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](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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Option](../option/enum.option "enum std::option::Option")<B>,
Notable traits for [FilterMap](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](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](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](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](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`](struct.peekable#method.peek) and [`peek_mut`](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](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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool),
Notable traits for [SkipWhile](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`](trait.iterator#method.skip)s elements based on a predicate. [Read more](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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool),
Notable traits for [TakeWhile](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](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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Option](../option/enum.option "enum std::option::Option")<B>,
Notable traits for [MapWhile](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](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](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](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](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](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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Option](../option/enum.option "enum std::option::Option")<B>,
Notable traits for [Scan](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`](trait.iterator#method.fold) that holds internal state and produces a new iterator. [Read more](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](trait.intoiterator "trait std::iter::IntoIterator"), F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> U,
Notable traits for [FlatMap](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](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](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](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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")),
Notable traits for [Inspect](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](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](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](trait.fromiterator "trait std::iter::FromIterator")<Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>,
Transforms an iterator into a collection. [Read more](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](trait.extend "trait std::iter::Extend")<Self::[Item](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](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](trait.extend "trait std::iter::Extend")<Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>, F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool),
Consumes an iterator, creating two collections from it. [Read more](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](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](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](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](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](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](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"),
Reduces the elements to a single one, by repeatedly applying a reducing operation. [Read more](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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> R, R: [Try](../ops/trait.try "trait std::ops::Try")<Output = Self::[Item](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](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](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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool),
Tests if every element of the iterator matches a predicate. [Read more](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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool),
Tests if any element of the iterator matches a predicate. [Read more](trait.iterator#method.any)
[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](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](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](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](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](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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool),
Searches for an element in an iterator, returning its index. [Read more](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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> B,
Returns the element that gives the maximum value from the specified function. [Read more](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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), &Self::[Item](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](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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> B,
Returns the element that gives the minimum value from the specified function. [Read more](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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), &Self::[Item](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](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](trait.extend "trait std::iter::Extend")<A>, FromB: [Default](../default/trait.default "trait std::default::Default") + [Extend](trait.extend "trait std::iter::Extend")<B>, Self: [Iterator](trait.iterator "trait std::iter::Iterator")<Item = [(A, B)](../primitive.tuple)>,
Converts an iterator of pairs into a pair of containers. [Read more](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](trait.iterator "trait std::iter::Iterator")<Item = [&'a](../primitive.reference) T>,
Notable traits for [Copied](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](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](trait.iterator "trait std::iter::Iterator")<Item = [&'a](../primitive.reference) T>,
Notable traits for [Cloned](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](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](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](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](trait.sum "trait std::iter::Sum")<Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>,
Sums the elements of an iterator. [Read more](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](trait.product "trait std::iter::Product")<Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>,
Iterates over the entire iterator, multiplying all the elements [Read more](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](trait.intoiterator "trait std::iter::IntoIterator"), F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), <I as [IntoIterator](trait.intoiterator "trait std::iter::IntoIterator")>::[Item](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`](trait.iterator "Iterator") with those of another with respect to the specified comparison function. [Read more](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](trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<<I as [IntoIterator](trait.intoiterator "trait std::iter::IntoIterator")>::[Item](trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>,
[Lexicographically](../cmp/trait.ord#lexicographical-comparison) compares the elements of this [`Iterator`](trait.iterator "Iterator") with those of another. [Read more](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](trait.intoiterator "trait std::iter::IntoIterator"), F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), <I as [IntoIterator](trait.intoiterator "trait std::iter::IntoIterator")>::[Item](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`](trait.iterator "Iterator") with those of another with respect to the specified comparison function. [Read more](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](trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialEq](../cmp/trait.partialeq "trait std::cmp::PartialEq")<<I as [IntoIterator](trait.intoiterator "trait std::iter::IntoIterator")>::[Item](trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>,
Determines if the elements of this [`Iterator`](trait.iterator "Iterator") are equal to those of another. [Read more](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](trait.intoiterator "trait std::iter::IntoIterator"), F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), <I as [IntoIterator](trait.intoiterator "trait std::iter::IntoIterator")>::[Item](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`](trait.iterator "Iterator") are equal to those of another with respect to the specified equality function. [Read more](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](trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialEq](../cmp/trait.partialeq "trait std::cmp::PartialEq")<<I as [IntoIterator](trait.intoiterator "trait std::iter::IntoIterator")>::[Item](trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>,
Determines if the elements of this [`Iterator`](trait.iterator "Iterator") are unequal to those of another. [Read more](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](trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<<I as [IntoIterator](trait.intoiterator "trait std::iter::IntoIterator")>::[Item](trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>,
Determines if the elements of this [`Iterator`](trait.iterator "Iterator") are [lexicographically](../cmp/trait.ord#lexicographical-comparison) less than those of another. [Read more](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](trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<<I as [IntoIterator](trait.intoiterator "trait std::iter::IntoIterator")>::[Item](trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>,
Determines if the elements of this [`Iterator`](trait.iterator "Iterator") are [lexicographically](../cmp/trait.ord#lexicographical-comparison) less or equal to those of another. [Read more](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](trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<<I as [IntoIterator](trait.intoiterator "trait std::iter::IntoIterator")>::[Item](trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>,
Determines if the elements of this [`Iterator`](trait.iterator "Iterator") are [lexicographically](../cmp/trait.ord#lexicographical-comparison) greater than those of another. [Read more](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](trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<<I as [IntoIterator](trait.intoiterator "trait std::iter::IntoIterator")>::[Item](trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>,
Determines if the elements of this [`Iterator`](trait.iterator "Iterator") are [lexicographically](../cmp/trait.ord#lexicographical-comparison) greater than or equal to those of another. [Read more](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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), &Self::[Item](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](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](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](trait.iterator#method.is_sorted_by_key)
[source](https://doc.rust-lang.org/src/core/iter/adapters/chain.rs.html#270)1.26.0 · ### impl<A, B> FusedIterator for Chain<A, B>where A: [FusedIterator](trait.fusediterator "trait std::iter::FusedIterator"), B: [FusedIterator](trait.fusediterator "trait std::iter::FusedIterator")<Item = <A as [Iterator](trait.iterator "trait std::iter::Iterator")>::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>,
[source](https://doc.rust-lang.org/src/core/iter/adapters/chain.rs.html#278)### impl<A, B> TrustedLen for Chain<A, B>where A: [TrustedLen](trait.trustedlen "trait std::iter::TrustedLen"), B: [TrustedLen](trait.trustedlen "trait std::iter::TrustedLen")<Item = <A as [Iterator](trait.iterator "trait std::iter::Iterator")>::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>,
Auto Trait Implementations
--------------------------
### impl<A, B> RefUnwindSafe for Chain<A, B>where A: [RefUnwindSafe](../panic/trait.refunwindsafe "trait std::panic::RefUnwindSafe"), B: [RefUnwindSafe](../panic/trait.refunwindsafe "trait std::panic::RefUnwindSafe"),
### impl<A, B> Send for Chain<A, B>where A: [Send](../marker/trait.send "trait std::marker::Send"), B: [Send](../marker/trait.send "trait std::marker::Send"),
### impl<A, B> Sync for Chain<A, B>where A: [Sync](../marker/trait.sync "trait std::marker::Sync"), B: [Sync](../marker/trait.sync "trait std::marker::Sync"),
### impl<A, B> Unpin for Chain<A, B>where A: [Unpin](../marker/trait.unpin "trait std::marker::Unpin"), B: [Unpin](../marker/trait.unpin "trait std::marker::Unpin"),
### impl<A, B> UnwindSafe for Chain<A, B>where A: [UnwindSafe](../panic/trait.unwindsafe "trait std::panic::UnwindSafe"), B: [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](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](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::iter::OnceWith Struct std::iter::OnceWith
==========================
```
pub struct OnceWith<F> { /* private fields */ }
```
An iterator that yields a single element of type `A` by applying the provided closure `F: FnOnce() -> A`.
This `struct` is created by the [`once_with()`](fn.once_with "once_with()") function. See its documentation for more.
Trait Implementations
---------------------
[source](https://doc.rust-lang.org/src/core/iter/sources/once_with.rs.html#69)### impl<F> Clone for OnceWith<F>where F: [Clone](../clone/trait.clone "trait std::clone::Clone"),
[source](https://doc.rust-lang.org/src/core/iter/sources/once_with.rs.html#69)#### fn clone(&self) -> OnceWith<F>
Notable traits for [OnceWith](struct.oncewith "struct std::iter::OnceWith")<F>
```
impl<A, F> Iterator for OnceWith<F>where
F: FnOnce() -> 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)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/iter/sources/once_with.rs.html#69)### impl<F> Debug for OnceWith<F>where F: [Debug](../fmt/trait.debug "trait std::fmt::Debug"),
[source](https://doc.rust-lang.org/src/core/iter/sources/once_with.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/iter/sources/once_with.rs.html#92)### impl<A, F> DoubleEndedIterator for OnceWith<F>where F: [FnOnce](../ops/trait.fnonce "trait std::ops::FnOnce")() -> A,
[source](https://doc.rust-lang.org/src/core/iter/sources/once_with.rs.html#93)#### fn next\_back(&mut self) -> Option<A>
Removes and returns an element from the end of the iterator. [Read more](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](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](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](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()`](trait.iterator#method.try_fold "Iterator::try_fold()"): it takes elements starting from the back of the iterator. [Read more](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](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](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](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](trait.doubleendediterator#method.rfind)
[source](https://doc.rust-lang.org/src/core/iter/sources/once_with.rs.html#99)### impl<A, F> ExactSizeIterator for OnceWith<F>where F: [FnOnce](../ops/trait.fnonce "trait std::ops::FnOnce")() -> A,
[source](https://doc.rust-lang.org/src/core/iter/sources/once_with.rs.html#100)#### fn len(&self) -> usize
Returns the exact remaining length of the iterator. [Read more](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](trait.exactsizeiterator#method.is_empty)
[source](https://doc.rust-lang.org/src/core/iter/sources/once_with.rs.html#76)### impl<A, F> Iterator for OnceWith<F>where F: [FnOnce](../ops/trait.fnonce "trait std::ops::FnOnce")() -> A,
#### type Item = A
The type of the elements being iterated over.
[source](https://doc.rust-lang.org/src/core/iter/sources/once_with.rs.html#80)#### fn next(&mut self) -> Option<A>
Advances the iterator and returns the next value. [Read more](trait.iterator#tymethod.next)
[source](https://doc.rust-lang.org/src/core/iter/sources/once_with.rs.html#86)#### fn size\_hint(&self) -> (usize, Option<usize>)
Returns the bounds on the remaining length of the iterator. [Read more](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](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](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](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](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](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](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](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](trait.intoiterator "trait std::iter::IntoIterator")<Item = Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>,
Notable traits for [Chain](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](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](trait.intoiterator "trait std::iter::IntoIterator"),
Notable traits for [Zip](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](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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"),
Notable traits for [IntersperseWith](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](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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> B,
Notable traits for [Map](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](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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")),
Calls a closure on each element of an iterator. [Read more](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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool),
Notable traits for [Filter](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](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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Option](../option/enum.option "enum std::option::Option")<B>,
Notable traits for [FilterMap](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](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](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](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](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`](struct.peekable#method.peek) and [`peek_mut`](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](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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool),
Notable traits for [SkipWhile](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`](trait.iterator#method.skip)s elements based on a predicate. [Read more](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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool),
Notable traits for [TakeWhile](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](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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Option](../option/enum.option "enum std::option::Option")<B>,
Notable traits for [MapWhile](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](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](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](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](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](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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Option](../option/enum.option "enum std::option::Option")<B>,
Notable traits for [Scan](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`](trait.iterator#method.fold) that holds internal state and produces a new iterator. [Read more](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](trait.intoiterator "trait std::iter::IntoIterator"), F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> U,
Notable traits for [FlatMap](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](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](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](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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")),
Notable traits for [Inspect](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](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](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](trait.fromiterator "trait std::iter::FromIterator")<Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>,
Transforms an iterator into a collection. [Read more](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](trait.extend "trait std::iter::Extend")<Self::[Item](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](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](trait.extend "trait std::iter::Extend")<Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>, F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool),
Consumes an iterator, creating two collections from it. [Read more](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](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](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](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](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](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](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](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](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](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](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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"),
Reduces the elements to a single one, by repeatedly applying a reducing operation. [Read more](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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> R, R: [Try](../ops/trait.try "trait std::ops::Try")<Output = Self::[Item](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](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](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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool),
Tests if every element of the iterator matches a predicate. [Read more](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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool),
Tests if any element of the iterator matches a predicate. [Read more](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](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](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](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](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](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](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](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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool),
Searches for an element in an iterator, returning its index. [Read more](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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool), Self: [ExactSizeIterator](trait.exactsizeiterator "trait std::iter::ExactSizeIterator") + [DoubleEndedIterator](trait.doubleendediterator "trait std::iter::DoubleEndedIterator"),
Searches for an element in an iterator from the right, returning its index. [Read more](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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> B,
Returns the element that gives the maximum value from the specified function. [Read more](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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), &Self::[Item](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](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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> B,
Returns the element that gives the minimum value from the specified function. [Read more](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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), &Self::[Item](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](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](trait.doubleendediterator "trait std::iter::DoubleEndedIterator"),
Notable traits for [Rev](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](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](trait.extend "trait std::iter::Extend")<A>, FromB: [Default](../default/trait.default "trait std::default::Default") + [Extend](trait.extend "trait std::iter::Extend")<B>, Self: [Iterator](trait.iterator "trait std::iter::Iterator")<Item = [(A, B)](../primitive.tuple)>,
Converts an iterator of pairs into a pair of containers. [Read more](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](trait.iterator "trait std::iter::Iterator")<Item = [&'a](../primitive.reference) T>,
Notable traits for [Copied](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](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](trait.iterator "trait std::iter::Iterator")<Item = [&'a](../primitive.reference) T>,
Notable traits for [Cloned](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](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](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](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](trait.sum "trait std::iter::Sum")<Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>,
Sums the elements of an iterator. [Read more](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](trait.product "trait std::iter::Product")<Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>,
Iterates over the entire iterator, multiplying all the elements [Read more](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](trait.intoiterator "trait std::iter::IntoIterator"), F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), <I as [IntoIterator](trait.intoiterator "trait std::iter::IntoIterator")>::[Item](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`](trait.iterator "Iterator") with those of another with respect to the specified comparison function. [Read more](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](trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<<I as [IntoIterator](trait.intoiterator "trait std::iter::IntoIterator")>::[Item](trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>,
[Lexicographically](../cmp/trait.ord#lexicographical-comparison) compares the elements of this [`Iterator`](trait.iterator "Iterator") with those of another. [Read more](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](trait.intoiterator "trait std::iter::IntoIterator"), F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), <I as [IntoIterator](trait.intoiterator "trait std::iter::IntoIterator")>::[Item](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`](trait.iterator "Iterator") with those of another with respect to the specified comparison function. [Read more](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](trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialEq](../cmp/trait.partialeq "trait std::cmp::PartialEq")<<I as [IntoIterator](trait.intoiterator "trait std::iter::IntoIterator")>::[Item](trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>,
Determines if the elements of this [`Iterator`](trait.iterator "Iterator") are equal to those of another. [Read more](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](trait.intoiterator "trait std::iter::IntoIterator"), F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), <I as [IntoIterator](trait.intoiterator "trait std::iter::IntoIterator")>::[Item](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`](trait.iterator "Iterator") are equal to those of another with respect to the specified equality function. [Read more](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](trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialEq](../cmp/trait.partialeq "trait std::cmp::PartialEq")<<I as [IntoIterator](trait.intoiterator "trait std::iter::IntoIterator")>::[Item](trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>,
Determines if the elements of this [`Iterator`](trait.iterator "Iterator") are unequal to those of another. [Read more](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](trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<<I as [IntoIterator](trait.intoiterator "trait std::iter::IntoIterator")>::[Item](trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>,
Determines if the elements of this [`Iterator`](trait.iterator "Iterator") are [lexicographically](../cmp/trait.ord#lexicographical-comparison) less than those of another. [Read more](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](trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<<I as [IntoIterator](trait.intoiterator "trait std::iter::IntoIterator")>::[Item](trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>,
Determines if the elements of this [`Iterator`](trait.iterator "Iterator") are [lexicographically](../cmp/trait.ord#lexicographical-comparison) less or equal to those of another. [Read more](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](trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<<I as [IntoIterator](trait.intoiterator "trait std::iter::IntoIterator")>::[Item](trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>,
Determines if the elements of this [`Iterator`](trait.iterator "Iterator") are [lexicographically](../cmp/trait.ord#lexicographical-comparison) greater than those of another. [Read more](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](trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<<I as [IntoIterator](trait.intoiterator "trait std::iter::IntoIterator")>::[Item](trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>,
Determines if the elements of this [`Iterator`](trait.iterator "Iterator") are [lexicographically](../cmp/trait.ord#lexicographical-comparison) greater than or equal to those of another. [Read more](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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), &Self::[Item](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](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](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](trait.iterator#method.is_sorted_by_key)
[source](https://doc.rust-lang.org/src/core/iter/sources/once_with.rs.html#106)### impl<A, F> FusedIterator for OnceWith<F>where F: [FnOnce](../ops/trait.fnonce "trait std::ops::FnOnce")() -> A,
[source](https://doc.rust-lang.org/src/core/iter/sources/once_with.rs.html#109)### impl<A, F> TrustedLen for OnceWith<F>where F: [FnOnce](../ops/trait.fnonce "trait std::ops::FnOnce")() -> A,
Auto Trait Implementations
--------------------------
### impl<F> RefUnwindSafe for OnceWith<F>where F: [RefUnwindSafe](../panic/trait.refunwindsafe "trait std::panic::RefUnwindSafe"),
### impl<F> Send for OnceWith<F>where F: [Send](../marker/trait.send "trait std::marker::Send"),
### impl<F> Sync for OnceWith<F>where F: [Sync](../marker/trait.sync "trait std::marker::Sync"),
### impl<F> Unpin for OnceWith<F>where F: [Unpin](../marker/trait.unpin "trait std::marker::Unpin"),
### impl<F> UnwindSafe for OnceWith<F>where F: [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](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](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 Module std::iter Module std::iter
================
Composable external iteration.
If you’ve found yourself with a collection of some kind, and needed to perform an operation on the elements of said collection, you’ll quickly run into ‘iterators’. Iterators are heavily used in idiomatic Rust code, so it’s worth becoming familiar with them.
Before explaining more, let’s talk about how this module is structured:
Organization
------------
This module is largely organized by type:
* [Traits](#traits) are the core portion: these traits define what kind of iterators exist and what you can do with them. The methods of these traits are worth putting some extra study time into.
* [Functions](#functions) provide some helpful ways to create some basic iterators.
* [Structs](#structs) are often the return types of the various methods on this module’s traits. You’ll usually want to look at the method that creates the `struct`, rather than the `struct` itself. For more detail about why, see ‘[Implementing Iterator](#implementing-iterator)’.
That’s it! Let’s dig into iterators.
Iterator
--------
The heart and soul of this module is the [`Iterator`](trait.iterator "Iterator") trait. The core of [`Iterator`](trait.iterator "Iterator") looks like this:
```
trait Iterator {
type Item;
fn next(&mut self) -> Option<Self::Item>;
}
```
An iterator has a method, [`next`](trait.iterator#tymethod.next), which when called, returns an `[Option](../option/enum.option "Option")<Item>`. Calling [`next`](trait.iterator#tymethod.next) will return [`Some(Item)`](../option/enum.option#variant.Some) as long as there are elements, and once they’ve all been exhausted, will return `None` to indicate that iteration is finished. Individual iterators may choose to resume iteration, and so calling [`next`](trait.iterator#tymethod.next) again may or may not eventually start returning [`Some(Item)`](../option/enum.option#variant.Some) again at some point (for example, see [`TryIter`](../sync/mpsc/struct.tryiter)).
[`Iterator`](trait.iterator "Iterator")’s full definition includes a number of other methods as well, but they are default methods, built on top of [`next`](trait.iterator#tymethod.next), and so you get them for free.
Iterators are also composable, and it’s common to chain them together to do more complex forms of processing. See the [Adapters](#adapters) section below for more details.
The three forms of iteration
----------------------------
There are three common methods which can create iterators from a collection:
* `iter()`, which iterates over `&T`.
* `iter_mut()`, which iterates over `&mut T`.
* `into_iter()`, which iterates over `T`.
Various things in the standard library may implement one or more of the three, where appropriate.
Implementing Iterator
---------------------
Creating an iterator of your own involves two steps: creating a `struct` to hold the iterator’s state, and then implementing [`Iterator`](trait.iterator "Iterator") for that `struct`. This is why there are so many `struct`s in this module: there is one for each iterator and iterator adapter.
Let’s make an iterator named `Counter` which counts from `1` to `5`:
```
// First, the struct:
/// An iterator which counts from one to five
struct Counter {
count: usize,
}
// we want our count to start at one, so let's add a new() method to help.
// This isn't strictly necessary, but is convenient. Note that we start
// `count` at zero, we'll see why in `next()`'s implementation below.
impl Counter {
fn new() -> Counter {
Counter { count: 0 }
}
}
// Then, we implement `Iterator` for our `Counter`:
impl Iterator for Counter {
// we will be counting with usize
type Item = usize;
// next() is the only required method
fn next(&mut self) -> Option<Self::Item> {
// Increment our count. This is why we started at zero.
self.count += 1;
// Check to see if we've finished counting or not.
if self.count < 6 {
Some(self.count)
} else {
None
}
}
}
// And now we can use it!
let mut counter = Counter::new();
assert_eq!(counter.next(), Some(1));
assert_eq!(counter.next(), Some(2));
assert_eq!(counter.next(), Some(3));
assert_eq!(counter.next(), Some(4));
assert_eq!(counter.next(), Some(5));
assert_eq!(counter.next(), None);
```
Calling [`next`](trait.iterator#tymethod.next) this way gets repetitive. Rust has a construct which can call [`next`](trait.iterator#tymethod.next) on your iterator, until it reaches `None`. Let’s go over that next.
Also note that `Iterator` provides a default implementation of methods such as `nth` and `fold` which call `next` internally. However, it is also possible to write a custom implementation of methods like `nth` and `fold` if an iterator can compute them more efficiently without calling `next`.
`for` loops and `IntoIterator`
-------------------------------
Rust’s `for` loop syntax is actually sugar for iterators. Here’s a basic example of `for`:
```
let values = vec![1, 2, 3, 4, 5];
for x in values {
println!("{x}");
}
```
This will print the numbers one through five, each on their own line. But you’ll notice something here: we never called anything on our vector to produce an iterator. What gives?
There’s a trait in the standard library for converting something into an iterator: [`IntoIterator`](trait.intoiterator "IntoIterator"). This trait has one method, [`into_iter`](trait.intoiterator#tymethod.into_iter), which converts the thing implementing [`IntoIterator`](trait.intoiterator "IntoIterator") into an iterator. Let’s take a look at that `for` loop again, and what the compiler converts it into:
```
let values = vec![1, 2, 3, 4, 5];
for x in values {
println!("{x}");
}
```
Rust de-sugars this into:
```
let values = vec![1, 2, 3, 4, 5];
{
let result = match IntoIterator::into_iter(values) {
mut iter => loop {
let next;
match iter.next() {
Some(val) => next = val,
None => break,
};
let x = next;
let () = { println!("{x}"); };
},
};
result
}
```
First, we call `into_iter()` on the value. Then, we match on the iterator that returns, calling [`next`](trait.iterator#tymethod.next) over and over until we see a `None`. At that point, we `break` out of the loop, and we’re done iterating.
There’s one more subtle bit here: the standard library contains an interesting implementation of [`IntoIterator`](trait.intoiterator "IntoIterator"):
ⓘ
```
impl<I: Iterator> IntoIterator for I
```
In other words, all [`Iterator`](trait.iterator "Iterator")s implement [`IntoIterator`](trait.intoiterator "IntoIterator"), by just returning themselves. This means two things:
1. If you’re writing an [`Iterator`](trait.iterator "Iterator"), you can use it with a `for` loop.
2. If you’re creating a collection, implementing [`IntoIterator`](trait.intoiterator "IntoIterator") for it will allow your collection to be used with the `for` loop.
Iterating by reference
----------------------
Since [`into_iter()`](trait.intoiterator#tymethod.into_iter) takes `self` by value, using a `for` loop to iterate over a collection consumes that collection. Often, you may want to iterate over a collection without consuming it. Many collections offer methods that provide iterators over references, conventionally called `iter()` and `iter_mut()` respectively:
```
let mut values = vec![41];
for x in values.iter_mut() {
*x += 1;
}
for x in values.iter() {
assert_eq!(*x, 42);
}
assert_eq!(values.len(), 1); // `values` is still owned by this function.
```
If a collection type `C` provides `iter()`, it usually also implements `IntoIterator` for `&C`, with an implementation that just calls `iter()`. Likewise, a collection `C` that provides `iter_mut()` generally implements `IntoIterator` for `&mut C` by delegating to `iter_mut()`. This enables a convenient shorthand:
```
let mut values = vec![41];
for x in &mut values { // same as `values.iter_mut()`
*x += 1;
}
for x in &values { // same as `values.iter()`
assert_eq!(*x, 42);
}
assert_eq!(values.len(), 1);
```
While many collections offer `iter()`, not all offer `iter_mut()`. For example, mutating the keys of a [`HashSet<T>`](../collections/struct.hashset) could put the collection into an inconsistent state if the key hashes change, so this collection only offers `iter()`.
Adapters
--------
Functions which take an [`Iterator`](trait.iterator "Iterator") and return another [`Iterator`](trait.iterator "Iterator") are often called ‘iterator adapters’, as they’re a form of the ‘adapter pattern’.
Common iterator adapters include [`map`](trait.iterator#method.map), [`take`](trait.iterator#method.take), and [`filter`](trait.iterator#method.filter). For more, see their documentation.
If an iterator adapter panics, the iterator will be in an unspecified (but memory safe) state. This state is also not guaranteed to stay the same across versions of Rust, so you should avoid relying on the exact values returned by an iterator which panicked.
Laziness
--------
Iterators (and iterator [adapters](#adapters)) are *lazy*. This means that just creating an iterator doesn’t *do* a whole lot. Nothing really happens until you call [`next`](trait.iterator#tymethod.next). This is sometimes a source of confusion when creating an iterator solely for its side effects. For example, the [`map`](trait.iterator#method.map) method calls a closure on each element it iterates over:
```
let v = vec![1, 2, 3, 4, 5];
v.iter().map(|x| println!("{x}"));
```
This will not print any values, as we only created an iterator, rather than using it. The compiler will warn us about this kind of behavior:
```
warning: unused result that must be used: iterators are lazy and
do nothing unless consumed
```
The idiomatic way to write a [`map`](trait.iterator#method.map) for its side effects is to use a `for` loop or call the [`for_each`](trait.iterator#method.for_each) method:
```
let v = vec![1, 2, 3, 4, 5];
v.iter().for_each(|x| println!("{x}"));
// or
for x in &v {
println!("{x}");
}
```
Another common way to evaluate an iterator is to use the [`collect`](trait.iterator#method.collect) method to produce a new collection.
Infinity
--------
Iterators do not have to be finite. As an example, an open-ended range is an infinite iterator:
```
let numbers = 0..;
```
It is common to use the [`take`](trait.iterator#method.take) iterator adapter to turn an infinite iterator into a finite one:
```
let numbers = 0..;
let five_numbers = numbers.take(5);
for number in five_numbers {
println!("{number}");
}
```
This will print the numbers `0` through `4`, each on their own line.
Bear in mind that methods on infinite iterators, even those for which a result can be determined mathematically in finite time, might not terminate. Specifically, methods such as [`min`](trait.iterator#method.min), which in the general case require traversing every element in the iterator, are likely not to return successfully for any infinite iterators.
```
let ones = std::iter::repeat(1);
let least = ones.min().unwrap(); // Oh no! An infinite loop!
// `ones.min()` causes an infinite loop, so we won't reach this point!
println!("The smallest number one is {least}.");
```
Structs
-------
[ArrayChunks](struct.arraychunks "std::iter::ArrayChunks struct")Experimental
An iterator over `N` elements of the iterator at a time.
[ByRefSized](struct.byrefsized "std::iter::ByRefSized struct")Experimental
Like `Iterator::by_ref`, but requiring `Sized` so it can forward generics.
[Intersperse](struct.intersperse "std::iter::Intersperse struct")Experimental
An iterator adapter that places a separator between all elements.
[IntersperseWith](struct.interspersewith "std::iter::IntersperseWith struct")Experimental
An iterator adapter that places a separator between all elements.
[Chain](struct.chain "std::iter::Chain struct")
An iterator that links two iterators together, in a chain.
[Cloned](struct.cloned "std::iter::Cloned struct")
An iterator that clones the elements of an underlying iterator.
[Copied](struct.copied "std::iter::Copied struct")
An iterator that copies the elements of an underlying iterator.
[Cycle](struct.cycle "std::iter::Cycle struct")
An iterator that repeats endlessly.
[Empty](struct.empty "std::iter::Empty struct")
An iterator that yields nothing.
[Enumerate](struct.enumerate "std::iter::Enumerate struct")
An iterator that yields the current count and the element during iteration.
[Filter](struct.filter "std::iter::Filter struct")
An iterator that filters the elements of `iter` with `predicate`.
[FilterMap](struct.filtermap "std::iter::FilterMap struct")
An iterator that uses `f` to both filter and map elements from `iter`.
[FlatMap](struct.flatmap "std::iter::FlatMap struct")
An iterator that maps each element to an iterator, and yields the elements of the produced iterators.
[Flatten](struct.flatten "std::iter::Flatten struct")
An iterator that flattens one level of nesting in an iterator of things that can be turned into iterators.
[FromFn](struct.fromfn "std::iter::FromFn struct")
An iterator where each iteration calls the provided closure `F: FnMut() -> Option<T>`.
[Fuse](struct.fuse "std::iter::Fuse struct")
An iterator that yields `None` forever after the underlying iterator yields `None` once.
[Inspect](struct.inspect "std::iter::Inspect struct")
An iterator that calls a function with a reference to each element before yielding it.
[Map](struct.map "std::iter::Map struct")
An iterator that maps the values of `iter` with `f`.
[MapWhile](struct.mapwhile "std::iter::MapWhile struct")
An iterator that only accepts elements while `predicate` returns `Some(_)`.
[Once](struct.once "std::iter::Once struct")
An iterator that yields an element exactly once.
[OnceWith](struct.oncewith "std::iter::OnceWith struct")
An iterator that yields a single element of type `A` by applying the provided closure `F: FnOnce() -> A`.
[Peekable](struct.peekable "std::iter::Peekable struct")
An iterator with a `peek()` that returns an optional reference to the next element.
[Repeat](struct.repeat "std::iter::Repeat struct")
An iterator that repeats an element endlessly.
[RepeatWith](struct.repeatwith "std::iter::RepeatWith struct")
An iterator that repeats elements of type `A` endlessly by applying the provided closure `F: FnMut() -> A`.
[Rev](struct.rev "std::iter::Rev struct")
A double-ended iterator with the direction inverted.
[Scan](struct.scan "std::iter::Scan struct")
An iterator to maintain state while iterating another iterator.
[Skip](struct.skip "std::iter::Skip struct")
An iterator that skips over `n` elements of `iter`.
[SkipWhile](struct.skipwhile "std::iter::SkipWhile struct")
An iterator that rejects elements while `predicate` returns `true`.
[StepBy](struct.stepby "std::iter::StepBy struct")
An iterator for stepping iterators by a custom amount.
[Successors](struct.successors "std::iter::Successors struct")
An new iterator where each successive item is computed based on the preceding one.
[Take](struct.take "std::iter::Take struct")
An iterator that only iterates over the first `n` iterations of `iter`.
[TakeWhile](struct.takewhile "std::iter::TakeWhile struct")
An iterator that only accepts elements while `predicate` returns `true`.
[Zip](struct.zip "std::iter::Zip struct")
An iterator that iterates two other iterators simultaneously.
Traits
------
[Step](trait.step "std::iter::Step trait")Experimental
Objects that have a notion of *successor* and *predecessor* operations.
[TrustedLen](trait.trustedlen "std::iter::TrustedLen trait")Experimental
An iterator that reports an accurate length using size\_hint.
[TrustedStep](trait.trustedstep "std::iter::TrustedStep trait")Experimental
A type that upholds all invariants of [`Step`](trait.step "Step").
[DoubleEndedIterator](trait.doubleendediterator "std::iter::DoubleEndedIterator trait")
An iterator able to yield elements from both ends.
[ExactSizeIterator](trait.exactsizeiterator "std::iter::ExactSizeIterator trait")
An iterator that knows its exact length.
[Extend](trait.extend "std::iter::Extend trait")
Extend a collection with the contents of an iterator.
[FromIterator](trait.fromiterator "std::iter::FromIterator trait")
Conversion from an [`Iterator`](trait.iterator "Iterator").
[FusedIterator](trait.fusediterator "std::iter::FusedIterator trait")
An iterator that always continues to yield `None` when exhausted.
[IntoIterator](trait.intoiterator "std::iter::IntoIterator trait")
Conversion into an [`Iterator`](trait.iterator "Iterator").
[Iterator](trait.iterator "std::iter::Iterator trait")
An interface for dealing with iterators.
[Product](trait.product "std::iter::Product trait")
Trait to represent types that can be created by multiplying elements of an iterator.
[Sum](trait.sum "std::iter::Sum trait")
Trait to represent types that can be created by summing up an iterator.
Functions
---------
[from\_generator](fn.from_generator "std::iter::from_generator fn")Experimental
Creates a new iterator where each iteration calls the provided generator.
[empty](fn.empty "std::iter::empty fn")
Creates an iterator that yields nothing.
[from\_fn](fn.from_fn "std::iter::from_fn fn")
Creates a new iterator where each iteration calls the provided closure `F: FnMut() -> Option<T>`.
[once](fn.once "std::iter::once fn")
Creates an iterator that yields an element exactly once.
[once\_with](fn.once_with "std::iter::once_with fn")
Creates an iterator that lazily generates a value exactly once by invoking the provided closure.
[repeat](fn.repeat "std::iter::repeat fn")
Creates a new iterator that endlessly repeats a single element.
[repeat\_with](fn.repeat_with "std::iter::repeat_with fn")
Creates a new iterator that repeats elements of type `A` endlessly by applying the provided closure, the repeater, `F: FnMut() -> A`.
[successors](fn.successors "std::iter::successors fn")
Creates a new iterator where each successive item is computed based on the preceding one.
[zip](fn.zip "std::iter::zip fn")
Converts the arguments to iterators and zips them.
rust Function std::iter::once_with Function std::iter::once\_with
==============================
```
pub fn once_with<A, F>(gen: F) -> OnceWith<F>ⓘNotable traits for OnceWith<F>impl<A, F> Iterator for OnceWith<F>where F: FnOnce() -> A, type Item = A;where F: FnOnce() -> A,
```
Creates an iterator that lazily generates a value exactly once by invoking the provided closure.
This is commonly used to adapt a single value generator into a [`chain()`](trait.iterator#method.chain) of other kinds of iteration. Maybe you have an iterator that covers almost everything, but you need an extra special case. Maybe you have a function which works on iterators, but you only need to process one value.
Unlike [`once()`](fn.once), this function will lazily generate the value on request.
Examples
--------
Basic usage:
```
use std::iter;
// one is the loneliest number
let mut one = iter::once_with(|| 1);
assert_eq!(Some(1), one.next());
// just one, that's all we get
assert_eq!(None, one.next());
```
Chaining together with another iterator. Let’s say that we want to iterate over each file of the `.foo` directory, but also a configuration file, `.foorc`:
```
use std::iter;
use std::fs;
use std::path::PathBuf;
let dirs = fs::read_dir(".foo").unwrap();
// we need to convert from an iterator of DirEntry-s to an iterator of
// PathBufs, so we use map
let dirs = dirs.map(|file| file.unwrap().path());
// now, our iterator just for our config file
let config = iter::once_with(|| PathBuf::from(".foorc"));
// chain the two iterators together into one big iterator
let files = dirs.chain(config);
// this will give us all of the files in .foo as well as .foorc
for f in files {
println!("{f:?}");
}
```
| programming_docs |
rust Trait std::iter::FromIterator Trait std::iter::FromIterator
=============================
```
pub trait FromIterator<A> {
fn from_iter<T>(iter: T) -> Self where T: IntoIterator<Item = A>;
}
```
Conversion from an [`Iterator`](trait.iterator "Iterator").
By implementing `FromIterator` for a type, you define how it will be created from an iterator. This is common for types which describe a collection of some kind.
If you want to create a collection from the contents of an iterator, the [`Iterator::collect()`](trait.iterator#method.collect "Iterator::collect()") method is preferred. However, when you need to specify the container type, [`FromIterator::from_iter()`](trait.fromiterator#tymethod.from_iter "FromIterator::from_iter()") can be more readable than using a turbofish (e.g. `::<Vec<_>>()`). See the [`Iterator::collect()`](trait.iterator#method.collect "Iterator::collect()") documentation for more examples of its use.
See also: [`IntoIterator`](trait.intoiterator "IntoIterator").
Examples
--------
Basic usage:
```
let five_fives = std::iter::repeat(5).take(5);
let v = Vec::from_iter(five_fives);
assert_eq!(v, vec![5, 5, 5, 5, 5]);
```
Using [`Iterator::collect()`](trait.iterator#method.collect "Iterator::collect()") to implicitly use `FromIterator`:
```
let five_fives = std::iter::repeat(5).take(5);
let v: Vec<i32> = five_fives.collect();
assert_eq!(v, vec![5, 5, 5, 5, 5]);
```
Using [`FromIterator::from_iter()`](trait.fromiterator#tymethod.from_iter "FromIterator::from_iter()") as a more readable alternative to [`Iterator::collect()`](trait.iterator#method.collect "Iterator::collect()"):
```
use std::collections::VecDeque;
let first = (0..10).collect::<VecDeque<i32>>();
let second = VecDeque::from_iter(0..10);
assert_eq!(first, second);
```
Implementing `FromIterator` for your type:
```
// A sample collection, that's just a wrapper over Vec<T>
#[derive(Debug)]
struct MyCollection(Vec<i32>);
// Let's give it some methods so we can create one and add things
// to it.
impl MyCollection {
fn new() -> MyCollection {
MyCollection(Vec::new())
}
fn add(&mut self, elem: i32) {
self.0.push(elem);
}
}
// and we'll implement FromIterator
impl FromIterator<i32> for MyCollection {
fn from_iter<I: IntoIterator<Item=i32>>(iter: I) -> Self {
let mut c = MyCollection::new();
for i in iter {
c.add(i);
}
c
}
}
// Now we can make a new iterator...
let iter = (0..5).into_iter();
// ... and make a MyCollection out of it
let c = MyCollection::from_iter(iter);
assert_eq!(c.0, vec![0, 1, 2, 3, 4]);
// collect works too!
let iter = (0..5).into_iter();
let c: MyCollection = iter.collect();
assert_eq!(c.0, vec![0, 1, 2, 3, 4]);
```
Required Methods
----------------
[source](https://doc.rust-lang.org/src/core/iter/traits/collect.rs.html#141)#### fn from\_iter<T>(iter: T) -> Selfwhere T: [IntoIterator](trait.intoiterator "trait std::iter::IntoIterator")<Item = A>,
Creates a value from an iterator.
See the [module-level documentation](index) for more.
##### Examples
Basic usage:
```
let five_fives = std::iter::repeat(5).take(5);
let v = Vec::from_iter(five_fives);
assert_eq!(v, vec![5, 5, 5, 5, 5]);
```
Implementors
------------
[source](https://doc.rust-lang.org/src/alloc/string.rs.html#1976)### impl FromIterator<char> for String
[source](https://doc.rust-lang.org/src/core/unit.rs.html#17)1.23.0 · ### impl FromIterator<()> for ()
Collapses all unit items from an iterator into one.
This is more useful when combined with higher-level abstractions, like collecting to a `Result<(), E>` where you only care about errors:
```
use std::io::*;
let data = vec![1, 2, 3, 4, 5];
let res: Result<()> = data.iter()
.map(|x| writeln!(stdout(), "{x}"))
.collect();
assert!(res.is_ok());
```
[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/std/ffi/os_str.rs.html#1396-1412)1.52.0 · ### impl FromIterator<OsString> for OsString
[source](https://doc.rust-lang.org/src/alloc/string.rs.html#2006)1.4.0 · ### impl FromIterator<String> for String
[source](https://doc.rust-lang.org/src/alloc/string.rs.html#1986)1.17.0 · ### impl<'a> FromIterator<&'a char> for String
[source](https://doc.rust-lang.org/src/alloc/string.rs.html#1996)### impl<'a> FromIterator<&'a str> for String
[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/alloc/string.rs.html#2035)1.19.0 · ### impl<'a> FromIterator<Cow<'a, str>> for String
[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/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#2807)1.12.0 · ### impl<'a> FromIterator<String> for Cow<'a, str>
[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/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/core/result.rs.html#2024)### impl<A, E, V> FromIterator<Result<A, E>> for Result<V, E>where V: [FromIterator](trait.fromiterator "trait std::iter::FromIterator")<A>,
[source](https://doc.rust-lang.org/src/core/option.rs.html#2214)### impl<A, V> FromIterator<Option<A>> for Option<V>where V: [FromIterator](trait.fromiterator "trait std::iter::FromIterator")<A>,
[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/collections/btree/map.rs.html#2110)### impl<K, V> FromIterator<(K, V)> for BTreeMap<K, V, Global>where K: [Ord](../cmp/trait.ord "trait std::cmp::Ord"),
[source](https://doc.rust-lang.org/src/std/collections/hash/map.rs.html#3016-3026)### impl<K, V, S> FromIterator<(K, V)> for HashMap<K, V, S>where K: [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") + [Default](../default/trait.default "trait std::default::Default"),
[source](https://doc.rust-lang.org/src/std/path.rs.html#1691-1697)### impl<P: AsRef<Path>> FromIterator<P> for PathBuf
[source](https://doc.rust-lang.org/src/alloc/collections/btree/set.rs.html#1203)### impl<T> FromIterator<T> for BTreeSet<T, Global>where T: [Ord](../cmp/trait.ord "trait std::cmp::Ord"),
[source](https://doc.rust-lang.org/src/alloc/collections/binary_heap.rs.html#1613)### impl<T> FromIterator<T> 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#1812)### impl<T> FromIterator<T> for LinkedList<T>
[source](https://doc.rust-lang.org/src/alloc/collections/vec_deque/mod.rs.html#2946)### impl<T> FromIterator<T> for VecDeque<T, Global>
[source](https://doc.rust-lang.org/src/alloc/rc.rs.html#2041)1.37.0 · ### impl<T> FromIterator<T> for Rc<[T]>
[source](https://doc.rust-lang.org/src/alloc/sync.rs.html#2645)1.37.0 · ### impl<T> FromIterator<T> for Arc<[T]>
[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/std/collections/hash/set.rs.html#1022-1033)### impl<T, S> FromIterator<T> for HashSet<T, S>where T: [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") + [Default](../default/trait.default "trait std::default::Default"),
rust Trait std::iter::TrustedStep Trait std::iter::TrustedStep
============================
```
pub unsafe trait TrustedStep: Step { }
```
🔬This is a nightly-only experimental API. (`trusted_step` [#85731](https://github.com/rust-lang/rust/issues/85731))
A type that upholds all invariants of [`Step`](trait.step "Step").
The invariants of [`Step::steps_between()`](trait.step#tymethod.steps_between "Step::steps_between()") are a superset of the invariants of [`TrustedLen`](trait.trustedlen "TrustedLen"). As such, [`TrustedLen`](trait.trustedlen "TrustedLen") is implemented for all range types with the same generic type argument.
Safety
------
The implementation of [`Step`](trait.step "Step") for the given type must guarantee all invariants of all methods are upheld. See the [`Step`](trait.step "Step") trait’s documentation for details. Consumers are free to rely on the invariants in unsafe code.
Implementors
------------
[source](https://doc.rust-lang.org/src/core/iter/range.rs.html#17)### impl TrustedStep for char
[source](https://doc.rust-lang.org/src/core/iter/range.rs.html#17)### impl TrustedStep for i8
[source](https://doc.rust-lang.org/src/core/iter/range.rs.html#17)### impl TrustedStep for i16
[source](https://doc.rust-lang.org/src/core/iter/range.rs.html#17)### impl TrustedStep for i32
[source](https://doc.rust-lang.org/src/core/iter/range.rs.html#17)### impl TrustedStep for i64
[source](https://doc.rust-lang.org/src/core/iter/range.rs.html#17)### impl TrustedStep for i128
[source](https://doc.rust-lang.org/src/core/iter/range.rs.html#17)### impl TrustedStep for isize
[source](https://doc.rust-lang.org/src/core/iter/range.rs.html#17)### impl TrustedStep for u8
[source](https://doc.rust-lang.org/src/core/iter/range.rs.html#17)### impl TrustedStep for u16
[source](https://doc.rust-lang.org/src/core/iter/range.rs.html#17)### impl TrustedStep for u32
[source](https://doc.rust-lang.org/src/core/iter/range.rs.html#17)### impl TrustedStep for u64
[source](https://doc.rust-lang.org/src/core/iter/range.rs.html#17)### impl TrustedStep for u128
[source](https://doc.rust-lang.org/src/core/iter/range.rs.html#17)### impl TrustedStep for usize
rust Struct std::iter::FromFn Struct std::iter::FromFn
========================
```
pub struct FromFn<F>(_);
```
An iterator where each iteration calls the provided closure `F: FnMut() -> Option<T>`.
This `struct` is created by the [`iter::from_fn()`](fn.from_fn) function. See its documentation for more.
Trait Implementations
---------------------
[source](https://doc.rust-lang.org/src/core/iter/sources/from_fn.rs.html#56)### impl<F> Clone for FromFn<F>where F: [Clone](../clone/trait.clone "trait std::clone::Clone"),
[source](https://doc.rust-lang.org/src/core/iter/sources/from_fn.rs.html#56)#### fn clone(&self) -> FromFn<F>
Notable traits for [FromFn](struct.fromfn "struct std::iter::FromFn")<F>
```
impl<T, F> Iterator for FromFn<F>where
F: FnMut() -> Option<T>,
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)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/iter/sources/from_fn.rs.html#74)### impl<F> Debug for FromFn<F>
[source](https://doc.rust-lang.org/src/core/iter/sources/from_fn.rs.html#75)#### 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/iter/sources/from_fn.rs.html#61)### impl<T, F> Iterator for FromFn<F>where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")() -> [Option](../option/enum.option "enum std::option::Option")<T>,
#### type Item = T
The type of the elements being iterated over.
[source](https://doc.rust-lang.org/src/core/iter/sources/from_fn.rs.html#68)#### fn next(&mut self) -> Option<<FromFn<F> as Iterator>::Item>
Advances the iterator and returns the next value. [Read more](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](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](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](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](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](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](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](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](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](trait.intoiterator "trait std::iter::IntoIterator")<Item = Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>,
Notable traits for [Chain](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](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](trait.intoiterator "trait std::iter::IntoIterator"),
Notable traits for [Zip](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](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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"),
Notable traits for [IntersperseWith](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](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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> B,
Notable traits for [Map](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](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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")),
Calls a closure on each element of an iterator. [Read more](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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool),
Notable traits for [Filter](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](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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Option](../option/enum.option "enum std::option::Option")<B>,
Notable traits for [FilterMap](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](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](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](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](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`](struct.peekable#method.peek) and [`peek_mut`](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](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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool),
Notable traits for [SkipWhile](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`](trait.iterator#method.skip)s elements based on a predicate. [Read more](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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool),
Notable traits for [TakeWhile](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](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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Option](../option/enum.option "enum std::option::Option")<B>,
Notable traits for [MapWhile](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](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](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](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](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](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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Option](../option/enum.option "enum std::option::Option")<B>,
Notable traits for [Scan](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`](trait.iterator#method.fold) that holds internal state and produces a new iterator. [Read more](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](trait.intoiterator "trait std::iter::IntoIterator"), F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> U,
Notable traits for [FlatMap](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](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](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](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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")),
Notable traits for [Inspect](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](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](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](trait.fromiterator "trait std::iter::FromIterator")<Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>,
Transforms an iterator into a collection. [Read more](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](trait.extend "trait std::iter::Extend")<Self::[Item](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](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](trait.extend "trait std::iter::Extend")<Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>, F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool),
Consumes an iterator, creating two collections from it. [Read more](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](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](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](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](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](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](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](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](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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"),
Reduces the elements to a single one, by repeatedly applying a reducing operation. [Read more](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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> R, R: [Try](../ops/trait.try "trait std::ops::Try")<Output = Self::[Item](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](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](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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool),
Tests if every element of the iterator matches a predicate. [Read more](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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool),
Tests if any element of the iterator matches a predicate. [Read more](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](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](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](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](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](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](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](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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool),
Searches for an element in an iterator, returning its index. [Read more](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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> B,
Returns the element that gives the maximum value from the specified function. [Read more](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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), &Self::[Item](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](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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> B,
Returns the element that gives the minimum value from the specified function. [Read more](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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), &Self::[Item](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](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](trait.extend "trait std::iter::Extend")<A>, FromB: [Default](../default/trait.default "trait std::default::Default") + [Extend](trait.extend "trait std::iter::Extend")<B>, Self: [Iterator](trait.iterator "trait std::iter::Iterator")<Item = [(A, B)](../primitive.tuple)>,
Converts an iterator of pairs into a pair of containers. [Read more](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](trait.iterator "trait std::iter::Iterator")<Item = [&'a](../primitive.reference) T>,
Notable traits for [Copied](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](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](trait.iterator "trait std::iter::Iterator")<Item = [&'a](../primitive.reference) T>,
Notable traits for [Cloned](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](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](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](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](trait.sum "trait std::iter::Sum")<Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>,
Sums the elements of an iterator. [Read more](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](trait.product "trait std::iter::Product")<Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>,
Iterates over the entire iterator, multiplying all the elements [Read more](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](trait.intoiterator "trait std::iter::IntoIterator"), F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), <I as [IntoIterator](trait.intoiterator "trait std::iter::IntoIterator")>::[Item](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`](trait.iterator "Iterator") with those of another with respect to the specified comparison function. [Read more](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](trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<<I as [IntoIterator](trait.intoiterator "trait std::iter::IntoIterator")>::[Item](trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>,
[Lexicographically](../cmp/trait.ord#lexicographical-comparison) compares the elements of this [`Iterator`](trait.iterator "Iterator") with those of another. [Read more](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](trait.intoiterator "trait std::iter::IntoIterator"), F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), <I as [IntoIterator](trait.intoiterator "trait std::iter::IntoIterator")>::[Item](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`](trait.iterator "Iterator") with those of another with respect to the specified comparison function. [Read more](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](trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialEq](../cmp/trait.partialeq "trait std::cmp::PartialEq")<<I as [IntoIterator](trait.intoiterator "trait std::iter::IntoIterator")>::[Item](trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>,
Determines if the elements of this [`Iterator`](trait.iterator "Iterator") are equal to those of another. [Read more](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](trait.intoiterator "trait std::iter::IntoIterator"), F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), <I as [IntoIterator](trait.intoiterator "trait std::iter::IntoIterator")>::[Item](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`](trait.iterator "Iterator") are equal to those of another with respect to the specified equality function. [Read more](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](trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialEq](../cmp/trait.partialeq "trait std::cmp::PartialEq")<<I as [IntoIterator](trait.intoiterator "trait std::iter::IntoIterator")>::[Item](trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>,
Determines if the elements of this [`Iterator`](trait.iterator "Iterator") are unequal to those of another. [Read more](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](trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<<I as [IntoIterator](trait.intoiterator "trait std::iter::IntoIterator")>::[Item](trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>,
Determines if the elements of this [`Iterator`](trait.iterator "Iterator") are [lexicographically](../cmp/trait.ord#lexicographical-comparison) less than those of another. [Read more](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](trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<<I as [IntoIterator](trait.intoiterator "trait std::iter::IntoIterator")>::[Item](trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>,
Determines if the elements of this [`Iterator`](trait.iterator "Iterator") are [lexicographically](../cmp/trait.ord#lexicographical-comparison) less or equal to those of another. [Read more](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](trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<<I as [IntoIterator](trait.intoiterator "trait std::iter::IntoIterator")>::[Item](trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>,
Determines if the elements of this [`Iterator`](trait.iterator "Iterator") are [lexicographically](../cmp/trait.ord#lexicographical-comparison) greater than those of another. [Read more](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](trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<<I as [IntoIterator](trait.intoiterator "trait std::iter::IntoIterator")>::[Item](trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>,
Determines if the elements of this [`Iterator`](trait.iterator "Iterator") are [lexicographically](../cmp/trait.ord#lexicographical-comparison) greater than or equal to those of another. [Read more](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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), &Self::[Item](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](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](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](trait.iterator#method.is_sorted_by_key)
Auto Trait Implementations
--------------------------
### impl<F> RefUnwindSafe for FromFn<F>where F: [RefUnwindSafe](../panic/trait.refunwindsafe "trait std::panic::RefUnwindSafe"),
### impl<F> Send for FromFn<F>where F: [Send](../marker/trait.send "trait std::marker::Send"),
### impl<F> Sync for FromFn<F>where F: [Sync](../marker/trait.sync "trait std::marker::Sync"),
### impl<F> Unpin for FromFn<F>where F: [Unpin](../marker/trait.unpin "trait std::marker::Unpin"),
### impl<F> UnwindSafe for FromFn<F>where F: [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](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](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::iter::IntoIterator Trait std::iter::IntoIterator
=============================
```
pub trait IntoIterator {
type Item;
type IntoIter: Iterator where <Self::IntoIter as Iterator>::Item == Self::Item;
fn into_iter(self) -> Self::IntoIter;
}
```
Conversion into an [`Iterator`](trait.iterator "Iterator").
By implementing `IntoIterator` for a type, you define how it will be converted to an iterator. This is common for types which describe a collection of some kind.
One benefit of implementing `IntoIterator` is that your type will [work with Rust’s `for` loop syntax](index#for-loops-and-intoiterator).
See also: [`FromIterator`](trait.fromiterator "FromIterator").
Examples
--------
Basic usage:
```
let v = [1, 2, 3];
let mut iter = v.into_iter();
assert_eq!(Some(1), iter.next());
assert_eq!(Some(2), iter.next());
assert_eq!(Some(3), iter.next());
assert_eq!(None, iter.next());
```
Implementing `IntoIterator` for your type:
```
// A sample collection, that's just a wrapper over Vec<T>
#[derive(Debug)]
struct MyCollection(Vec<i32>);
// Let's give it some methods so we can create one and add things
// to it.
impl MyCollection {
fn new() -> MyCollection {
MyCollection(Vec::new())
}
fn add(&mut self, elem: i32) {
self.0.push(elem);
}
}
// and we'll implement IntoIterator
impl IntoIterator for MyCollection {
type Item = i32;
type IntoIter = std::vec::IntoIter<Self::Item>;
fn into_iter(self) -> Self::IntoIter {
self.0.into_iter()
}
}
// Now we can make a new collection...
let mut c = MyCollection::new();
// ... add some stuff to it ...
c.add(0);
c.add(1);
c.add(2);
// ... and then turn it into an Iterator:
for (i, n) in c.into_iter().enumerate() {
assert_eq!(i as i32, n);
}
```
It is common to use `IntoIterator` as a trait bound. This allows the input collection type to change, so long as it is still an iterator. Additional bounds can be specified by restricting on `Item`:
```
fn collect_as_strings<T>(collection: T) -> Vec<String>
where
T: IntoIterator,
T::Item: std::fmt::Debug,
{
collection
.into_iter()
.map(|item| format!("{item:?}"))
.collect()
}
```
Required Associated Types
-------------------------
[source](https://doc.rust-lang.org/src/core/iter/traits/collect.rs.html#234)#### type Item
The type of the elements being iterated over.
[source](https://doc.rust-lang.org/src/core/iter/traits/collect.rs.html#238)#### type IntoIter: Iteratorwhere <Self::[IntoIter](trait.intoiterator#associatedtype.IntoIter "type std::iter::IntoIterator::IntoIter") as [Iterator](trait.iterator "trait std::iter::Iterator")>::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item") == Self::[Item](trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")
Which kind of iterator are we turning this into?
Required Methods
----------------
[source](https://doc.rust-lang.org/src/core/iter/traits/collect.rs.html#261)#### fn into\_iter(self) -> Self::IntoIter
Creates an iterator from a value.
See the [module-level documentation](index) for more.
##### Examples
Basic usage:
```
let v = [1, 2, 3];
let mut iter = v.into_iter();
assert_eq!(Some(1), iter.next());
assert_eq!(Some(2), iter.next());
assert_eq!(Some(3), iter.next());
assert_eq!(None, iter.next());
```
Implementors
------------
[source](https://doc.rust-lang.org/src/std/os/unix/net/listener.rs.html#334-341)1.10.0 · ### impl<'a> IntoIterator for &'a UnixListener
Available on **Unix** only.
#### type Item = Result<UnixStream, Error>
#### type IntoIter = Incoming<'a>
[source](https://doc.rust-lang.org/src/std/path.rs.html#3067-3074)1.6.0 · ### impl<'a> IntoIterator for &'a Path
#### type Item = &'a OsStr
#### type IntoIter = Iter<'a>
[source](https://doc.rust-lang.org/src/std/path.rs.html#3057-3064)1.6.0 · ### impl<'a> IntoIterator for &'a PathBuf
#### type Item = &'a OsStr
#### type IntoIter = Iter<'a>
[source](https://doc.rust-lang.org/src/alloc/collections/btree/map.rs.html#1475)### impl<'a, K, V, A> IntoIterator for &'a BTreeMap<K, V, A>where A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator") + [Clone](../clone/trait.clone "trait std::clone::Clone"),
#### type Item = (&'a K, &'a V)
#### type IntoIter = Iter<'a, K, V>
[source](https://doc.rust-lang.org/src/alloc/collections/btree/map.rs.html#1544)### impl<'a, K, V, A> IntoIterator for &'a mut BTreeMap<K, V, A>where A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator") + [Clone](../clone/trait.clone "trait std::clone::Clone"),
#### type Item = (&'a K, &'a mut V)
#### type IntoIter = IterMut<'a, K, V>
[source](https://doc.rust-lang.org/src/std/collections/hash/map.rs.html#2173-2182)### impl<'a, K, V, S> IntoIterator for &'a HashMap<K, V, S>
#### type Item = (&'a K, &'a V)
#### type IntoIter = Iter<'a, K, V>
[source](https://doc.rust-lang.org/src/std/collections/hash/map.rs.html#2185-2194)### impl<'a, K, V, S> IntoIterator for &'a mut HashMap<K, V, S>
#### type Item = (&'a K, &'a mut V)
#### type IntoIter = IterMut<'a, K, V>
[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
#### type IntoIter = Iter<'a, T>
[source](https://doc.rust-lang.org/src/core/slice/iter.rs.html#19)### impl<'a, T> IntoIterator for &'a [T]
#### type Item = &'a T
#### type IntoIter = Iter<'a, T>
[source](https://doc.rust-lang.org/src/alloc/collections/binary_heap.rs.html#1648)### impl<'a, T> IntoIterator for &'a BinaryHeap<T>
#### type Item = &'a T
#### type IntoIter = Iter<'a, T>
[source](https://doc.rust-lang.org/src/alloc/collections/linked_list.rs.html#1833)### impl<'a, T> IntoIterator for &'a LinkedList<T>
#### type Item = &'a T
#### type IntoIter = Iter<'a, T>
[source](https://doc.rust-lang.org/src/std/sync/mpsc/mod.rs.html#1473-1480)1.1.0 · ### impl<'a, T> IntoIterator for &'a Receiver<T>
#### type Item = T
#### type IntoIter = Iter<'a, T>
[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
#### type IntoIter = IterMut<'a, T>
[source](https://doc.rust-lang.org/src/core/slice/iter.rs.html#29)### impl<'a, T> IntoIterator for &'a mut [T]
#### type Item = &'a mut T
#### type IntoIter = IterMut<'a, T>
[source](https://doc.rust-lang.org/src/alloc/collections/linked_list.rs.html#1843)### impl<'a, T> IntoIterator for &'a mut LinkedList<T>
#### type Item = &'a mut T
#### type IntoIter = IterMut<'a, T>
[source](https://doc.rust-lang.org/src/alloc/collections/btree/set.rs.html#1272)### impl<'a, T, A> IntoIterator for &'a BTreeSet<T, A>where A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator") + [Clone](../clone/trait.clone "trait std::clone::Clone"),
#### type Item = &'a T
#### type IntoIter = Iter<'a, T>
[source](https://doc.rust-lang.org/src/alloc/collections/vec_deque/mod.rs.html#2969)### impl<'a, T, A> IntoIterator for &'a VecDeque<T, A>where A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"),
#### type Item = &'a T
#### type IntoIter = Iter<'a, T>
[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
#### type IntoIter = Iter<'a, T>
[source](https://doc.rust-lang.org/src/alloc/collections/vec_deque/mod.rs.html#2979)### impl<'a, T, A> IntoIterator for &'a mut VecDeque<T, A>where A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"),
#### type Item = &'a mut T
#### type IntoIter = IterMut<'a, T>
[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
#### type IntoIter = IterMut<'a, T>
[source](https://doc.rust-lang.org/src/core/result.rs.html#1858)1.4.0 · ### impl<'a, T, E> IntoIterator for &'a Result<T, E>
#### type Item = &'a T
#### type IntoIter = Iter<'a, T>
[source](https://doc.rust-lang.org/src/core/result.rs.html#1868)1.4.0 · ### impl<'a, T, E> IntoIterator for &'a mut Result<T, E>
#### type Item = &'a mut T
#### type IntoIter = IterMut<'a, T>
[source](https://doc.rust-lang.org/src/std/collections/hash/set.rs.html#1446-1455)### impl<'a, T, S> IntoIterator for &'a HashSet<T, S>
#### type Item = &'a T
#### type IntoIter = Iter<'a, T>
[source](https://doc.rust-lang.org/src/core/array/mod.rs.html#268)### impl<'a, T, const N: usize> IntoIterator for &'a [T; N]
#### type Item = &'a T
#### type IntoIter = Iter<'a, T>
[source](https://doc.rust-lang.org/src/core/array/mod.rs.html#278)### impl<'a, T, const N: usize> IntoIterator for &'a mut [T; N]
#### type Item = &'a mut T
#### type IntoIter = IterMut<'a, T>
[source](https://doc.rust-lang.org/src/core/iter/traits/collect.rs.html#266)const: [unstable](https://github.com/rust-lang/rust/issues/90603 "Tracking issue for const_intoiterator_identity") · ### impl<I> IntoIterator for Iwhere I: [Iterator](trait.iterator "trait std::iter::Iterator"),
#### type Item = <I as Iterator>::Item
#### type IntoIter = I
[source](https://doc.rust-lang.org/src/alloc/collections/btree/map.rs.html#1614)### impl<K, V, A> IntoIterator for BTreeMap<K, V, A>where A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator") + [Clone](../clone/trait.clone "trait std::clone::Clone"),
#### type Item = (K, V)
#### type IntoIter = IntoIter<K, V, A>
[source](https://doc.rust-lang.org/src/std/collections/hash/map.rs.html#2197-2224)### impl<K, V, S> IntoIterator for HashMap<K, V, S>
#### type Item = (K, V)
#### type IntoIter = IntoIter<K, V>
[source](https://doc.rust-lang.org/src/core/option.rs.html#1928)### impl<T> IntoIterator for Option<T>
#### type Item = T
#### type IntoIter = IntoIter<T>
[source](https://doc.rust-lang.org/src/alloc/collections/binary_heap.rs.html#1620)### impl<T> IntoIterator for BinaryHeap<T>
#### type Item = T
#### type IntoIter = IntoIter<T>
[source](https://doc.rust-lang.org/src/alloc/collections/linked_list.rs.html#1821)### impl<T> IntoIterator for LinkedList<T>
#### type Item = T
#### type IntoIter = IntoIter<T>
[source](https://doc.rust-lang.org/src/std/sync/mpsc/mod.rs.html#1491-1498)1.1.0 · ### impl<T> IntoIterator for Receiver<T>
#### type Item = T
#### type IntoIter = IntoIter<T>
[source](https://doc.rust-lang.org/src/alloc/collections/btree/set.rs.html#1250)### impl<T, A> IntoIterator for BTreeSet<T, A>where A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator") + [Clone](../clone/trait.clone "trait std::clone::Clone"),
#### type Item = T
#### type IntoIter = IntoIter<T, A>
[source](https://doc.rust-lang.org/src/alloc/collections/vec_deque/mod.rs.html#2957)### impl<T, A> IntoIterator for VecDeque<T, A>where A: [Allocator](../alloc/trait.allocator "trait std::alloc::Allocator"),
#### type Item = T
#### type IntoIter = IntoIter<T, A>
[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"),
#### type Item = T
#### type IntoIter = IntoIter<T, A>
[source](https://doc.rust-lang.org/src/core/result.rs.html#1830)### impl<T, E> IntoIterator for Result<T, E>
#### type Item = T
#### type IntoIter = IntoIter<T>
[source](https://doc.rust-lang.org/src/std/collections/hash/set.rs.html#1458-1487)### impl<T, S> IntoIterator for HashSet<T, S>
#### type Item = T
#### type IntoIter = IntoIter<T>
[source](https://doc.rust-lang.org/src/core/array/iter.rs.html#41)1.53.0 · ### impl<T, const N: usize> IntoIterator for [T; N]
#### type Item = T
#### type IntoIter = IntoIter<T, N>
rust Trait std::iter::Product Trait std::iter::Product
========================
```
pub trait Product<A = Self> {
fn product<I>(iter: I) -> Self where I: Iterator<Item = A>;
}
```
Trait to represent types that can be created by multiplying elements of an iterator.
This trait is used to implement [`Iterator::product()`](trait.iterator#method.product "Iterator::product()"). Types which implement this trait can be generated by using the [`product()`](trait.iterator#method.product) method on an iterator. Like [`FromIterator`](trait.fromiterator), this trait should rarely be called directly.
Required Methods
----------------
[source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#34)#### fn product<I>(iter: I) -> Selfwhere I: [Iterator](trait.iterator "trait std::iter::Iterator")<Item = A>,
Method which takes an iterator and generates `Self` from the elements by multiplying the items.
Implementors
------------
[source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#142)### impl Product<f32> for f32
[source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#142)### impl Product<f64> for f64
[source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)### impl Product<i8> for i8
[source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)### impl Product<i16> for i16
[source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)### impl Product<i32> for i32
[source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)### impl Product<i64> for i64
[source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)### impl Product<i128> for i128
[source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)### impl Product<isize> for isize
[source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)### impl Product<u8> for u8
[source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)### impl Product<u16> for u16
[source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)### impl Product<u32> for u32
[source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)### impl Product<u64> for u64
[source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)### impl Product<u128> for u128
[source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)### impl Product<usize> for usize
[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)1.14.0 · ### impl Product<Wrapping<i16>> for Wrapping<i16>
[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)1.14.0 · ### impl Product<Wrapping<i64>> for Wrapping<i64>
[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)1.14.0 · ### impl Product<Wrapping<isize>> for Wrapping<isize>
[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)1.14.0 · ### impl Product<Wrapping<u16>> for Wrapping<u16>
[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)1.14.0 · ### impl Product<Wrapping<u64>> for Wrapping<u64>
[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)1.14.0 · ### impl Product<Wrapping<usize>> for Wrapping<usize>
[source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#142)### impl<'a> Product<&'a f32> for f32
[source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#142)### impl<'a> Product<&'a f64> for f64
[source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)### impl<'a> Product<&'a i8> for i8
[source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)### impl<'a> Product<&'a i16> for i16
[source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)### impl<'a> Product<&'a i32> for i32
[source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)### impl<'a> Product<&'a i64> for i64
[source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)### impl<'a> Product<&'a i128> for i128
[source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)### impl<'a> Product<&'a isize> for isize
[source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)### impl<'a> Product<&'a u8> for u8
[source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)### impl<'a> Product<&'a u16> for u16
[source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)### impl<'a> Product<&'a u32> for u32
[source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)### impl<'a> Product<&'a u64> for u64
[source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)### impl<'a> Product<&'a u128> for u128
[source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#141)### impl<'a> Product<&'a usize> for usize
[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)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)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)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)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)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)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)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)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)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)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)1.14.0 · ### impl<'a> Product<&'a Wrapping<usize>> for Wrapping<usize>
[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](../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/iter.rs.html#48)### impl<'a, const LANES: usize> Product<&'a Simd<f64, LANES>> for Simd<f64, LANES>where [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/iter.rs.html#54)### impl<'a, const LANES: usize> Product<&'a Simd<i8, LANES>> for Simd<i8, LANES>where [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/iter.rs.html#55)### impl<'a, const LANES: usize> Product<&'a Simd<i16, LANES>> for Simd<i16, LANES>where [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/iter.rs.html#56)### impl<'a, const LANES: usize> Product<&'a Simd<i32, LANES>> for Simd<i32, LANES>where [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/iter.rs.html#57)### impl<'a, const LANES: usize> Product<&'a Simd<i64, LANES>> for Simd<i64, LANES>where [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/iter.rs.html#58)### impl<'a, const LANES: usize> Product<&'a Simd<isize, LANES>> for Simd<isize, LANES>where [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/iter.rs.html#49)### impl<'a, const LANES: usize> Product<&'a Simd<u8, LANES>> for Simd<u8, LANES>where [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/iter.rs.html#50)### impl<'a, const LANES: usize> Product<&'a Simd<u16, LANES>> for Simd<u16, LANES>where [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/iter.rs.html#51)### impl<'a, const LANES: usize> Product<&'a Simd<u32, LANES>> for Simd<u32, LANES>where [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/iter.rs.html#52)### impl<'a, const LANES: usize> Product<&'a Simd<u64, LANES>> for Simd<u64, LANES>where [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/iter.rs.html#53)### impl<'a, const LANES: usize> Product<&'a Simd<usize, LANES>> for Simd<usize, LANES>where [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/iter/traits/accum.rs.html#218)1.37.0 · ### impl<T, U> Product<Option<U>> for Option<T>where T: [Product](trait.product "trait std::iter::Product")<U>,
[source](https://doc.rust-lang.org/src/core/iter/traits/accum.rs.html#175)1.16.0 · ### impl<T, U, E> Product<Result<U, E>> for Result<T, E>where T: [Product](trait.product "trait std::iter::Product")<U>,
[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](../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/iter.rs.html#48)### impl<const LANES: usize> Product<Simd<f64, LANES>> for Simd<f64, LANES>where [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/iter.rs.html#54)### impl<const LANES: usize> Product<Simd<i8, LANES>> for Simd<i8, LANES>where [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/iter.rs.html#55)### impl<const LANES: usize> Product<Simd<i16, LANES>> for Simd<i16, LANES>where [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/iter.rs.html#56)### impl<const LANES: usize> Product<Simd<i32, LANES>> for Simd<i32, LANES>where [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/iter.rs.html#57)### impl<const LANES: usize> Product<Simd<i64, LANES>> for Simd<i64, LANES>where [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/iter.rs.html#58)### impl<const LANES: usize> Product<Simd<isize, LANES>> for Simd<isize, LANES>where [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/iter.rs.html#49)### impl<const LANES: usize> Product<Simd<u8, LANES>> for Simd<u8, LANES>where [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/iter.rs.html#50)### impl<const LANES: usize> Product<Simd<u16, LANES>> for Simd<u16, LANES>where [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/iter.rs.html#51)### impl<const LANES: usize> Product<Simd<u32, LANES>> for Simd<u32, LANES>where [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/iter.rs.html#52)### impl<const LANES: usize> Product<Simd<u64, LANES>> for Simd<u64, LANES>where [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/iter.rs.html#53)### impl<const LANES: usize> Product<Simd<usize, LANES>> for Simd<usize, LANES>where [LaneCount](../simd/struct.lanecount "struct std::simd::LaneCount")<LANES>: [SupportedLaneCount](../simd/trait.supportedlanecount "trait std::simd::SupportedLaneCount"),
| programming_docs |
rust Struct std::iter::Cloned Struct std::iter::Cloned
========================
```
pub struct Cloned<I> { /* private fields */ }
```
An iterator that clones the elements of an underlying iterator.
This `struct` is created by the [`cloned`](trait.iterator#method.cloned) method on [`Iterator`](trait.iterator). See its documentation for more.
Trait Implementations
---------------------
[source](https://doc.rust-lang.org/src/core/iter/adapters/cloned.rs.html#16)### impl<I> Clone for Cloned<I>where I: [Clone](../clone/trait.clone "trait std::clone::Clone"),
[source](https://doc.rust-lang.org/src/core/iter/adapters/cloned.rs.html#16)#### fn clone(&self) -> Cloned<I>
Notable traits for [Cloned](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;
```
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/iter/adapters/cloned.rs.html#16)### impl<I> Debug for Cloned<I>where I: [Debug](../fmt/trait.debug "trait std::fmt::Debug"),
[source](https://doc.rust-lang.org/src/core/iter/adapters/cloned.rs.html#16)#### 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/iter/adapters/cloned.rs.html#74)### impl<'a, I, T> DoubleEndedIterator for Cloned<I>where T: 'a + [Clone](../clone/trait.clone "trait std::clone::Clone"), I: [DoubleEndedIterator](trait.doubleendediterator "trait std::iter::DoubleEndedIterator")<Item = [&'a](../primitive.reference) T>,
[source](https://doc.rust-lang.org/src/core/iter/adapters/cloned.rs.html#79)#### fn next\_back(&mut self) -> Option<T>
Removes and returns an element from the end of the iterator. [Read more](trait.doubleendediterator#tymethod.next_back)
[source](https://doc.rust-lang.org/src/core/iter/adapters/cloned.rs.html#83-87)#### fn try\_rfold<B, F, R>(&mut self, init: B, f: F) -> Rwhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(B, <[Cloned](struct.cloned "struct std::iter::Cloned")<I> as [Iterator](trait.iterator "trait std::iter::Iterator")>::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> R, R: [Try](../ops/trait.try "trait std::ops::Try")<Output = B>, [Cloned](struct.cloned "struct std::iter::Cloned")<I>: [Sized](../marker/trait.sized "trait std::marker::Sized"),
This is the reverse version of [`Iterator::try_fold()`](trait.iterator#method.try_fold "Iterator::try_fold()"): it takes elements starting from the back of the iterator. [Read more](trait.doubleendediterator#method.try_rfold)
[source](https://doc.rust-lang.org/src/core/iter/adapters/cloned.rs.html#92-94)#### fn rfold<Acc, F>(self, init: Acc, f: F) -> Accwhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Acc, <[Cloned](struct.cloned "struct std::iter::Cloned")<I> as [Iterator](trait.iterator "trait std::iter::Iterator")>::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> Acc,
An iterator method that reduces the iterator’s elements to a single, final value, starting from the back. [Read more](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](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](trait.doubleendediterator#method.nth_back)
[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](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](trait.doubleendediterator#method.rfind)
[source](https://doc.rust-lang.org/src/core/iter/adapters/cloned.rs.html#101)### impl<'a, I, T> ExactSizeIterator for Cloned<I>where T: 'a + [Clone](../clone/trait.clone "trait std::clone::Clone"), I: [ExactSizeIterator](trait.exactsizeiterator "trait std::iter::ExactSizeIterator")<Item = [&'a](../primitive.reference) T>,
[source](https://doc.rust-lang.org/src/core/iter/adapters/cloned.rs.html#106)#### fn len(&self) -> usize
Returns the exact remaining length of the iterator. [Read more](trait.exactsizeiterator#method.len)
[source](https://doc.rust-lang.org/src/core/iter/adapters/cloned.rs.html#110)#### 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](trait.exactsizeiterator#method.is_empty)
[source](https://doc.rust-lang.org/src/core/iter/adapters/cloned.rs.html#32)### impl<'a, I, T> Iterator for Cloned<I>where T: 'a + [Clone](../clone/trait.clone "trait std::clone::Clone"), I: [Iterator](trait.iterator "trait std::iter::Iterator")<Item = [&'a](../primitive.reference) T>,
#### type Item = T
The type of the elements being iterated over.
[source](https://doc.rust-lang.org/src/core/iter/adapters/cloned.rs.html#39)#### fn next(&mut self) -> Option<T>
Advances the iterator and returns the next value. [Read more](trait.iterator#tymethod.next)
[source](https://doc.rust-lang.org/src/core/iter/adapters/cloned.rs.html#43)#### fn size\_hint(&self) -> (usize, Option<usize>)
Returns the bounds on the remaining length of the iterator. [Read more](trait.iterator#method.size_hint)
[source](https://doc.rust-lang.org/src/core/iter/adapters/cloned.rs.html#47-51)#### fn try\_fold<B, F, R>(&mut self, init: B, f: F) -> Rwhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(B, <[Cloned](struct.cloned "struct std::iter::Cloned")<I> as [Iterator](trait.iterator "trait std::iter::Iterator")>::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> R, R: [Try](../ops/trait.try "trait std::ops::Try")<Output = B>, [Cloned](struct.cloned "struct std::iter::Cloned")<I>: [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](trait.iterator#method.try_fold)
[source](https://doc.rust-lang.org/src/core/iter/adapters/cloned.rs.html#56-58)#### fn fold<Acc, F>(self, init: Acc, f: F) -> Accwhere F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Acc, <[Cloned](struct.cloned "struct std::iter::Cloned")<I> as [Iterator](trait.iterator "trait std::iter::Iterator")>::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> Acc,
Folds every element into an accumulator by applying an operation, returning the final result. [Read more](trait.iterator#method.fold)
[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](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](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](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](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](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](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](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](trait.intoiterator "trait std::iter::IntoIterator")<Item = Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>,
Notable traits for [Chain](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](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](trait.intoiterator "trait std::iter::IntoIterator"),
Notable traits for [Zip](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](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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"),
Notable traits for [IntersperseWith](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](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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> B,
Notable traits for [Map](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](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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")),
Calls a closure on each element of an iterator. [Read more](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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool),
Notable traits for [Filter](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](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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Option](../option/enum.option "enum std::option::Option")<B>,
Notable traits for [FilterMap](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](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](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](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](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`](struct.peekable#method.peek) and [`peek_mut`](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](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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool),
Notable traits for [SkipWhile](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`](trait.iterator#method.skip)s elements based on a predicate. [Read more](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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool),
Notable traits for [TakeWhile](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](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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Option](../option/enum.option "enum std::option::Option")<B>,
Notable traits for [MapWhile](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](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](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](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](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](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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Option](../option/enum.option "enum std::option::Option")<B>,
Notable traits for [Scan](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`](trait.iterator#method.fold) that holds internal state and produces a new iterator. [Read more](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](trait.intoiterator "trait std::iter::IntoIterator"), F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> U,
Notable traits for [FlatMap](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](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](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](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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")),
Notable traits for [Inspect](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](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](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](trait.fromiterator "trait std::iter::FromIterator")<Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>,
Transforms an iterator into a collection. [Read more](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](trait.extend "trait std::iter::Extend")<Self::[Item](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](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](trait.extend "trait std::iter::Extend")<Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>, F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool),
Consumes an iterator, creating two collections from it. [Read more](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](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](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](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](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](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](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"),
Reduces the elements to a single one, by repeatedly applying a reducing operation. [Read more](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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> R, R: [Try](../ops/trait.try "trait std::ops::Try")<Output = Self::[Item](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](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](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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool),
Tests if every element of the iterator matches a predicate. [Read more](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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool),
Tests if any element of the iterator matches a predicate. [Read more](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](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](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](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](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](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](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](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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool),
Searches for an element in an iterator, returning its index. [Read more](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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> B,
Returns the element that gives the maximum value from the specified function. [Read more](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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), &Self::[Item](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](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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> B,
Returns the element that gives the minimum value from the specified function. [Read more](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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), &Self::[Item](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](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](trait.extend "trait std::iter::Extend")<A>, FromB: [Default](../default/trait.default "trait std::default::Default") + [Extend](trait.extend "trait std::iter::Extend")<B>, Self: [Iterator](trait.iterator "trait std::iter::Iterator")<Item = [(A, B)](../primitive.tuple)>,
Converts an iterator of pairs into a pair of containers. [Read more](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](trait.iterator "trait std::iter::Iterator")<Item = [&'a](../primitive.reference) T>,
Notable traits for [Copied](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](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](trait.iterator "trait std::iter::Iterator")<Item = [&'a](../primitive.reference) T>,
Notable traits for [Cloned](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](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](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](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](trait.sum "trait std::iter::Sum")<Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>,
Sums the elements of an iterator. [Read more](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](trait.product "trait std::iter::Product")<Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>,
Iterates over the entire iterator, multiplying all the elements [Read more](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](trait.intoiterator "trait std::iter::IntoIterator"), F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), <I as [IntoIterator](trait.intoiterator "trait std::iter::IntoIterator")>::[Item](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`](trait.iterator "Iterator") with those of another with respect to the specified comparison function. [Read more](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](trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<<I as [IntoIterator](trait.intoiterator "trait std::iter::IntoIterator")>::[Item](trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>,
[Lexicographically](../cmp/trait.ord#lexicographical-comparison) compares the elements of this [`Iterator`](trait.iterator "Iterator") with those of another. [Read more](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](trait.intoiterator "trait std::iter::IntoIterator"), F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), <I as [IntoIterator](trait.intoiterator "trait std::iter::IntoIterator")>::[Item](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`](trait.iterator "Iterator") with those of another with respect to the specified comparison function. [Read more](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](trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialEq](../cmp/trait.partialeq "trait std::cmp::PartialEq")<<I as [IntoIterator](trait.intoiterator "trait std::iter::IntoIterator")>::[Item](trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>,
Determines if the elements of this [`Iterator`](trait.iterator "Iterator") are equal to those of another. [Read more](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](trait.intoiterator "trait std::iter::IntoIterator"), F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), <I as [IntoIterator](trait.intoiterator "trait std::iter::IntoIterator")>::[Item](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`](trait.iterator "Iterator") are equal to those of another with respect to the specified equality function. [Read more](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](trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialEq](../cmp/trait.partialeq "trait std::cmp::PartialEq")<<I as [IntoIterator](trait.intoiterator "trait std::iter::IntoIterator")>::[Item](trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>,
Determines if the elements of this [`Iterator`](trait.iterator "Iterator") are unequal to those of another. [Read more](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](trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<<I as [IntoIterator](trait.intoiterator "trait std::iter::IntoIterator")>::[Item](trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>,
Determines if the elements of this [`Iterator`](trait.iterator "Iterator") are [lexicographically](../cmp/trait.ord#lexicographical-comparison) less than those of another. [Read more](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](trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<<I as [IntoIterator](trait.intoiterator "trait std::iter::IntoIterator")>::[Item](trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>,
Determines if the elements of this [`Iterator`](trait.iterator "Iterator") are [lexicographically](../cmp/trait.ord#lexicographical-comparison) less or equal to those of another. [Read more](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](trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<<I as [IntoIterator](trait.intoiterator "trait std::iter::IntoIterator")>::[Item](trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>,
Determines if the elements of this [`Iterator`](trait.iterator "Iterator") are [lexicographically](../cmp/trait.ord#lexicographical-comparison) greater than those of another. [Read more](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](trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<<I as [IntoIterator](trait.intoiterator "trait std::iter::IntoIterator")>::[Item](trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>,
Determines if the elements of this [`Iterator`](trait.iterator "Iterator") are [lexicographically](../cmp/trait.ord#lexicographical-comparison) greater than or equal to those of another. [Read more](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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), &Self::[Item](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](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](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](trait.iterator#method.is_sorted_by_key)
[source](https://doc.rust-lang.org/src/core/iter/adapters/cloned.rs.html#116)1.26.0 · ### impl<'a, I, T> FusedIterator for Cloned<I>where T: 'a + [Clone](../clone/trait.clone "trait std::clone::Clone"), I: [FusedIterator](trait.fusediterator "trait std::iter::FusedIterator")<Item = [&'a](../primitive.reference) T>,
[source](https://doc.rust-lang.org/src/core/iter/adapters/cloned.rs.html#137)### impl<'a, I, T> TrustedLen for Cloned<I>where T: 'a + [Clone](../clone/trait.clone "trait std::clone::Clone"), I: [TrustedLen](trait.trustedlen "trait std::iter::TrustedLen")<Item = [&'a](../primitive.reference) T>,
Auto Trait Implementations
--------------------------
### impl<I> RefUnwindSafe for Cloned<I>where I: [RefUnwindSafe](../panic/trait.refunwindsafe "trait std::panic::RefUnwindSafe"),
### impl<I> Send for Cloned<I>where I: [Send](../marker/trait.send "trait std::marker::Send"),
### impl<I> Sync for Cloned<I>where I: [Sync](../marker/trait.sync "trait std::marker::Sync"),
### impl<I> Unpin for Cloned<I>where I: [Unpin](../marker/trait.unpin "trait std::marker::Unpin"),
### impl<I> UnwindSafe for Cloned<I>where I: [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](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](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::iter::Repeat Struct std::iter::Repeat
========================
```
pub struct Repeat<A> { /* private fields */ }
```
An iterator that repeats an element endlessly.
This `struct` is created by the [`repeat()`](fn.repeat "repeat()") function. See its documentation for more.
Trait Implementations
---------------------
[source](https://doc.rust-lang.org/src/core/iter/sources/repeat.rs.html#62)### impl<A> Clone for Repeat<A>where A: [Clone](../clone/trait.clone "trait std::clone::Clone"),
[source](https://doc.rust-lang.org/src/core/iter/sources/repeat.rs.html#62)#### fn clone(&self) -> Repeat<A>
Notable traits for [Repeat](struct.repeat "struct std::iter::Repeat")<A>
```
impl<A> Iterator for Repeat<A>where
A: Clone,
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/iter/sources/repeat.rs.html#62)### impl<A> Debug for Repeat<A>where A: [Debug](../fmt/trait.debug "trait std::fmt::Debug"),
[source](https://doc.rust-lang.org/src/core/iter/sources/repeat.rs.html#62)#### 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/iter/sources/repeat.rs.html#105)### impl<A> DoubleEndedIterator for Repeat<A>where A: [Clone](../clone/trait.clone "trait std::clone::Clone"),
[source](https://doc.rust-lang.org/src/core/iter/sources/repeat.rs.html#107)#### fn next\_back(&mut self) -> Option<A>
Removes and returns an element from the end of the iterator. [Read more](trait.doubleendediterator#tymethod.next_back)
[source](https://doc.rust-lang.org/src/core/iter/sources/repeat.rs.html#112)#### 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](trait.doubleendediterator#method.advance_back_by)
[source](https://doc.rust-lang.org/src/core/iter/sources/repeat.rs.html#119)#### fn nth\_back(&mut self, n: usize) -> Option<A>
Returns the `n`th element from the end of the iterator. [Read more](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](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()`](trait.iterator#method.try_fold "Iterator::try_fold()"): it takes elements starting from the back of the iterator. [Read more](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](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](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](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](trait.doubleendediterator#method.rfind)
[source](https://doc.rust-lang.org/src/core/iter/sources/repeat.rs.html#69)### impl<A> Iterator for Repeat<A>where A: [Clone](../clone/trait.clone "trait std::clone::Clone"),
#### type Item = A
The type of the elements being iterated over.
[source](https://doc.rust-lang.org/src/core/iter/sources/repeat.rs.html#73)#### fn next(&mut self) -> Option<A>
Advances the iterator and returns the next value. [Read more](trait.iterator#tymethod.next)
[source](https://doc.rust-lang.org/src/core/iter/sources/repeat.rs.html#78)#### fn size\_hint(&self) -> (usize, Option<usize>)
Returns the bounds on the remaining length of the iterator. [Read more](trait.iterator#method.size_hint)
[source](https://doc.rust-lang.org/src/core/iter/sources/repeat.rs.html#83)#### 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](trait.iterator#method.advance_by)
[source](https://doc.rust-lang.org/src/core/iter/sources/repeat.rs.html#90)#### fn nth(&mut self, n: usize) -> Option<A>
Returns the `n`th element of the iterator. [Read more](trait.iterator#method.nth)
[source](https://doc.rust-lang.org/src/core/iter/sources/repeat.rs.html#95)#### fn last(self) -> Option<A>
Consumes the iterator, returning the last element. [Read more](trait.iterator#method.last)
[source](https://doc.rust-lang.org/src/core/iter/sources/repeat.rs.html#99)#### fn count(self) -> usize
Consumes the iterator, counting the number of iterations and returning it. [Read more](trait.iterator#method.count)
[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](trait.iterator#method.next_chunk)
[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](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](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](trait.intoiterator "trait std::iter::IntoIterator")<Item = Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>,
Notable traits for [Chain](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](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](trait.intoiterator "trait std::iter::IntoIterator"),
Notable traits for [Zip](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](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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"),
Notable traits for [IntersperseWith](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](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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> B,
Notable traits for [Map](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](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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")),
Calls a closure on each element of an iterator. [Read more](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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool),
Notable traits for [Filter](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](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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Option](../option/enum.option "enum std::option::Option")<B>,
Notable traits for [FilterMap](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](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](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](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](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`](struct.peekable#method.peek) and [`peek_mut`](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](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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool),
Notable traits for [SkipWhile](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`](trait.iterator#method.skip)s elements based on a predicate. [Read more](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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool),
Notable traits for [TakeWhile](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](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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Option](../option/enum.option "enum std::option::Option")<B>,
Notable traits for [MapWhile](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](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](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](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](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](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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Option](../option/enum.option "enum std::option::Option")<B>,
Notable traits for [Scan](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`](trait.iterator#method.fold) that holds internal state and produces a new iterator. [Read more](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](trait.intoiterator "trait std::iter::IntoIterator"), F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> U,
Notable traits for [FlatMap](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](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](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](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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")),
Notable traits for [Inspect](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](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](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](trait.fromiterator "trait std::iter::FromIterator")<Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>,
Transforms an iterator into a collection. [Read more](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](trait.extend "trait std::iter::Extend")<Self::[Item](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](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](trait.extend "trait std::iter::Extend")<Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>, F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool),
Consumes an iterator, creating two collections from it. [Read more](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](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](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](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](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](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](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](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](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](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](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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"),
Reduces the elements to a single one, by repeatedly applying a reducing operation. [Read more](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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> R, R: [Try](../ops/trait.try "trait std::ops::Try")<Output = Self::[Item](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](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](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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool),
Tests if every element of the iterator matches a predicate. [Read more](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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool),
Tests if any element of the iterator matches a predicate. [Read more](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](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](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](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](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](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](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](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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool),
Searches for an element in an iterator, returning its index. [Read more](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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> B,
Returns the element that gives the maximum value from the specified function. [Read more](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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), &Self::[Item](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](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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> B,
Returns the element that gives the minimum value from the specified function. [Read more](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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), &Self::[Item](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](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](trait.doubleendediterator "trait std::iter::DoubleEndedIterator"),
Notable traits for [Rev](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](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](trait.extend "trait std::iter::Extend")<A>, FromB: [Default](../default/trait.default "trait std::default::Default") + [Extend](trait.extend "trait std::iter::Extend")<B>, Self: [Iterator](trait.iterator "trait std::iter::Iterator")<Item = [(A, B)](../primitive.tuple)>,
Converts an iterator of pairs into a pair of containers. [Read more](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](trait.iterator "trait std::iter::Iterator")<Item = [&'a](../primitive.reference) T>,
Notable traits for [Copied](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](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](trait.iterator "trait std::iter::Iterator")<Item = [&'a](../primitive.reference) T>,
Notable traits for [Cloned](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](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](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](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](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](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](trait.sum "trait std::iter::Sum")<Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>,
Sums the elements of an iterator. [Read more](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](trait.product "trait std::iter::Product")<Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>,
Iterates over the entire iterator, multiplying all the elements [Read more](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](trait.intoiterator "trait std::iter::IntoIterator"), F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), <I as [IntoIterator](trait.intoiterator "trait std::iter::IntoIterator")>::[Item](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`](trait.iterator "Iterator") with those of another with respect to the specified comparison function. [Read more](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](trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<<I as [IntoIterator](trait.intoiterator "trait std::iter::IntoIterator")>::[Item](trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>,
[Lexicographically](../cmp/trait.ord#lexicographical-comparison) compares the elements of this [`Iterator`](trait.iterator "Iterator") with those of another. [Read more](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](trait.intoiterator "trait std::iter::IntoIterator"), F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), <I as [IntoIterator](trait.intoiterator "trait std::iter::IntoIterator")>::[Item](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`](trait.iterator "Iterator") with those of another with respect to the specified comparison function. [Read more](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](trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialEq](../cmp/trait.partialeq "trait std::cmp::PartialEq")<<I as [IntoIterator](trait.intoiterator "trait std::iter::IntoIterator")>::[Item](trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>,
Determines if the elements of this [`Iterator`](trait.iterator "Iterator") are equal to those of another. [Read more](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](trait.intoiterator "trait std::iter::IntoIterator"), F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), <I as [IntoIterator](trait.intoiterator "trait std::iter::IntoIterator")>::[Item](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`](trait.iterator "Iterator") are equal to those of another with respect to the specified equality function. [Read more](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](trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialEq](../cmp/trait.partialeq "trait std::cmp::PartialEq")<<I as [IntoIterator](trait.intoiterator "trait std::iter::IntoIterator")>::[Item](trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>,
Determines if the elements of this [`Iterator`](trait.iterator "Iterator") are unequal to those of another. [Read more](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](trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<<I as [IntoIterator](trait.intoiterator "trait std::iter::IntoIterator")>::[Item](trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>,
Determines if the elements of this [`Iterator`](trait.iterator "Iterator") are [lexicographically](../cmp/trait.ord#lexicographical-comparison) less than those of another. [Read more](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](trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<<I as [IntoIterator](trait.intoiterator "trait std::iter::IntoIterator")>::[Item](trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>,
Determines if the elements of this [`Iterator`](trait.iterator "Iterator") are [lexicographically](../cmp/trait.ord#lexicographical-comparison) less or equal to those of another. [Read more](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](trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<<I as [IntoIterator](trait.intoiterator "trait std::iter::IntoIterator")>::[Item](trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>,
Determines if the elements of this [`Iterator`](trait.iterator "Iterator") are [lexicographically](../cmp/trait.ord#lexicographical-comparison) greater than those of another. [Read more](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](trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<<I as [IntoIterator](trait.intoiterator "trait std::iter::IntoIterator")>::[Item](trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>,
Determines if the elements of this [`Iterator`](trait.iterator "Iterator") are [lexicographically](../cmp/trait.ord#lexicographical-comparison) greater than or equal to those of another. [Read more](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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), &Self::[Item](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](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](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](trait.iterator#method.is_sorted_by_key)
[source](https://doc.rust-lang.org/src/core/iter/sources/repeat.rs.html#126)1.26.0 · ### impl<A> FusedIterator for Repeat<A>where A: [Clone](../clone/trait.clone "trait std::clone::Clone"),
[source](https://doc.rust-lang.org/src/core/iter/sources/repeat.rs.html#129)### impl<A> TrustedLen for Repeat<A>where A: [Clone](../clone/trait.clone "trait std::clone::Clone"),
Auto Trait Implementations
--------------------------
### impl<A> RefUnwindSafe for Repeat<A>where A: [RefUnwindSafe](../panic/trait.refunwindsafe "trait std::panic::RefUnwindSafe"),
### impl<A> Send for Repeat<A>where A: [Send](../marker/trait.send "trait std::marker::Send"),
### impl<A> Sync for Repeat<A>where A: [Sync](../marker/trait.sync "trait std::marker::Sync"),
### impl<A> Unpin for Repeat<A>where A: [Unpin](../marker/trait.unpin "trait std::marker::Unpin"),
### impl<A> UnwindSafe for Repeat<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](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](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::iter::RepeatWith Struct std::iter::RepeatWith
============================
```
pub struct RepeatWith<F> { /* private fields */ }
```
An iterator that repeats elements of type `A` endlessly by applying the provided closure `F: FnMut() -> A`.
This `struct` is created by the [`repeat_with()`](fn.repeat_with "repeat_with()") function. See its documentation for more.
Trait Implementations
---------------------
[source](https://doc.rust-lang.org/src/core/iter/sources/repeat_with.rs.html#73)### impl<F> Clone for RepeatWith<F>where F: [Clone](../clone/trait.clone "trait std::clone::Clone"),
[source](https://doc.rust-lang.org/src/core/iter/sources/repeat_with.rs.html#73)#### fn clone(&self) -> RepeatWith<F>
Notable traits for [RepeatWith](struct.repeatwith "struct std::iter::RepeatWith")<F>
```
impl<A, F> Iterator for RepeatWith<F>where
F: FnMut() -> 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)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/iter/sources/repeat_with.rs.html#73)### impl<F> Debug for RepeatWith<F>where F: [Debug](../fmt/trait.debug "trait std::fmt::Debug"),
[source](https://doc.rust-lang.org/src/core/iter/sources/repeat_with.rs.html#73)#### 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/iter/sources/repeat_with.rs.html#80)### impl<A, F> Iterator for RepeatWith<F>where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")() -> A,
#### type Item = A
The type of the elements being iterated over.
[source](https://doc.rust-lang.org/src/core/iter/sources/repeat_with.rs.html#84)#### fn next(&mut self) -> Option<A>
Advances the iterator and returns the next value. [Read more](trait.iterator#tymethod.next)
[source](https://doc.rust-lang.org/src/core/iter/sources/repeat_with.rs.html#89)#### fn size\_hint(&self) -> (usize, Option<usize>)
Returns the bounds on the remaining length of the iterator. [Read more](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](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](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](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](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](trait.iterator#method.nth)
[source](https://doc.rust-lang.org/src/core/iter/traits/iterator.rs.html#428-430)#### fn step\_by(self, step: usize) -> StepBy<Self>
Notable traits for [StepBy](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](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](trait.intoiterator "trait std::iter::IntoIterator")<Item = Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>,
Notable traits for [Chain](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](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](trait.intoiterator "trait std::iter::IntoIterator"),
Notable traits for [Zip](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](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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"),
Notable traits for [IntersperseWith](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](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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> B,
Notable traits for [Map](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](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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")),
Calls a closure on each element of an iterator. [Read more](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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool),
Notable traits for [Filter](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](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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Option](../option/enum.option "enum std::option::Option")<B>,
Notable traits for [FilterMap](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](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](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](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](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`](struct.peekable#method.peek) and [`peek_mut`](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](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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool),
Notable traits for [SkipWhile](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`](trait.iterator#method.skip)s elements based on a predicate. [Read more](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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool),
Notable traits for [TakeWhile](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](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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Option](../option/enum.option "enum std::option::Option")<B>,
Notable traits for [MapWhile](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](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](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](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](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](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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [Option](../option/enum.option "enum std::option::Option")<B>,
Notable traits for [Scan](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`](trait.iterator#method.fold) that holds internal state and produces a new iterator. [Read more](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](trait.intoiterator "trait std::iter::IntoIterator"), F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> U,
Notable traits for [FlatMap](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](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](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](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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")),
Notable traits for [Inspect](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](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](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](trait.fromiterator "trait std::iter::FromIterator")<Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>,
Transforms an iterator into a collection. [Read more](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](trait.extend "trait std::iter::Extend")<Self::[Item](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](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](trait.extend "trait std::iter::Extend")<Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>, F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(&Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool),
Consumes an iterator, creating two collections from it. [Read more](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](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](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](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](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](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](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](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](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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"),
Reduces the elements to a single one, by repeatedly applying a reducing operation. [Read more](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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> R, R: [Try](../ops/trait.try "trait std::ops::Try")<Output = Self::[Item](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](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](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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool),
Tests if every element of the iterator matches a predicate. [Read more](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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool),
Tests if any element of the iterator matches a predicate. [Read more](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](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](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](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](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](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](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](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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> [bool](../primitive.bool),
Searches for an element in an iterator, returning its index. [Read more](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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> B,
Returns the element that gives the maximum value from the specified function. [Read more](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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), &Self::[Item](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](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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")) -> B,
Returns the element that gives the minimum value from the specified function. [Read more](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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), &Self::[Item](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](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](trait.extend "trait std::iter::Extend")<A>, FromB: [Default](../default/trait.default "trait std::default::Default") + [Extend](trait.extend "trait std::iter::Extend")<B>, Self: [Iterator](trait.iterator "trait std::iter::Iterator")<Item = [(A, B)](../primitive.tuple)>,
Converts an iterator of pairs into a pair of containers. [Read more](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](trait.iterator "trait std::iter::Iterator")<Item = [&'a](../primitive.reference) T>,
Notable traits for [Copied](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](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](trait.iterator "trait std::iter::Iterator")<Item = [&'a](../primitive.reference) T>,
Notable traits for [Cloned](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](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](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](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](trait.sum "trait std::iter::Sum")<Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>,
Sums the elements of an iterator. [Read more](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](trait.product "trait std::iter::Product")<Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item")>,
Iterates over the entire iterator, multiplying all the elements [Read more](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](trait.intoiterator "trait std::iter::IntoIterator"), F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), <I as [IntoIterator](trait.intoiterator "trait std::iter::IntoIterator")>::[Item](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`](trait.iterator "Iterator") with those of another with respect to the specified comparison function. [Read more](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](trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<<I as [IntoIterator](trait.intoiterator "trait std::iter::IntoIterator")>::[Item](trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>,
[Lexicographically](../cmp/trait.ord#lexicographical-comparison) compares the elements of this [`Iterator`](trait.iterator "Iterator") with those of another. [Read more](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](trait.intoiterator "trait std::iter::IntoIterator"), F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), <I as [IntoIterator](trait.intoiterator "trait std::iter::IntoIterator")>::[Item](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`](trait.iterator "Iterator") with those of another with respect to the specified comparison function. [Read more](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](trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialEq](../cmp/trait.partialeq "trait std::cmp::PartialEq")<<I as [IntoIterator](trait.intoiterator "trait std::iter::IntoIterator")>::[Item](trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>,
Determines if the elements of this [`Iterator`](trait.iterator "Iterator") are equal to those of another. [Read more](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](trait.intoiterator "trait std::iter::IntoIterator"), F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")(Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), <I as [IntoIterator](trait.intoiterator "trait std::iter::IntoIterator")>::[Item](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`](trait.iterator "Iterator") are equal to those of another with respect to the specified equality function. [Read more](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](trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialEq](../cmp/trait.partialeq "trait std::cmp::PartialEq")<<I as [IntoIterator](trait.intoiterator "trait std::iter::IntoIterator")>::[Item](trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>,
Determines if the elements of this [`Iterator`](trait.iterator "Iterator") are unequal to those of another. [Read more](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](trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<<I as [IntoIterator](trait.intoiterator "trait std::iter::IntoIterator")>::[Item](trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>,
Determines if the elements of this [`Iterator`](trait.iterator "Iterator") are [lexicographically](../cmp/trait.ord#lexicographical-comparison) less than those of another. [Read more](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](trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<<I as [IntoIterator](trait.intoiterator "trait std::iter::IntoIterator")>::[Item](trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>,
Determines if the elements of this [`Iterator`](trait.iterator "Iterator") are [lexicographically](../cmp/trait.ord#lexicographical-comparison) less or equal to those of another. [Read more](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](trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<<I as [IntoIterator](trait.intoiterator "trait std::iter::IntoIterator")>::[Item](trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>,
Determines if the elements of this [`Iterator`](trait.iterator "Iterator") are [lexicographically](../cmp/trait.ord#lexicographical-comparison) greater than those of another. [Read more](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](trait.intoiterator "trait std::iter::IntoIterator"), Self::[Item](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"): [PartialOrd](../cmp/trait.partialord "trait std::cmp::PartialOrd")<<I as [IntoIterator](trait.intoiterator "trait std::iter::IntoIterator")>::[Item](trait.intoiterator#associatedtype.Item "type std::iter::IntoIterator::Item")>,
Determines if the elements of this [`Iterator`](trait.iterator "Iterator") are [lexicographically](../cmp/trait.ord#lexicographical-comparison) greater than or equal to those of another. [Read more](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](trait.iterator#associatedtype.Item "type std::iter::Iterator::Item"), &Self::[Item](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](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](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](trait.iterator#method.is_sorted_by_key)
[source](https://doc.rust-lang.org/src/core/iter/sources/repeat_with.rs.html#73)### impl<F> Copy for RepeatWith<F>where F: [Copy](../marker/trait.copy "trait std::marker::Copy"),
[source](https://doc.rust-lang.org/src/core/iter/sources/repeat_with.rs.html#95)### impl<A, F> FusedIterator for RepeatWith<F>where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")() -> A,
[source](https://doc.rust-lang.org/src/core/iter/sources/repeat_with.rs.html#98)### impl<A, F> TrustedLen for RepeatWith<F>where F: [FnMut](../ops/trait.fnmut "trait std::ops::FnMut")() -> A,
Auto Trait Implementations
--------------------------
### impl<F> RefUnwindSafe for RepeatWith<F>where F: [RefUnwindSafe](../panic/trait.refunwindsafe "trait std::panic::RefUnwindSafe"),
### impl<F> Send for RepeatWith<F>where F: [Send](../marker/trait.send "trait std::marker::Send"),
### impl<F> Sync for RepeatWith<F>where F: [Sync](../marker/trait.sync "trait std::marker::Sync"),
### impl<F> Unpin for RepeatWith<F>where F: [Unpin](../marker/trait.unpin "trait std::marker::Unpin"),
### impl<F> UnwindSafe for RepeatWith<F>where F: [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](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](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 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.