pub struct SimdScanner;Expand description
SIMD-accelerated scanning utilities.
Implementations§
Source§impl SimdScanner
impl SimdScanner
Sourcepub fn find_byte(text: &[u8], needle: u8) -> Option<usize>
pub fn find_byte(text: &[u8], needle: u8) -> Option<usize>
Finds the first occurrence of needle in text.
Sourcepub fn skip_byte(text: &[u8], byte: u8) -> usize
pub fn skip_byte(text: &[u8], byte: u8) -> usize
Skips bytes while they match byte. Returns number of skipped bytes.
Sourcepub fn skip_two_bytes(text: &[u8], b1: u8, b2: u8) -> usize
pub fn skip_two_bytes(text: &[u8], b1: u8, b2: u8) -> usize
Skips bytes while they match either of two bytes.
Sourcepub fn skip_ascii_whitespace(text: &[u8]) -> usize
pub fn skip_ascii_whitespace(text: &[u8]) -> usize
Skips common ASCII whitespace (’ ’, ‘\t’, ‘\n’, ‘\r’).
Sourcepub fn skip_ascii_digits(text: &[u8]) -> usize
pub fn skip_ascii_digits(text: &[u8]) -> usize
Skips ASCII digits (‘0’-‘9’).
Sourcepub fn skip_ascii_ident_continue(text: &[u8]) -> usize
pub fn skip_ascii_ident_continue(text: &[u8]) -> usize
Skips ASCII identifier characters (a-z, A-Z, 0-9, _).
Sourcepub fn skip_ascii_hexdigits(text: &[u8]) -> usize
pub fn skip_ascii_hexdigits(text: &[u8]) -> usize
Skips ASCII hex digits (0-9, a-f, A-F).
Sourcepub fn find_first_of_4(text: &[u8], a: u8, b: u8, c: u8, d: u8) -> Option<usize>
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.
Sourcepub fn skip_until(text: &[u8], target: u8) -> usize
pub fn skip_until(text: &[u8], target: u8) -> usize
Skips until the specified byte is found.
Auto Trait Implementations§
impl Freeze for SimdScanner
impl RefUnwindSafe for SimdScanner
impl Send for SimdScanner
impl Sync for SimdScanner
impl Unpin for SimdScanner
impl UnwindSafe for SimdScanner
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more