Trait faster::intrin::Downcast [] [src]

pub trait Downcast<T> {
    fn saturating_downcast(self, other: Self) -> T;
}

Required Methods

Return a vector containing elements of the same value as self and other, but different type. The first half of the returned vector contains the downcast values of self, whereas the second half of the returned vector contains the downcast values of other. The returned vector is equal in size to self and other. If an element exceeds the maximum or minimum value of the downcast type, it is saturated.

Examples

extern crate faster;
use faster::*;

assert_eq!(i32s(2).saturating_downcast(i32s(3)), i16s::halfs(2, 3));
assert_eq!(i16s(128).saturating_downcast(i16s(-129)), i8s::halfs(127, -128));

Implementors