Trait truncate_integer::TryTruncate [−][src]
pub trait TryTruncate<T> {
fn try_truncate(self) -> Option<T>;
}
Required methods
fn try_truncate(self) -> Option<T>
fn try_truncate(self) -> Option<T>
Try to truncate an integer to fit into a smaller type.
If the value fits into the target type, return Ok(value)
Otherwise, return None
.