PinyinMatchConfigBuilder

Struct PinyinMatchConfigBuilder 

Source
pub struct PinyinMatchConfigBuilder<'a, S: State = Empty> { /* private fields */ }
Available on crate feature pinyin only.
Expand description

Use builder syntax to set the inputs and finish with build().

Implementations§

Source§

impl<'a, S: State> PinyinMatchConfigBuilder<'a, S>

Source

pub fn build(self) -> PinyinMatchConfig<'a>
where S: IsComplete,

Finish building and return the requested object

Source

pub fn data( self, data: &'a PinyinData, ) -> PinyinMatchConfigBuilder<'a, SetData<S>>
where S::Data: IsUnset,

Optional (Some / Option setters). Default: Cow::Owned(PinyinData::new(notations)).

Default: new() on PinyinMatchConfigBuilder::build()

Must be inited with required notations if inmut-data feature is not enabled.

Source

pub fn maybe_data( self, value: Option<&'a PinyinData>, ) -> PinyinMatchConfigBuilder<'a, SetData<S>>
where S::Data: IsUnset,

Optional (Some / Option setters). Default: Cow::Owned(PinyinData::new(notations)).

Default: new() on PinyinMatchConfigBuilder::build()

Must be inited with required notations if inmut-data feature is not enabled.

Source

pub fn case_insensitive( self, value: bool, ) -> PinyinMatchConfigBuilder<'a, SetCaseInsensitive<S>>
where S::CaseInsensitive: IsUnset,

Optional (Some / Option setters). Default: false.

Whether upper case letters can match pinyins.

Source

pub fn maybe_case_insensitive( self, value: Option<bool>, ) -> PinyinMatchConfigBuilder<'a, SetCaseInsensitive<S>>
where S::CaseInsensitive: IsUnset,

Optional (Some / Option setters). Default: false.

Whether upper case letters can match pinyins.

Source

pub fn allow_partial_pattern( self, value: bool, ) -> PinyinMatchConfigBuilder<'a, SetAllowPartialPattern<S>>
where S::AllowPartialPattern: IsUnset,

Optional (Some / Option setters). Default: true.

Source

pub fn maybe_allow_partial_pattern( self, value: Option<bool>, ) -> PinyinMatchConfigBuilder<'a, SetAllowPartialPattern<S>>
where S::AllowPartialPattern: IsUnset,

Optional (Some / Option setters). Default: true.

Auto Trait Implementations§

§

impl<'a, S = Empty> !Freeze for PinyinMatchConfigBuilder<'a, S>

§

impl<'a, S> RefUnwindSafe for PinyinMatchConfigBuilder<'a, S>

§

impl<'a, S> Send for PinyinMatchConfigBuilder<'a, S>

§

impl<'a, S> Sync for PinyinMatchConfigBuilder<'a, S>

§

impl<'a, S> Unpin for PinyinMatchConfigBuilder<'a, S>

§

impl<'a, S> UnwindSafe for PinyinMatchConfigBuilder<'a, S>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.