Skip to main content

Capturing

Struct Capturing 

Source
pub struct Capturing<I> { /* private fields */ }
Available on crate feature unstable only.

Implementations§

Source§

impl<I> Capturing<I>

Source

pub fn new(input: I) -> Self

Source

pub fn tokens(&self) -> &[TokenAndSpan]

Source

pub fn take(&mut self) -> Vec<TokenAndSpan>

Take captured tokens

Trait Implementations§

Source§

impl<I: Clone> Clone for Capturing<I>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<I: Debug> Debug for Capturing<I>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<I: Tokens> Tokens for Capturing<I>

Source§

type Checkpoint = CapturingCheckpoint<I>

Source§

fn checkpoint_save(&self) -> Self::Checkpoint

Source§

fn checkpoint_load(&mut self, checkpoint: Self::Checkpoint)

Source§

fn read_string(&self, span: Span) -> &str

Source§

fn set_ctx(&mut self, ctx: Context)

Source§

fn ctx(&self) -> Context

Source§

fn ctx_mut(&mut self) -> &mut Context

Source§

fn syntax(&self) -> SyntaxFlags

Source§

fn target(&self) -> EsVersion

Source§

fn set_expr_allowed(&mut self, allow: bool)

Source§

fn set_next_regexp(&mut self, start: Option<BytePos>)

Source§

fn add_error(&mut self, error: Error)

Implementors should use Rc<RefCell<Vec>>. Read more
Source§

fn add_module_mode_error(&mut self, error: Error)

Add an error which is valid syntax in script mode. Read more
Source§

fn end_pos(&self) -> BytePos

Source§

fn take_errors(&mut self) -> Vec<Error>

Source§

fn take_script_module_errors(&mut self) -> Vec<Error>

If the program was parsed as a script, this contains the module errors should the program be identified as a module in the future.
Source§

fn update_token_flags(&mut self, f: impl FnOnce(&mut TokenFlags))

Source§

fn token_flags(&self) -> TokenFlags

Source§

fn clone_token_value(&self) -> Option<TokenValue>

Source§

fn take_token_value(&mut self) -> Option<TokenValue>

Source§

fn get_token_value(&self) -> Option<&TokenValue>

Source§

fn first_token(&mut self) -> TokenAndSpan

Returns the first token in the file. Read more
Source§

fn next_token(&mut self) -> TokenAndSpan

Returns the next token from the input stream. Read more
Source§

fn set_token_value(&mut self, token_value: Option<TokenValue>)

Source§

fn scan_jsx_token(&mut self) -> TokenAndSpan

Source§

fn scan_jsx_open_el_terminal_token(&mut self) -> TokenAndSpan

Source§

fn rescan_jsx_open_el_terminal_token(&mut self, reset: BytePos) -> TokenAndSpan

Source§

fn rescan_jsx_token(&mut self, reset: BytePos) -> TokenAndSpan

Source§

fn scan_jsx_identifier(&mut self, start: BytePos) -> TokenAndSpan

Source§

fn scan_jsx_attribute_value(&mut self) -> TokenAndSpan

Source§

fn rescan_template_token( &mut self, start: BytePos, start_with_back_tick: bool, ) -> TokenAndSpan

Source§

fn start_pos(&self) -> BytePos

Auto Trait Implementations§

§

impl<I> Freeze for Capturing<I>
where I: Freeze,

§

impl<I> RefUnwindSafe for Capturing<I>
where I: RefUnwindSafe,

§

impl<I> Send for Capturing<I>
where I: Send,

§

impl<I> Sync for Capturing<I>
where I: Sync,

§

impl<I> Unpin for Capturing<I>
where I: Unpin,

§

impl<I> UnsafeUnpin for Capturing<I>
where I: UnsafeUnpin,

§

impl<I> UnwindSafe for Capturing<I>
where I: UnwindSafe,

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> MaybeSendSync for T

Source§

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

Source§

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