#[non_exhaustive]pub struct TitleCase {
pub always_capitalize_after_punctuation: bool,
pub always_capitalize_last_word: bool,
pub always_capitalize_min_len: Option<usize>,
pub hyphen_word_separator: bool,
pub keep_all_uppercase_words: bool,
pub use_exception_dictionary: bool,
pub trim_start: bool,
pub trim_end: bool,
}
Expand description
Rules for the title case transformation.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.always_capitalize_after_punctuation: bool
Always capitalize after a full stop, question or exclamation mark, and colon even if the punctuation is followed by a word on the capitalization blacklist.
always_capitalize_last_word: bool
Always capitalize the last word of the title, even if it is on the capitalization blacklist.
always_capitalize_min_len: Option<usize>
Always capitalize a word matching or exceeding a certain length, even if it is on the capitalization blacklist.
hyphen_word_separator: bool
Treat the hyphen as a word separator, i. e. capitalize in hyphenated expressions.
keep_all_uppercase_words: bool
Do not touch all-uppercase words like “USA” if the title contains lower-case characters at all.
use_exception_dictionary: bool
Enable usage of the capitalization blacklist.
trim_start: bool
Discard whitespace at the start of the title.
trim_end: bool
Discard whitespace at the end of the title.
Implementations§
Trait Implementations§
source§impl PartialEq for TitleCase
impl PartialEq for TitleCase
impl Copy for TitleCase
impl Eq for TitleCase
impl StructuralPartialEq for TitleCase
Auto Trait Implementations§
impl RefUnwindSafe for TitleCase
impl Send for TitleCase
impl Sync for TitleCase
impl Unpin for TitleCase
impl UnwindSafe for TitleCase
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.