pub struct SlugRef(/* private fields */);
Expand description
A borrwed slug, checked for syntax
The syntax check can be relied on for safety/soundness.
Implementations§
Source§impl SlugRef
impl SlugRef
Sourcepub fn new(s: &str) -> Result<&SlugRef, BadSlug>
pub fn new(s: &str) -> Result<&SlugRef, BadSlug>
Make a SlugRef out of a str
, if it has the correct syntax
Sourcepub unsafe fn new_unchecked<'s>(s: &'s str) -> &'s SlugRef
pub unsafe fn new_unchecked<'s>(s: &'s str) -> &'s SlugRef
Make a SlugRef out of a str
, without checking the syntax
§Safety
It’s the caller’s responsibility to check the syntax of the input string.
Trait Implementations§
Source§impl<'i> AsRef<&'i SlugRef> for InstancePurgeInfo<'i>
Available on crate feature state-dir
only.
impl<'i> AsRef<&'i SlugRef> for InstancePurgeInfo<'i>
Available on crate feature
state-dir
only.