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 saturatingToI8

std/conv::saturatingToI8


Generics

◻ T: SaturatingToI8

Inputs

⇥ value: Stream<T>

Outputs

↦ into: Stream<i8>


Turns stream into i8 one, saturating if needed.

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