Enum icu_casemap::titlecase::TrailingCase
source · #[non_exhaustive]pub enum TrailingCase {
Unchanged,
Lower,
}
Expand description
How to handle the rest of the string once the beginning of the string has been titlecased.
§Examples
use icu::casemap::titlecase::{TitlecaseOptions, TrailingCase};
use icu::casemap::TitlecaseMapper;
use icu::locid::langid;
let cm = TitlecaseMapper::new();
let root = langid!("und");
let default_options = Default::default();
let mut preserve_case: TitlecaseOptions = Default::default();
preserve_case.trailing_case = TrailingCase::Unchanged;
// Exhibits trailing case when set:
assert_eq!(
cm.titlecase_segment_to_string("spOngeBoB", &root, default_options),
"Spongebob"
);
assert_eq!(
cm.titlecase_segment_to_string("spOngeBoB", &root, preserve_case),
"SpOngeBoB"
);
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Unchanged
Preserve the casing of the rest of the string (“spoNgEBoB” -> “SpoNgEBoB”)
Lower
Lowercase the rest of the string (“spoNgEBoB” -> “Spongebob”)
Trait Implementations§
source§impl Clone for TrailingCase
impl Clone for TrailingCase
source§fn clone(&self) -> TrailingCase
fn clone(&self) -> TrailingCase
Returns a copy 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 moresource§impl Debug for TrailingCase
impl Debug for TrailingCase
source§impl Default for TrailingCase
impl Default for TrailingCase
source§fn default() -> TrailingCase
fn default() -> TrailingCase
Returns the “default value” for a type. Read more
source§impl Hash for TrailingCase
impl Hash for TrailingCase
source§impl PartialEq for TrailingCase
impl PartialEq for TrailingCase
source§fn eq(&self, other: &TrailingCase) -> bool
fn eq(&self, other: &TrailingCase) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Copy for TrailingCase
impl Eq for TrailingCase
impl StructuralPartialEq for TrailingCase
Auto Trait Implementations§
impl Freeze for TrailingCase
impl RefUnwindSafe for TrailingCase
impl Send for TrailingCase
impl Sync for TrailingCase
impl Unpin for TrailingCase
impl UnwindSafe for TrailingCase
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