pub struct CaseOptions {
pub ignore_case: bool,
pub ignore_word_separate: bool,
}Expand description
Case matching options for patterns.
§Examples
use ryo_analysis::pattern::CaseOptions;
// Default: case-sensitive
let opts = CaseOptions::default();
assert!(!opts.ignore_case);
// Case-insensitive
let opts = CaseOptions::new().with_ignore_case();
assert!(opts.ignore_case);Fields§
§ignore_case: boolIgnore ASCII case (A-Z == a-z)
ignore_word_separate: boolIgnore word separators and casing style (snake_case == camelCase == PascalCase)
Implementations§
Source§impl CaseOptions
impl CaseOptions
Sourcepub fn with_ignore_case(self) -> Self
pub fn with_ignore_case(self) -> Self
Enable case-insensitive matching.
Sourcepub fn with_ignore_word_separate(self) -> Self
pub fn with_ignore_word_separate(self) -> Self
Enable word-separate-insensitive matching.
Sourcepub fn is_default(&self) -> bool
pub fn is_default(&self) -> bool
Check if any case option is enabled.
Trait Implementations§
Source§impl Clone for CaseOptions
impl Clone for CaseOptions
Source§fn clone(&self) -> CaseOptions
fn clone(&self) -> CaseOptions
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 CaseOptions
impl Debug for CaseOptions
Source§impl Default for CaseOptions
impl Default for CaseOptions
Source§fn default() -> CaseOptions
fn default() -> CaseOptions
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for CaseOptions
impl<'de> Deserialize<'de> for CaseOptions
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for CaseOptions
impl PartialEq for CaseOptions
Source§fn eq(&self, other: &CaseOptions) -> bool
fn eq(&self, other: &CaseOptions) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for CaseOptions
impl Serialize for CaseOptions
impl Copy for CaseOptions
impl Eq for CaseOptions
impl StructuralPartialEq for CaseOptions
Auto Trait Implementations§
impl Freeze for CaseOptions
impl RefUnwindSafe for CaseOptions
impl Send for CaseOptions
impl Sync for CaseOptions
impl Unpin for CaseOptions
impl UnsafeUnpin for CaseOptions
impl UnwindSafe for CaseOptions
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> 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