pub trait Nth<'a>: Sized {
const NTH_KINDSET: KindSet = _;
// Required methods
fn peek_odd<I>(p: &Parser<'a, I>, c: Cursor) -> bool
where I: Iterator<Item = Cursor> + Clone;
fn peek_even<I>(p: &Parser<'a, I>, c: Cursor) -> bool
where I: Iterator<Item = Cursor> + Clone;
fn build_odd(node: Ident) -> Self;
fn build_even(node: Ident) -> Self;
fn build_integer(node: Number) -> Self;
fn build_anb(a: i32, b: i32, cursors: [Cursor; 4]) -> Self;
// Provided methods
fn anb_matches(a: i32, b: i32, index: i32) -> bool { ... }
fn parse_nth<I>(p: &mut Parser<'a, I>) -> Result<Self>
where I: Iterator<Item = Cursor> + Clone { ... }
}Expand description
An <an+b> value, such as the 2n+1 of :nth-child(2n+1).
Provided Associated Constants§
Sourceconst NTH_KINDSET: KindSet = _
const NTH_KINDSET: KindSet = _
The set of Kinds that can start an <an+b> value.
Required Methods§
Sourcefn peek_odd<I>(p: &Parser<'a, I>, c: Cursor) -> bool
fn peek_odd<I>(p: &Parser<'a, I>, c: Cursor) -> bool
Returns true if the cursor is the odd keyword.
Sourcefn peek_even<I>(p: &Parser<'a, I>, c: Cursor) -> bool
fn peek_even<I>(p: &Parser<'a, I>, c: Cursor) -> bool
Returns true if the cursor is the even keyword.
fn build_odd(node: Ident) -> Self
fn build_even(node: Ident) -> Self
fn build_integer(node: Number) -> Self
fn build_anb(a: i32, b: i32, cursors: [Cursor; 4]) -> Self
Provided Methods§
Sourcefn anb_matches(a: i32, b: i32, index: i32) -> bool
fn anb_matches(a: i32, b: i32, index: i32) -> bool
Returns true if the 1-based index is one of the indices selected by an+b.
fn parse_nth<I>(p: &mut Parser<'a, I>) -> Result<Self>
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".