use crate::types::Input;
pub trait IntoInner {
type Inner;
fn into_inner(self) -> Self::Inner;
}
#[allow(missing_debug_implementations, missing_copy_implementations)]
pub struct Guard(());
pub trait Primitives: Input {
#[inline(always)]
fn peek(&mut self) -> Option<Self::Token> {
self._peek(Guard(()))
}
#[inline(always)]
fn pop(&mut self) -> Option<Self::Token> {
self._pop(Guard(()))
}
#[inline(always)]
fn consume(&mut self, n: usize) -> Option<Self::Buffer> {
self._consume(Guard(()), n)
}
#[inline(always)]
fn consume_while<F>(&mut self, f: F) -> Self::Buffer
where
F: FnMut(Self::Token) -> bool,
{
self._consume_while(Guard(()), f)
}
#[inline(always)]
fn consume_from(&mut self, m: Self::Marker) -> Self::Buffer {
self._consume_from(Guard(()), m)
}
#[inline(always)]
fn consume_remaining(&mut self) -> Self::Buffer {
self._consume_remaining(Guard(()))
}
#[inline(always)]
fn skip_while<F>(&mut self, f: F)
where
F: FnMut(Self::Token) -> bool,
{
self._skip_while(Guard(()), f)
}
#[inline(always)]
fn mark(&self) -> Self::Marker {
self._mark(Guard(()))
}
#[inline(always)]
fn restore(self, m: Self::Marker) -> Self {
self._restore(Guard(()), m)
}
}
impl<I: Input> Primitives for I {}