Struct ress::JSBuffer[][src]

pub struct JSBuffer<'a> {
    pub buffer: &'a [u8],
    pub idx: usize,
    pub len: usize,
}

Fields

buffer: &'a [u8]idx: usizelen: usize

Implementations

Re-implementation of the std::str::Chars logic

Check if the buffer is at or past the end of the bytes provided

Check if the next few bytes match the provided bytes

Check if the next byte matches a single byte provided

Skip the number of characters provided note: these are full unicode characters, not just bytes

Skip a single byte note: this can cause the buffer to become unaligned be sure to always know the character you are skipping is 1 byte wide or use skip instead when unsure

check if current char is a valid js whitespace character

Check of the look ahead character is a valid js new line character

check if the look ahead character is 0 or 1

check if the look ahead character is a number between 0 and 9, inclusive

check if the look ahead character is a number between 0 and 7, inclusive

check if the look ahead character is a number between 0 and 9 or a and f or A and F, inclusive

Peek forward 1 char with out updating the idx to this new position.

note: this will still cost the same amount of work as next_char but cleans up the book keeping for you

Skip backwards a number of bytes note: this can cause the buffer to become unaligned be sure to always know the character you are skipping is [count] bytes wide or use skip instead when unsure the right width is skipped

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Performs the conversion.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.