Trait check_keyword::CheckKeyword [−][src]
pub trait CheckKeyword<T> {
fn is_keyword(&self) -> bool;
fn into_safe(self) -> T;
}
Expand description
The main trait.
The generic argument T
is the output type of into_safe
, and in the blanket implementation
is equal to Self
. I would have used an associated type,
but I ran into the good-old “upstream crates may add new impl of trait” error when implementing str.
Required methods
fn is_keyword(&self) -> bool
fn is_keyword(&self) -> bool
Checks if self
is a keyword.