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.Source§impl PartialOrd for SlugRef
impl PartialOrd for SlugRef
Source§impl ToOwned for SlugRef
impl ToOwned for SlugRef
impl Eq for SlugRef
impl StructuralPartialEq for SlugRef
Auto Trait Implementations§
impl Freeze for SlugRef
impl RefUnwindSafe for SlugRef
impl Send for SlugRef
impl !Sized for SlugRef
impl Sync for SlugRef
impl Unpin 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
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: (unsized)