[−][src]Struct indent_stack::IndentStack
Stores the indentation state of an off-side parser. The default state is where
Fields
allow_inconsistent_indents: bool
Methods
impl IndentStack
[src]
pub fn default_inconsistent_indents() -> Self
[src]
pub fn accept(&mut self, input: &str) -> Result<isize, IndentError>
[src]
Mutates the state of the stack by applying an indent level. There is no restriction on the input characters, as long as they are identical.
The initial state is an empty indent. Passing a non-empty string the first time would immediately result in an indent.
Returns
- If an indentation error occurred,
None
is returned. Ok(1)
implies that an indent is detected.Ok(0)
implies that no indentation change is detected.Ok(x)
wherex < 0
implies that-x
levels of dedents are detected.
Trait Implementations
Auto Trait Implementations
impl Send for IndentStack
impl Sync for IndentStack
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,