Skip to main content

Extend

Trait Extend 

Source
pub trait Extend<FROM> {
    // Required methods
    fn extend(v: FROM) -> Self;
    fn narrow(self) -> FROM;
}
Expand description

Zero-extend a narrower FROM value into a wider Self, and narrow back.

Implemented for both vectors and masks. Most users should go through GenericVector::extend / GenericVector::narrow.

Required Methods§

Source

fn extend(v: FROM) -> Self

Widen v into Self, placing v’s lanes in the lower half and filling the upper half with zeros.

Source

fn narrow(self) -> FROM

Narrow back to FROM by keeping the lower lanes and discarding the upper lanes.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<R: Register, B: Register> Extend<Mask<R>> for Mask<B>
where B::Mask: ExtendRegister<R::Mask>,

Source§

impl<R: Register, B> Extend<Vector<R>> for Vector<B>
where B: ExtendRegister<R> + Register,