struct W32(u32)
| Position | Description |
|---|---|
| 1 |
| Name | Description |
|---|---|
| bits | Returns the bit-width of this type. |
| bytes | Returns the byte-width of this type. |
| max | Returns the maximum value of this type. |
| min | Returns the minimum value of this type. |
| Receiver | Name | Description |
|---|---|---|
self | checked_add | Adds another integer to this one and returns the value if no overflow occurred. |
self | checked_mul | Multiplies this integer by another one and returns the value if no overflow occurred. |
self | checked_next_power_of_two | Calculates the next power of two greater or equal the current value. |
self | checked_sub | Subtracts another integer from this one and returns the value if no overflow occurred. |
self | count_ones | Counts the set bits in this integer. |
self | count_zeros | Counts the unset bits in this integer. |
self | div_rem | Divides this integer by another one and returns both the quotient and the remainder. |
self | from_be | Interprets this integer as a value in big-endian representation and returns the value in host-endian representation. |
self | from_le | Interprets this integer as a value in little-endian representation and returns the value in host-endian representation. |
self | leading_ones | Returns the length of longest sequence of set bits starting at the most significant bit. |
self | leading_zeros | Returns the length of longest sequence of unset bits starting at the most significant bit. |
self | next_power_of_two | Calculates the next power of two greater or equal the current value. |
self | rotate_left | Rotates the value to the right. |
self | rotate_right | Rotates the value to the right. |
self | saturating_add | Adds another integer to this one without overflow, trimming the value to the range that can be represented in this type. |
self | saturating_sub | Subtracts another integer to this one without overflow, trimming the value to the range that can be represented in this type. |
self | swap | Swaps the bytes in this integer. |
self | to_be | Interprets this integer as a value in host-endian representation and returns the value in big-endian representation. |
self | to_le | Interprets this integer as a value in host-endian representation and returns the value in little-endian representation. |
self | trailing_ones | Returns the length of longest sequence of set bits starting at the least significant bit. |
self | trailing_zeros | Returns the length of longest sequence of unset bits starting at the least significant bit. |
| Name | Description |
|---|---|
| Add (2 times) | Objects that implement the binary |
| BitAnd (2 times) | Objects that implement the binary |
| BitOr (2 times) | Objects that implement the binary |
| Copy | Objects that can safely be copied via |
| Deref | Objects that implement the immutable dereference operator. |
| DerefMut | Objects that implement the mutable dereference operator. |
| Div (2 times) | Objects that implement the binary |
| Eq (2 times) | Objects that implement the binary |
| Hash | Objects that can be hashed. |
| Mul (2 times) | Objects that implement the binary |
| Ord | Objects that are part of a total order. |
| PartialOrd | Objects that implement the binary |
| Pod | Objects that are safe to use if they contain a random bit pattern. |
| Rem (2 times) | Objects that implement the binary |
| Shl (9 times) | Objects that implement the binary |
| Shr (9 times) | Objects that implement the binary |
| Sub (2 times) | Objects that implement the binary |