StopPredicate

Trait StopPredicate 

Source
pub trait StopPredicate: Copy {
    // Required method
    fn stop_at(&self, kw: KeywordRef<'_>) -> bool;
}
Available on crate feature parse2 only.
Expand description

Raw predicate, usually a closure, that can appear within StopAt.

Implemented for suitable closures, and also for booleans.

Required Methods§

Source

fn stop_at(&self, kw: KeywordRef<'_>) -> bool

Is this keyword a structural one meaning we should stop parsing here?

Precisely what the semantics are depends on the context. Typically, matched keywords will cause processing to continue in a subsequent document section, or in an outer (containing) document.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl StopPredicate for bool

Source§

fn stop_at(&self, _kw: KeywordRef<'_>) -> bool

Implementors§

Source§

impl<F: Copy + Fn(KeywordRef<'_>) -> bool> StopPredicate for F