Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Treatment saturatingToU16

std/conv::saturatingToU16


Generics

◻ T: SaturatingToU16

Inputs

⇥ value: Stream<T>

Outputs

↦ into: Stream<u16>


Turns stream into u16 one, saturating if needed.

This treatment manages saturating and infaillible conversion to u16. If incoming data represents something out of bounds for u16, then the resulting value is set to minimum or maximum, depending what is the closest to truth.