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