pub struct Slug(/* private fields */);
Expand description
An owned slug, checked for syntax
The syntax check can be relied on for safety/soundness.
Implementations§
Source§impl Slug
impl Slug
Sourcepub fn new(s: String) -> Result<Slug, BadSlug>
pub fn new(s: String) -> Result<Slug, BadSlug>
Make a Slug out of an owned String
, if it has the correct syntax
Sourcepub unsafe fn new_unchecked(s: String) -> Slug
pub unsafe fn new_unchecked(s: String) -> Slug
Make a Slug out of an owned String
, without checking the syntax
§Safety
It’s the caller’s responsibility to check the syntax of the input string.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Slug
impl<'de> Deserialize<'de> for Slug
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<HsNickname> for Slug
impl From<HsNickname> for Slug
Source§fn from(value: HsNickname) -> Self
fn from(value: HsNickname) -> Self
Converts to this type from the input type.
Source§impl From<Slug> for HsNickname
impl From<Slug> for HsNickname
Source§impl Ord for Slug
impl Ord for Slug
Source§impl PartialOrd for Slug
impl PartialOrd for Slug
Source§impl TryInto<Slug> for Iso8601TimeSlug
impl TryInto<Slug> for Iso8601TimeSlug
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 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> ToHex for T
impl<T> ToHex for T
Source§fn encode_hex<U>(&self) -> Uwhere
U: FromIterator<char>,
fn encode_hex<U>(&self) -> Uwhere
U: FromIterator<char>,
Encode the hex strict representing
self
into the result. Lower case
letters are used (e.g. f9b4ca
)Source§fn encode_hex_upper<U>(&self) -> Uwhere
U: FromIterator<char>,
fn encode_hex_upper<U>(&self) -> Uwhere
U: FromIterator<char>,
Encode the hex strict representing
self
into the result. Upper case
letters are used (e.g. F9B4CA
)