pub struct SlugOpts {
pub separator: char,
pub case: CaseMode,
pub split_camel: bool,
}Expand description
Options controlling how a string is slugified.
Fields§
§separator: charOutput separator character (e.g. - or _).
case: CaseModeHow to handle character case.
split_camel: boolWhether to inject a separator at CamelCase / PascalCase boundaries
before slugifying (e.g. WhatsApp -> Whats_App).
Default: false. When false, WhatsApp is preserved as-is.
When true, the boundary [a-z][A-Z]+ gets a separator inserted
between the lowercase letter and the run of uppercase letters that
follows.
slug-preserve itself does not split CamelCase; it just carries
the option so consumers (like fren) can act on it before calling
slugify.
Trait Implementations§
impl Copy for SlugOpts
Auto Trait Implementations§
impl Freeze for SlugOpts
impl RefUnwindSafe for SlugOpts
impl Send for SlugOpts
impl Sync for SlugOpts
impl Unpin for SlugOpts
impl UnsafeUnpin for SlugOpts
impl UnwindSafe for SlugOpts
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