Skip to main content

Sluggable

Trait Sluggable 

Source
pub trait Sluggable {
    // Required method
    fn sluggable_source(&self) -> &str;

    // Provided method
    fn slug(&self) -> String { ... }
}
Expand description

A reusable concern: derive a URL slug from a source string.

Required Methods§

Source

fn sluggable_source(&self) -> &str

The text a slug is derived from (e.g. a title).

Provided Methods§

Source

fn slug(&self) -> String

The slug: lowercased, whitespace collapsed to single dashes.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§