pub struct CharClass {
pub negated: bool,
pub items: Vec<CharClassItem>,
}Expand description
Character class definition.
Fields§
§negated: boolWhether this is a negated class [^...].
items: Vec<CharClassItem>The ranges/characters in this class.
Implementations§
Source§impl CharClass
impl CharClass
Sourcepub fn new(negated: bool, items: Vec<CharClassItem>) -> Self
pub fn new(negated: bool, items: Vec<CharClassItem>) -> Self
Create a new character class.
Sourcepub fn any() -> Self
pub fn any() -> Self
Create a character class matching any character except newlines (default .).
Sourcepub fn any_with_newlines() -> Self
pub fn any_with_newlines() -> Self
Create a character class matching any character including newlines (dot_all .).
Sourcepub fn whitespace() -> Self
pub fn whitespace() -> Self
Create a whitespace class (\s).
Sourcepub fn matches_unicode(&self, ch: char) -> bool
pub fn matches_unicode(&self, ch: char) -> bool
Check if a character matches this class with Unicode support.
Trait Implementations§
impl StructuralPartialEq for CharClass
Auto Trait Implementations§
impl Freeze for CharClass
impl RefUnwindSafe for CharClass
impl Send for CharClass
impl Sync for CharClass
impl Unpin for CharClass
impl UnsafeUnpin for CharClass
impl UnwindSafe for CharClass
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more