Skip to main content

SkipSpace

Trait SkipSpace 

Source
pub trait SkipSpace: 'static {
    // Required methods
    fn match_spaces(a: &str, b: &str) -> Result<(usize, usize), usize>;
    fn skip_space(a: &str) -> usize;
}
Expand description

Defines an interface for skipping whitespace.

Required Methods§

Source

fn match_spaces(a: &str, b: &str) -> Result<(usize, usize), usize>

Given two strings, does the leading whitespace match?

If so, how many leading bytes from each should be dropped?

If not, after many bytes into a do they disagree?

Source

fn skip_space(a: &str) -> usize

Return the number of bytes of leading whitespace in a that should be skipped.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§