Skip to main content

LastBefore

Struct LastBefore 

Source
pub struct LastBefore<L, S> { /* private fields */ }

Implementations§

Source§

impl<L: TokenStreamPredicate, S: TokenStreamPredicate> LastBefore<L, S>

Source

pub fn new(look_for: L, stop_at: S) -> Self

Source

pub fn reset(&mut self)

Trait Implementations§

Source§

impl<L: TokenStreamPredicate, S: TokenStreamPredicate> TokenStreamPattern for LastBefore<L, S>

Source§

fn process_token( &mut self, p: &mut Parser, offset: i32, top_level: bool, ) -> bool

Called on each token; true stops.
Source§

fn result(&self) -> i32

The offset where the pattern matched, -1 if none.
Source§

fn is_top_level( &self, open_angle_brackets: i32, open_brackets: i32, open_braces: i32, open_parentheses: i32, ) -> bool

Source§

fn handle_unmatched_closing(&mut self, _token: SyntaxKind) -> bool

Called on unmatched ); true asks to stop (ignored by the caller upstream).

Auto Trait Implementations§

§

impl<L, S> Freeze for LastBefore<L, S>
where L: Freeze, S: Freeze,

§

impl<L, S> RefUnwindSafe for LastBefore<L, S>

§

impl<L, S> Send for LastBefore<L, S>
where L: Send, S: Send,

§

impl<L, S> Sync for LastBefore<L, S>
where L: Sync, S: Sync,

§

impl<L, S> Unpin for LastBefore<L, S>
where L: Unpin, S: Unpin,

§

impl<L, S> UnsafeUnpin for LastBefore<L, S>
where L: UnsafeUnpin, S: UnsafeUnpin,

§

impl<L, S> UnwindSafe for LastBefore<L, S>
where L: UnwindSafe, S: 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> 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 = !

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

fn try_from(value: U) -> Result<T, !>

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.