Skip to main content Skip to main content
Pigweed's logo Pigweed
code_xml
  1. Home
  2. Reference
  3. Rust
  4. pw_format
  5. UnsignedInt

UnsignedInt

Trait UnsignedInt 

Source
pub trait UnsignedInt: Copy + Into<u64> {
    // Required method
    fn truncate_u64(v: u64) -> u64;
}
Expand description

Trait implemented by target platform unsigned integer types (u8, u16, u32, u64).

Required Methods§

Source

fn truncate_u64(v: u64) -> u64

Truncates a 64-bit unsigned value to this type’s width following C integer conversion rules, and zero-extends the result back to u64.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl UnsignedInt for u8

Source§

impl UnsignedInt for u16

Source§

impl UnsignedInt for u32

Source§

impl UnsignedInt for u64

Implementors§