Struct tor_persist::slug::Slug
source · 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.
Methods from Deref<Target = SlugRef>§
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 Ord for Slug
impl Ord for Slug
source§impl PartialEq for Slug
impl PartialEq for Slug
source§impl PartialOrd for Slug
impl PartialOrd for Slug
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl 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
§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
)