Trait dactyl::traits::SaturatingFrom [−][src]
Saturating From.
Convert an unsigned integer of a larger type into Self
, capping the
maximum value to Self::MAX
to prevent overflow or wrapping.
Required methods
fn saturating_from(src: T) -> Self
[src]
Implementations on Foreign Types
impl SaturatingFrom<u16> for u8
[src]
fn saturating_from(src: u16) -> Self
[src]
Saturating From u16
This method will safely downcast any u16
into a u8
, capping the value to u8::MAX
to prevent overflow or wrapping.
impl SaturatingFrom<u32> for u8
[src]
fn saturating_from(src: u32) -> Self
[src]
Saturating From u32
This method will safely downcast any u32
into a u8
, capping the value to u8::MAX
to prevent overflow or wrapping.
impl SaturatingFrom<u64> for u8
[src]
fn saturating_from(src: u64) -> Self
[src]
Saturating From u64
This method will safely downcast any u64
into a u8
, capping the value to u8::MAX
to prevent overflow or wrapping.
impl SaturatingFrom<u128> for u8
[src]
fn saturating_from(src: u128) -> Self
[src]
Saturating From u128
This method will safely downcast any u128
into a u8
, capping the value to u8::MAX
to prevent overflow or wrapping.
impl SaturatingFrom<usize> for u8
[src]
fn saturating_from(src: usize) -> Self
[src]
Saturating From usize
This method will safely downcast any usize
into a u8
, capping the value to u8::MAX
to prevent overflow or wrapping.
impl SaturatingFrom<u32> for u16
[src]
fn saturating_from(src: u32) -> Self
[src]
Saturating From u32
This method will safely downcast any u32
into a u16
, capping the value to u16::MAX
to prevent overflow or wrapping.
impl SaturatingFrom<u64> for u16
[src]
fn saturating_from(src: u64) -> Self
[src]
Saturating From u64
This method will safely downcast any u64
into a u16
, capping the value to u16::MAX
to prevent overflow or wrapping.
impl SaturatingFrom<u128> for u16
[src]
fn saturating_from(src: u128) -> Self
[src]
Saturating From u128
This method will safely downcast any u128
into a u16
, capping the value to u16::MAX
to prevent overflow or wrapping.
impl SaturatingFrom<usize> for u16
[src]
fn saturating_from(src: usize) -> Self
[src]
Saturating From usize
This method will safely downcast any usize
into a u16
, capping the value to u16::MAX
to prevent overflow or wrapping.
impl SaturatingFrom<u64> for u32
[src]
fn saturating_from(src: u64) -> Self
[src]
Saturating From u64
This method will safely downcast any u64
into a u32
, capping the value to u32::MAX
to prevent overflow or wrapping.
impl SaturatingFrom<u128> for u32
[src]
fn saturating_from(src: u128) -> Self
[src]
Saturating From u128
This method will safely downcast any u128
into a u32
, capping the value to u32::MAX
to prevent overflow or wrapping.
impl SaturatingFrom<u128> for u64
[src]
fn saturating_from(src: u128) -> Self
[src]
Saturating From u128
This method will safely downcast any u128
into a u64
, capping the value to u64::MAX
to prevent overflow or wrapping.