Struct BoundedBorrowedName

Source
pub struct BoundedBorrowedName<const N: usize>(/* private fields */);
Expand description

Like BoundedName, except it holds a string slice rather than an allocated string. For example, the Path API uses this to return path segments without making an allocation.

Implementations§

Source§

impl BoundedBorrowedName<MAX_NAME_LENGTH>

Source§

impl<const N: usize> BoundedBorrowedName<N>

Source

pub fn new<S: AsRef<str> + ?Sized>(s: &S) -> Result<&Self, ParseError>

Creates a BoundedBorrowedName from a &str slice, which obeys the same rules as BoundedName.

Source

pub fn as_str(&self) -> &str

Source

pub fn is_empty(&self) -> bool

Source

pub fn len(&self) -> usize

Trait Implementations§

Source§

impl<const N: usize> AsRef<BoundedBorrowedName<N>> for BoundedName<N>

Source§

fn as_ref(&self) -> &BoundedBorrowedName<N>

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl<const N: usize> AsRef<str> for BoundedBorrowedName<N>

Source§

fn as_ref(&self) -> &str

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl<const N: usize> Borrow<BoundedBorrowedName<N>> for BoundedName<N>

Source§

fn borrow(&self) -> &BoundedBorrowedName<N>

Immutably borrows from an owned value. Read more
Source§

impl<const N: usize> Borrow<str> for &BoundedBorrowedName<N>

Source§

fn borrow(&self) -> &str

Immutably borrows from an owned value. Read more
Source§

impl<const N: usize> Borrow<str> for BoundedBorrowedName<N>

Source§

fn borrow(&self) -> &str

Immutably borrows from an owned value. Read more
Source§

impl<const N: usize> Debug for BoundedBorrowedName<N>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<const N: usize> Display for BoundedBorrowedName<N>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'a> From<&'a BoundedBorrowedName<MAX_NAME_LENGTH>> for &'a BorrowedLongName

Source§

fn from(name: &'a BorrowedName) -> Self

Converts to this type from the input type.
Source§

impl<'a, const N: usize> From<&'a BoundedBorrowedName<N>> for &'a str

Source§

fn from(o: &'a BoundedBorrowedName<N>) -> Self

Converts to this type from the input type.
Source§

impl<const N: usize> From<&BoundedBorrowedName<N>> for BoundedName<N>

Source§

fn from(o: &BoundedBorrowedName<N>) -> Self

Converts to this type from the input type.
Source§

impl<const N: usize> Hash for BoundedBorrowedName<N>

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
Source§

impl<const N: usize> Ord for BoundedBorrowedName<N>

Source§

fn cmp(&self, other: &BoundedBorrowedName<N>) -> Ordering

This method returns an Ordering between self and other. Read more
Source§

impl<const N: usize> PartialEq<&str> for BoundedBorrowedName<N>

Source§

fn eq(&self, o: &&str) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<const N: usize> PartialEq<String> for BoundedBorrowedName<N>

Source§

fn eq(&self, o: &String) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<const N: usize> PartialEq for BoundedBorrowedName<N>

Source§

fn eq(&self, other: &BoundedBorrowedName<N>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<const N: usize> PartialOrd for BoundedBorrowedName<N>

Source§

fn partial_cmp(&self, other: &BoundedBorrowedName<N>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl<const N: usize> Serialize for BoundedBorrowedName<N>

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl<const N: usize> Eq for BoundedBorrowedName<N>

Source§

impl<const N: usize> StructuralPartialEq for BoundedBorrowedName<N>

Auto Trait Implementations§

§

impl<const N: usize> Freeze for BoundedBorrowedName<N>

§

impl<const N: usize> RefUnwindSafe for BoundedBorrowedName<N>

§

impl<const N: usize> Send for BoundedBorrowedName<N>

§

impl<const N: usize> !Sized for BoundedBorrowedName<N>

§

impl<const N: usize> Sync for BoundedBorrowedName<N>

§

impl<const N: usize> Unpin for BoundedBorrowedName<N>

§

impl<const N: usize> UnwindSafe for BoundedBorrowedName<N>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more