#[repr(transparent)]pub struct SlugRef(str);Expand description
A borrwed slug, checked for syntax
The syntax check can be relied on for safety/soundness.
Tuple Fields§
§0: strImplementations§
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>
impl<'i> AsRef<&'i SlugRef> for InstancePurgeInfo<'i>
impl Eq for SlugRef
Source§impl PartialOrd for SlugRef
impl PartialOrd for SlugRef
impl StructuralPartialEq for SlugRef
Auto Trait Implementations§
impl !Sized for SlugRef
impl Freeze for SlugRef
impl RefUnwindSafe for SlugRef
impl Send for SlugRef
impl Sync for SlugRef
impl Unpin for SlugRef
impl UnsafeUnpin for SlugRef
impl UnwindSafe for SlugRef
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