Skip to main content

CleaningOptionsBuilder

Struct CleaningOptionsBuilder 

Source
pub struct CleaningOptionsBuilder { /* private fields */ }
Expand description

Builder for CleaningOptions.

Implementations§

Source§

impl CleaningOptionsBuilder

Source

pub fn remove_hidden(self, value: bool) -> Self

Set remove_hidden.

§Arguments
  • value: Whether to remove default-ignorable code points.
§Returns

Updated builder.

Source

pub fn remove_trailing_whitespace(self, value: bool) -> Self

Set remove_trailing_whitespace.

§Arguments
  • value: Whether trailing spaces/tabs are trimmed per line.
§Returns

Updated builder.

Source

pub fn normalize_spaces(self, value: bool) -> Self

Set normalize_spaces.

§Arguments
  • value: Whether Unicode spaces normalize to ASCII space.
§Returns

Updated builder.

Source

pub fn normalize_dashes(self, value: bool) -> Self

Set normalize_dashes.

§Arguments
  • value: Whether Unicode dash variants normalize to -.
§Returns

Updated builder.

Source

pub fn normalize_quotes(self, value: bool) -> Self

Set normalize_quotes.

§Arguments
  • value: Whether curly/Unicode quotes normalize to ASCII quotes.
§Returns

Updated builder.

Source

pub fn normalize_other(self, value: bool) -> Self

Set normalize_other.

§Arguments
  • value: Whether miscellaneous replacements (for example ellipsis) are applied.
§Returns

Updated builder.

Source

pub fn keyboard_only(self, value: bool) -> Self

Set keyboard_only.

§Arguments
  • value: Whether output is restricted to keyboard-safe characters.
§Returns

Updated builder.

Source

pub fn extended_keyboard(self, value: bool) -> Self

Set extended_keyboard.

§Arguments
  • value: Whether curated non-ASCII keyboard characters are allowed.
§Returns

Updated builder.

Source

pub fn emoji_policy(self, policy: EmojiPolicy) -> Self

Set emoji_policy.

§Arguments
  • policy: Emoji handling policy when keyboard_only is enabled.
§Returns

Updated builder.

Source

pub fn non_ascii_policy(self, policy: NonAsciiPolicy) -> Self

Set non_ascii_policy.

§Arguments
  • policy: Non-ASCII handling strategy in keyboard-only mode.
§Returns

Updated builder.

Source

pub fn preserve_joiners(self, value: bool) -> Self

Set preserve_joiners.

§Arguments
  • value: Whether ZWJ/ZWNJ are preserved when remove_hidden is enabled.
§Returns

Updated builder.

Source

pub fn remove_control_chars(self, value: bool) -> Self

Set remove_control_chars.

§Arguments
  • value: Whether control characters are removed.
§Returns

Updated builder.

Source

pub fn collapse_whitespace(self, value: bool) -> Self

Set collapse_whitespace.

§Arguments
  • value: Whether consecutive whitespace runs collapse to single spaces.
§Returns

Updated builder.

Source

pub fn normalize_line_endings(self, value: Option<LineEndingStyle>) -> Self

Set normalize_line_endings.

§Arguments
  • value: Optional target line-ending style.
§Returns

Updated builder.

Source

pub fn unicode_normalization(self, mode: UnicodeNormalizationMode) -> Self

Set unicode_normalization.

§Arguments
  • mode: Unicode normalization mode to apply before cleaning.
§Returns

Updated builder.

Source

pub fn strip_bidi_controls(self, value: bool) -> Self

Set strip_bidi_controls.

§Arguments
  • value: Whether bidirectional controls are removed.
§Returns

Updated builder.

Source

pub fn build(self) -> CleaningOptions

Build an immutable CleaningOptions value.

§Returns

Finalized options struct.

Trait Implementations§

Source§

impl Clone for CleaningOptionsBuilder

Source§

fn clone(&self) -> CleaningOptionsBuilder

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for CleaningOptionsBuilder

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.
Source§

impl<T> ErasedDestructor for T
where T: 'static,