pub struct PatternFilters { /* private fields */ }Expand description
A collection of position filters for a field
Implementations§
Source§impl PatternFilters
impl PatternFilters
Sourcepub fn new() -> PatternFilters
pub fn new() -> PatternFilters
Create empty pattern filters
Sourcepub fn add_filter(self, filter: PositionFilter) -> PatternFilters
pub fn add_filter(self, filter: PositionFilter) -> PatternFilters
Add a position filter
Sourcepub fn add_filters(self, filters: Vec<PositionFilter>) -> PatternFilters
pub fn add_filters(self, filters: Vec<PositionFilter>) -> PatternFilters
Add multiple filters
Sourcepub fn validate_char_at_position(
&self,
position: usize,
character: char,
) -> Result<(), String>
pub fn validate_char_at_position( &self, position: usize, character: char, ) -> Result<(), String>
Validate a character at a specific position against all applicable filters
Sourcepub fn validate_text(&self, text: &str) -> Result<(), String>
pub fn validate_text(&self, text: &str) -> Result<(), String>
Validate entire text against all filters
Sourcepub fn has_filters(&self) -> bool
pub fn has_filters(&self) -> bool
Check if any filters are configured
Sourcepub fn filters(&self) -> &[PositionFilter]
pub fn filters(&self) -> &[PositionFilter]
Get all configured filters
Trait Implementations§
Source§impl Clone for PatternFilters
impl Clone for PatternFilters
Source§fn clone(&self) -> PatternFilters
fn clone(&self) -> PatternFilters
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PatternFilters
impl Debug for PatternFilters
Source§impl Default for PatternFilters
impl Default for PatternFilters
Source§fn default() -> PatternFilters
fn default() -> PatternFilters
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for PatternFilters
impl !UnwindSafe for PatternFilters
impl Freeze for PatternFilters
impl Send for PatternFilters
impl Sync for PatternFilters
impl Unpin for PatternFilters
impl UnsafeUnpin for PatternFilters
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more