pub struct LiteralPattern {
pub text: String,
pub limits: Option<FuzzyLimits>,
pub min_edits: Option<u8>,
pub edit_chars: Option<EditCharRestriction>,
}Expand description
A literal pattern extracted from the HIR for fuzzy matching.
Fields§
§text: StringThe literal text.
limits: Option<FuzzyLimits>Fuzzy limits for this pattern.
min_edits: Option<u8>Minimum edits required (for exclusive lower bounds like {0<e<5}).
edit_chars: Option<EditCharRestriction>Character class restriction for edits. If set, all edit characters must be from this class.
Implementations§
Source§impl LiteralPattern
impl LiteralPattern
Sourcepub fn new(
text: String,
limits: Option<FuzzyLimits>,
min_edits: Option<u8>,
) -> Self
pub fn new( text: String, limits: Option<FuzzyLimits>, min_edits: Option<u8>, ) -> Self
Create a new literal pattern.
Sourcepub fn with_edit_chars(
text: String,
limits: Option<FuzzyLimits>,
min_edits: Option<u8>,
edit_chars: Option<EditCharRestriction>,
) -> Self
pub fn with_edit_chars( text: String, limits: Option<FuzzyLimits>, min_edits: Option<u8>, edit_chars: Option<EditCharRestriction>, ) -> Self
Create a new literal pattern with character class restriction.
Trait Implementations§
Source§impl Clone for LiteralPattern
impl Clone for LiteralPattern
Source§fn clone(&self) -> LiteralPattern
fn clone(&self) -> LiteralPattern
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for LiteralPattern
impl RefUnwindSafe for LiteralPattern
impl Send for LiteralPattern
impl Sync for LiteralPattern
impl Unpin for LiteralPattern
impl UnsafeUnpin for LiteralPattern
impl UnwindSafe for LiteralPattern
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