[][src]Struct artichoke_backend::state::parser::State

pub struct State { /* fields omitted */ }

Implementations

impl State[src]

pub fn new(mrb: &mut mrb_state) -> Option<Self>[src]

pub fn close(mut self: Self, mrb: &mut mrb_state)[src]

pub fn context_mut(&mut self) -> &mut mrbc_context[src]

pub fn reset(&mut self, mrb: &mut mrb_state)[src]

Reset line number to 1.

#[must_use]pub fn fetch_lineno(&self) -> usize[src]

Fetch the current line number from the parser state.

pub fn add_fetch_lineno(
    &mut self,
    val: usize
) -> Result<usize, IncrementLinenoError>
[src]

Increment line number and return the new value.

Errors

This function returns IncrementLinenoError if the increment results in an overflow of the internal parser line number counter.

pub fn push_context(&mut self, mrb: &mut mrb_state, context: Context)[src]

Push a Context onto the stack.

The supplied Context becomes the currently active context. This function modifies the parser state so subsequently evaled code will use the current active Context.

pub fn pop_context(&mut self, mrb: &mut mrb_state) -> Option<Context>[src]

Removes the last element from the context stack and returns it, or None if the stack is empty.

Calls to this function modify the parser state so subsequently evaled code will use the current active Context.

#[must_use]pub fn peek_context(&self) -> Option<&Context>[src]

Returns the last Context, or None if the context stack is empty.

Trait Implementations

impl Debug for State[src]

Auto Trait Implementations

impl RefUnwindSafe for State[src]

impl !Send for State[src]

impl !Sync for State[src]

impl Unpin for State[src]

impl UnwindSafe for State[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 
[src]