pub struct Slug(/* private fields */);Implementations§
Source§impl Slug
impl Slug
Sourcepub fn new(input: &str) -> Result<Slug, SlugError>
pub fn new(input: &str) -> Result<Slug, SlugError>
Creates a normalized slug from user-provided text.
§Errors
Returns SlugError::Empty when normalization produces an empty value or another
SlugError variant when the canonical representation is invalid.
pub fn into_inner(self) -> String
pub fn segments(&self) -> impl Iterator<Item = &str>
Trait Implementations§
Source§impl Ord for Slug
impl Ord for Slug
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialOrd for Slug
impl PartialOrd for Slug
impl Eq for Slug
impl StructuralPartialEq for Slug
Auto Trait Implementations§
impl Freeze for Slug
impl RefUnwindSafe for Slug
impl Send for Slug
impl Sync for Slug
impl Unpin for Slug
impl UnsafeUnpin for Slug
impl UnwindSafe for Slug
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