Struct rustemo::SliceBuilder

source ·
pub struct SliceBuilder<'i, I: ?Sized> { /* private fields */ }
Expand description

Returns a slice of the matched input. If no match is possible None is returned.

This is used by default for layout parsing where we don’t need to keep the structure of the parsed layout but we need just the content as a slice of the input.

Implementations§

source§

impl<'i, I> SliceBuilder<'i, I>
where I: Input + ?Sized,

source

pub fn new(input: &'i I) -> Self

Trait Implementations§

source§

impl<'i, I> Builder for SliceBuilder<'i, I>
where I: Input + ?Sized,

§

type Output = Option<&'i I>

A type produced by this builder. See get_result.
source§

fn get_result(&mut self) -> Self::Output

Returns the product of parsing. Usually the one and only element left on the result stack.
source§

impl<'i, I, C, S, P, TK> LRBuilder<'i, I, C, S, P, TK> for SliceBuilder<'i, I>
where I: Input + ?Sized, C: Context<'i, I, S, TK>, S: State,

source§

fn shift_action(&mut self, _context: &mut C, _token: Token<'i, I, TK>)

Called when LR shifting is taking place. Read more
source§

fn reduce_action(&mut self, context: &mut C, _prod: P, _prod_len: usize)

Called when LR reduce is taking place. Read more

Auto Trait Implementations§

§

impl<'i, I: ?Sized> RefUnwindSafe for SliceBuilder<'i, I>
where I: RefUnwindSafe,

§

impl<'i, I: ?Sized> Send for SliceBuilder<'i, I>
where I: Sync,

§

impl<'i, I: ?Sized> Sync for SliceBuilder<'i, I>
where I: Sync,

§

impl<'i, I: ?Sized> Unpin for SliceBuilder<'i, I>

§

impl<'i, I: ?Sized> UnwindSafe for SliceBuilder<'i, I>
where I: RefUnwindSafe,

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>,

§

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>,

§

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.