Skip to main content

SimdOps

Struct SimdOps 

Source
pub struct SimdOps {
    pub find_delimiters: unsafe fn(&[u8]) -> DelimiterResult,
    pub classify_bytes: unsafe fn(&[u8]) -> Vec<u8>,
    pub skip_whitespace: unsafe fn(&[u8]) -> usize,
    pub compute_byte_mask: unsafe fn(&[u8], u8) -> u64,
    pub compute_all_masks: unsafe fn(&[u8]) -> AllMasks,
    pub level: SimdLevel,
}
Expand description

Function-pointer table for the three core SIMD operations.

Each slot holds an unsafe fn because the SIMD variants require #[target_feature] and therefore cannot be called without unsafe. The scalar implementations are inherently safe but share the same signature for uniformity.

Fields§

§find_delimiters: unsafe fn(&[u8]) -> DelimiterResult

Scan for the first HTML delimiter (<, >, &, ", ', =, /).

§classify_bytes: unsafe fn(&[u8]) -> Vec<u8>

Classify every byte into a category bitmask (see crate::class).

§skip_whitespace: unsafe fn(&[u8]) -> usize

Return the offset of the first non-whitespace byte.

§compute_byte_mask: unsafe fn(&[u8], u8) -> u64

Produce a u64 bitmask where bit i is set if block[i] == byte. The block must be at most 64 bytes.

§compute_all_masks: unsafe fn(&[u8]) -> AllMasks

Compute all seven delimiter bitmasks in a single pass. Loads each 16-byte chunk once, producing all masks simultaneously.

§level: SimdLevel

The SIMD level backing these function pointers.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.