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::locale::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
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)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