SimdScanner

Struct SimdScanner 

Source
pub struct SimdScanner;
Expand description

SIMD-accelerated scanning utilities.

Implementations§

Source§

impl SimdScanner

Source

pub fn find_byte(text: &[u8], needle: u8) -> Option<usize>

Finds the first occurrence of needle in text.

Source

pub fn skip_byte(text: &[u8], byte: u8) -> usize

Skips bytes while they match byte. Returns number of skipped bytes.

Source

pub fn skip_two_bytes(text: &[u8], b1: u8, b2: u8) -> usize

Skips bytes while they match either of two bytes.

Source

pub fn skip_ascii_whitespace(text: &[u8]) -> usize

Skips common ASCII whitespace (’ ’, ‘\t’, ‘\n’, ‘\r’).

Source

pub fn skip_ascii_digits(text: &[u8]) -> usize

Skips ASCII digits (‘0’-‘9’).

Source

pub fn skip_ascii_ident_continue(text: &[u8]) -> usize

Skips ASCII identifier characters (a-z, A-Z, 0-9, _).

Source

pub fn skip_ascii_hexdigits(text: &[u8]) -> usize

Skips ASCII hex digits (0-9, a-f, A-F).

Source

pub fn find_first_of_4(text: &[u8], a: u8, b: u8, c: u8, d: u8) -> Option<usize>

Finds the first occurrence of any of the 4 bytes.

Source

pub fn skip_until(text: &[u8], target: u8) -> usize

Skips until the specified byte is found.

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.