InlineFlexStr

Struct InlineFlexStr 

Source
pub struct InlineFlexStr<S: ?Sized + StringToFromBytes> { /* private fields */ }
Expand description

Inline bytes type - used to store small strings inline

Implementations§

Source§

impl InlineFlexStr<CStr>

Source

pub fn try_from_bytes_with_or_without_nul( bytes: &[u8], ) -> Result<Self, TooLongOrNulError>

Available on crate feature cstr only.

Attempt to create an inlined string from borrowed bytes with or without a trailing NUL byte.

Source

pub fn as_bytes_with_nul(&self) -> &[u8]

Available on crate feature cstr only.

Borrow the CStr as bytes with a trailing NUL byte

Source§

impl<S: ?Sized + StringToFromBytes> InlineFlexStr<S>

Source

pub fn try_from_type(s: &S) -> Result<Self, TooLongForInlining>

Attempt to create an inlined string from a borrowed string. Returns None if the string is too long.

Source

pub fn as_raw_bytes(&self) -> &[u8]

Available on non-crate feature safe only.

Borrow the inline bytes as a raw byte slice (NOTE: includes trailing NUL for CStr)

Source

pub fn as_ref_type(&self) -> &S

Borrow a string reference as &S

Source

pub fn as_bytes(&self) -> &[u8]

Borrow the inline bytes as bytes

Source

pub fn into_owned_type(self) -> S::Owned
where S::Owned: From<Box<S>>,

Consume a string and convert it to an owned string.

Source

pub fn to_owned_type(&self) -> S::Owned

Convert a string reference to an owned string.

Source§

impl<S: ?Sized + StringFromBytesMut> InlineFlexStr<S>

Source

pub fn as_mut_type(&mut self) -> &mut S

Borrow the inline string as a mutable string reference

Trait Implementations§

Source§

impl<S: ?Sized + StringFromBytesMut> AsMut<S> for InlineFlexStr<S>

Source§

fn as_mut(&mut self) -> &mut S

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

impl<S> AsRef<[u8]> for InlineFlexStr<S>
where S: AsRef<[u8]> + ?Sized + StringToFromBytes,

Available on crate feature bytes only.
Source§

fn as_ref(&self) -> &[u8]

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

impl<S> AsRef<CStr> for InlineFlexStr<S>

Available on crate feature cstr only.
Source§

fn as_ref(&self) -> &CStr

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

impl<S> AsRef<OsStr> for InlineFlexStr<S>

Available on crate features std and osstr only.
Source§

fn as_ref(&self) -> &OsStr

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

impl<S> AsRef<Path> for InlineFlexStr<S>

Available on crate features std and path only.
Source§

fn as_ref(&self) -> &Path

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

impl<S> AsRef<str> for InlineFlexStr<S>

Available on crate feature str only.
Source§

fn as_ref(&self) -> &str

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

impl<S: ?Sized + StringToFromBytes> Borrow<S> for InlineFlexStr<S>

Source§

fn borrow(&self) -> &S

Immutably borrows from an owned value. Read more
Source§

impl<S: ?Sized + StringFromBytesMut> BorrowMut<S> for InlineFlexStr<S>

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<S: ?Sized + StringToFromBytes> Clone for InlineFlexStr<S>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<S: Debug + ?Sized + StringToFromBytes> Debug for InlineFlexStr<S>

Source§

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

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

impl<S: ?Sized + StringToFromBytes> Default for InlineFlexStr<S>
where for<'a> &'a S: Default,

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<S: ?Sized + StringToFromBytes> Deref for InlineFlexStr<S>

Source§

type Target = S

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl<S: ?Sized + StringFromBytesMut> DerefMut for InlineFlexStr<S>

Source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
Source§

impl<'de, S: ?Sized + StringToFromBytes> Deserialize<'de> for InlineFlexStr<S>
where Box<S>: Deserialize<'de>,

Available on crate feature serde only.
Source§

fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>

Deserialize this value from the given Serde deserializer. Read more
Source§

impl<S> Display for InlineFlexStr<S>

Source§

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

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

impl FromStr for InlineFlexStr<[u8]>

Available on crate feature bytes only.
Source§

type Err = TooLongForInlining

The associated error which can be returned from parsing.
Source§

fn from_str(s: &str) -> Result<Self, Self::Err>

Parses a string s to return a value of this type. Read more
Source§

impl FromStr for InlineFlexStr<CStr>

Available on crate feature cstr only.
Source§

type Err = TooLongOrNulError

The associated error which can be returned from parsing.
Source§

fn from_str(s: &str) -> Result<Self, Self::Err>

Parses a string s to return a value of this type. Read more
Source§

impl FromStr for InlineFlexStr<OsStr>

Available on crate features std and osstr only.
Source§

type Err = TooLongForInlining

The associated error which can be returned from parsing.
Source§

fn from_str(s: &str) -> Result<Self, Self::Err>

Parses a string s to return a value of this type. Read more
Source§

impl FromStr for InlineFlexStr<Path>

Available on crate features std and path only.
Source§

type Err = TooLongForInlining

The associated error which can be returned from parsing.
Source§

fn from_str(s: &str) -> Result<Self, Self::Err>

Parses a string s to return a value of this type. Read more
Source§

impl FromStr for InlineFlexStr<str>

Available on crate feature str only.
Source§

type Err = TooLongForInlining

The associated error which can be returned from parsing.
Source§

fn from_str(s: &str) -> Result<Self, Self::Err>

Parses a string s to return a value of this type. Read more
Source§

impl<S> Hash for InlineFlexStr<S>

Source§

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

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

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl<S, I: SliceIndex<S>> Index<I> for InlineFlexStr<S>
where S: Index<I> + ?Sized + StringToFromBytes,

Source§

type Output = <S as Index<I>>::Output

The returned type after indexing.
Source§

fn index(&self, index: I) -> &Self::Output

Performs the indexing (container[index]) operation. Read more
Source§

impl<S, I: SliceIndex<S>> IndexMut<I> for InlineFlexStr<S>

Source§

fn index_mut(&mut self, index: I) -> &mut Self::Output

Performs the mutable indexing (container[index]) operation. Read more
Source§

impl<S> Ord for InlineFlexStr<S>
where S: Ord + ?Sized + StringToFromBytes,

Source§

fn cmp(&self, other: &Self) -> Ordering

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

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl<S> PartialEq<&[u8]> for InlineFlexStr<S>

Available on crate feature bytes only.
Source§

fn eq(&self, other: &&[u8]) -> 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<S> PartialEq<&CStr> for InlineFlexStr<S>

Available on crate feature cstr only.
Source§

fn eq(&self, other: &&CStr) -> 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<S> PartialEq<&OsStr> for InlineFlexStr<S>

Available on crate features std and osstr only.
Source§

fn eq(&self, other: &&OsStr) -> 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<S> PartialEq<&Path> for InlineFlexStr<S>

Available on crate features std and path only.
Source§

fn eq(&self, other: &&Path) -> 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<S> PartialEq<&str> for InlineFlexStr<S>

Available on crate feature str only.
Source§

fn eq(&self, other: &&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<S> PartialEq<[u8]> for InlineFlexStr<S>

Available on crate feature bytes only.
Source§

fn eq(&self, other: &[u8]) -> 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<S> PartialEq<CStr> for InlineFlexStr<S>

Available on crate feature cstr only.
Source§

fn eq(&self, other: &CStr) -> 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<S> PartialEq<CString> for InlineFlexStr<S>

Available on crate feature cstr only.
Source§

fn eq(&self, other: &CString) -> 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<S> PartialEq<Cow<'_, [u8]>> for InlineFlexStr<S>

Available on crate feature bytes only.
Source§

fn eq(&self, other: &Cow<'_, [u8]>) -> 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<S> PartialEq<Cow<'_, CStr>> for InlineFlexStr<S>

Available on crate feature cstr only.
Source§

fn eq(&self, other: &Cow<'_, CStr>) -> 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<S> PartialEq<Cow<'_, OsStr>> for InlineFlexStr<S>

Available on crate features std and osstr only.
Source§

fn eq(&self, other: &Cow<'_, OsStr>) -> 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<S> PartialEq<Cow<'_, Path>> for InlineFlexStr<S>

Available on crate features std and path only.
Source§

fn eq(&self, other: &Cow<'_, Path>) -> 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<S> PartialEq<Cow<'_, str>> for InlineFlexStr<S>

Available on crate feature str only.
Source§

fn eq(&self, other: &Cow<'_, 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<S> PartialEq<InlineFlexStr<S>> for &[u8]

Available on crate feature bytes only.
Source§

fn eq(&self, other: &InlineFlexStr<S>) -> 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<S> PartialEq<InlineFlexStr<S>> for &CStr

Available on crate feature cstr only.
Source§

fn eq(&self, other: &InlineFlexStr<S>) -> 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<S> PartialEq<InlineFlexStr<S>> for &OsStr

Available on crate features std and osstr only.
Source§

fn eq(&self, other: &InlineFlexStr<S>) -> 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<S> PartialEq<InlineFlexStr<S>> for &Path

Available on crate features std and path only.
Source§

fn eq(&self, other: &InlineFlexStr<S>) -> 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<S> PartialEq<InlineFlexStr<S>> for &str

Available on crate feature str only.
Source§

fn eq(&self, other: &InlineFlexStr<S>) -> 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<S> PartialEq<InlineFlexStr<S>> for [u8]

Available on crate feature bytes only.
Source§

fn eq(&self, other: &InlineFlexStr<S>) -> 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<S> PartialEq<InlineFlexStr<S>> for CStr

Available on crate feature cstr only.
Source§

fn eq(&self, other: &InlineFlexStr<S>) -> 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<S> PartialEq<InlineFlexStr<S>> for CString

Available on crate feature cstr only.
Source§

fn eq(&self, other: &InlineFlexStr<S>) -> 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<S> PartialEq<InlineFlexStr<S>> for Cow<'_, [u8]>

Available on crate feature bytes only.
Source§

fn eq(&self, other: &InlineFlexStr<S>) -> 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<S> PartialEq<InlineFlexStr<S>> for Cow<'_, CStr>

Available on crate feature cstr only.
Source§

fn eq(&self, other: &InlineFlexStr<S>) -> 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<S> PartialEq<InlineFlexStr<S>> for Cow<'_, OsStr>

Available on crate features std and osstr only.
Source§

fn eq(&self, other: &InlineFlexStr<S>) -> 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<S> PartialEq<InlineFlexStr<S>> for Cow<'_, Path>

Available on crate features std and path only.
Source§

fn eq(&self, other: &InlineFlexStr<S>) -> 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<S> PartialEq<InlineFlexStr<S>> for Cow<'_, str>

Available on crate feature str only.
Source§

fn eq(&self, other: &InlineFlexStr<S>) -> 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<S> PartialEq<InlineFlexStr<S>> for OsStr

Available on crate features std and osstr only.
Source§

fn eq(&self, other: &InlineFlexStr<S>) -> 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<S> PartialEq<InlineFlexStr<S>> for OsString

Available on crate features std and osstr only.
Source§

fn eq(&self, other: &InlineFlexStr<S>) -> 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<S> PartialEq<InlineFlexStr<S>> for Path

Available on crate features std and path only.
Source§

fn eq(&self, other: &InlineFlexStr<S>) -> 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<S> PartialEq<InlineFlexStr<S>> for PathBuf

Available on crate features std and path only.
Source§

fn eq(&self, other: &InlineFlexStr<S>) -> 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<S> PartialEq<InlineFlexStr<S>> for String

Available on crate feature str only.
Source§

fn eq(&self, other: &InlineFlexStr<S>) -> 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<S> PartialEq<InlineFlexStr<S>> for Vec<u8>

Available on crate feature bytes only.
Source§

fn eq(&self, other: &InlineFlexStr<S>) -> 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<S> PartialEq<InlineFlexStr<S>> for str

Available on crate feature str only.
Source§

fn eq(&self, other: &InlineFlexStr<S>) -> 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<S> PartialEq<OsStr> for InlineFlexStr<S>

Available on crate features std and osstr only.
Source§

fn eq(&self, other: &OsStr) -> 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<S> PartialEq<OsString> for InlineFlexStr<S>

Available on crate features std and osstr only.
Source§

fn eq(&self, other: &OsString) -> 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<S> PartialEq<Path> for InlineFlexStr<S>

Available on crate features std and path only.
Source§

fn eq(&self, other: &Path) -> 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<S> PartialEq<PathBuf> for InlineFlexStr<S>

Available on crate features std and path only.
Source§

fn eq(&self, other: &PathBuf) -> 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<S> PartialEq<String> for InlineFlexStr<S>

Available on crate feature str only.
Source§

fn eq(&self, other: &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<S> PartialEq<Vec<u8>> for InlineFlexStr<S>

Available on crate feature bytes only.
Source§

fn eq(&self, other: &Vec<u8>) -> 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<S> PartialEq<str> for InlineFlexStr<S>

Available on crate feature str only.
Source§

fn eq(&self, other: &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<S> PartialEq for InlineFlexStr<S>

Source§

fn eq(&self, other: &Self) -> 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<S> PartialOrd for InlineFlexStr<S>

Source§

fn partial_cmp(&self, other: &Self) -> 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<S> Serialize for InlineFlexStr<S>

Available on crate feature serde only.
Source§

fn serialize<SER: Serializer>( &self, serializer: SER, ) -> Result<SER::Ok, SER::Error>

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

impl<S: ?Sized + StringToFromBytes + 'static> StringLike<S> for InlineFlexStr<S>

Source§

fn as_ref_type(&self) -> &S

Borrow a string reference as &S
Source§

fn as_bytes(&self) -> &[u8]

Borrow the string as bytes
Source§

fn into_owned_type(self) -> S::Owned
where S::Owned: From<Box<S>>,

Consume a string and convert it to an owned string. S::to_owned is called on Borrowed/Inlined/RefCounted variants. Boxed variants are converted directly into S::Owned (most likely without copy or allocation).
Source§

fn to_owned_type(&self) -> S::Owned

Convert a string reference to an owned string. S::to_owned is called on all variants.
Source§

fn is_empty(&self) -> bool

Returns true if this is an empty string
Source§

fn len(&self) -> usize

Returns the length of this string in bytes
Source§

fn as_str(&self) -> &str
where S: AsRef<str>,

Borrow the string as an &str
Source§

fn as_os_str(&self) -> &OsStr
where S: AsRef<OsStr>,

Available on crate features std and osstr only.
Borrow the string as an &OsStr
Source§

fn as_path(&self) -> &Path
where S: AsRef<Path>,

Available on crate features std and path only.
Borrow the string as a &Path
Source§

fn as_c_str(&self) -> &CStr
where S: AsRef<CStr>,

Available on crate feature cstr only.
Borrow the string as a &CStr
Source§

fn into_string(self) -> String
where <S as ToOwned>::Owned: Into<String> + From<Box<S>>,

Consume a string and convert it to a String
Source§

fn into_os_string(self) -> OsString
where <S as ToOwned>::Owned: Into<OsString> + From<Box<S>>,

Available on crate features std and osstr only.
Consume a string and convert it to an OsString
Source§

fn into_path_buf(self) -> PathBuf
where <S as ToOwned>::Owned: Into<PathBuf> + From<Box<S>>,

Available on crate features std and path only.
Consume a string and convert it to a PathBuf
Source§

fn into_c_string(self) -> CString
where <S as ToOwned>::Owned: Into<CString> + From<Box<S>>,

Available on crate feature cstr only.
Consume a string and convert it to a CString
Source§

fn into_vec_bytes(self) -> Vec<u8>
where <S as ToOwned>::Owned: Into<Vec<u8>> + From<Box<S>>,

Available on crate feature bytes only.
Consume a string and convert it to a Vec<u8>
Source§

fn to_string(&self) -> String
where <S as ToOwned>::Owned: Into<String>,

Convert a string reference to a String
Source§

fn to_os_string(&self) -> OsString
where <S as ToOwned>::Owned: Into<OsString>,

Available on crate features std and osstr only.
Convert a string reference to an OsString
Source§

fn to_path_buf(&self) -> PathBuf
where <S as ToOwned>::Owned: Into<PathBuf>,

Available on crate features std and path only.
Convert a string reference to a PathBuf
Source§

fn to_c_string(&self) -> CString
where <S as ToOwned>::Owned: Into<CString>,

Available on crate feature cstr only.
Convert a string reference to a CString
Source§

fn to_vec_bytes(&self) -> Vec<u8>
where <S as ToOwned>::Owned: Into<Vec<u8>>,

Available on crate feature bytes only.
Convert a string reference to a Vec<u8>
Source§

impl<S> ToSocketAddrs for InlineFlexStr<S>

Available on crate feature std only.
Source§

type Iter = <S as ToSocketAddrs>::Iter

Returned iterator over socket addresses which this type may correspond to.
Source§

fn to_socket_addrs(&self) -> Result<<S as ToSocketAddrs>::Iter>

Converts this object to an iterator of resolved SocketAddrs. Read more
Source§

impl<'s> TryFrom<&'s [u8]> for InlineFlexStr<[u8]>

Available on crate feature bytes only.
Source§

type Error = TooLongForInlining

The type returned in the event of a conversion error.
Source§

fn try_from(s: &'s [u8]) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<'s> TryFrom<&'s [u8]> for InlineFlexStr<CStr>

Available on crate feature cstr only.
Source§

type Error = TooLongOrNulError

The type returned in the event of a conversion error.
Source§

fn try_from(bytes: &'s [u8]) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<'s> TryFrom<&'s [u8]> for InlineFlexStr<str>

Available on crate feature str only.
Source§

type Error = TooLongOrUtf8Error

The type returned in the event of a conversion error.
Source§

fn try_from(s: &'s [u8]) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<'s> TryFrom<&'s CStr> for InlineFlexStr<CStr>

Available on crate feature cstr only.
Source§

type Error = TooLongForInlining

The type returned in the event of a conversion error.
Source§

fn try_from(s: &'s CStr) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<'s> TryFrom<&'s OsStr> for InlineFlexStr<OsStr>

Available on crate features std and osstr only.
Source§

type Error = TooLongForInlining

The type returned in the event of a conversion error.
Source§

fn try_from(s: &'s OsStr) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<'s> TryFrom<&'s OsStr> for InlineFlexStr<Path>

Available on crate features std and path only.
Source§

type Error = TooLongForInlining

The type returned in the event of a conversion error.
Source§

fn try_from(s: &'s OsStr) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<'s> TryFrom<&'s OsStr> for InlineFlexStr<str>

Available on crate features str and std only.
Source§

type Error = TooLongOrUtf8Error

The type returned in the event of a conversion error.
Source§

fn try_from(s: &'s OsStr) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<'s> TryFrom<&'s Path> for InlineFlexStr<OsStr>

Available on crate features std and osstr only.
Source§

type Error = TooLongForInlining

The type returned in the event of a conversion error.
Source§

fn try_from(p: &'s Path) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<'s> TryFrom<&'s Path> for InlineFlexStr<Path>

Available on crate features std and path only.
Source§

type Error = TooLongForInlining

The type returned in the event of a conversion error.
Source§

fn try_from(s: &'s Path) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<'s> TryFrom<&'s Path> for InlineFlexStr<str>

Available on crate features str and std only.
Source§

type Error = TooLongOrUtf8Error

The type returned in the event of a conversion error.
Source§

fn try_from(s: &'s Path) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<'s> TryFrom<&'s str> for InlineFlexStr<[u8]>

Available on crate feature bytes only.
Source§

type Error = TooLongForInlining

The type returned in the event of a conversion error.
Source§

fn try_from(s: &'s str) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<'s> TryFrom<&'s str> for InlineFlexStr<CStr>

Available on crate feature cstr only.
Source§

type Error = TooLongOrNulError

The type returned in the event of a conversion error.
Source§

fn try_from(s: &'s str) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<'s> TryFrom<&'s str> for InlineFlexStr<OsStr>

Available on crate features std and osstr only.
Source§

type Error = TooLongForInlining

The type returned in the event of a conversion error.
Source§

fn try_from(s: &'s str) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<'s> TryFrom<&'s str> for InlineFlexStr<Path>

Available on crate features std and path only.
Source§

type Error = TooLongForInlining

The type returned in the event of a conversion error.
Source§

fn try_from(s: &'s str) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<'s> TryFrom<&'s str> for InlineFlexStr<str>

Available on crate feature str only.
Source§

type Error = TooLongForInlining

The type returned in the event of a conversion error.
Source§

fn try_from(s: &'s str) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<S: ?Sized + StringToFromBytes> Copy for InlineFlexStr<S>

Source§

impl<S> Eq for InlineFlexStr<S>
where S: Eq + ?Sized + StringToFromBytes,

Auto Trait Implementations§

§

impl<S> Freeze for InlineFlexStr<S>
where S: ?Sized,

§

impl<S> RefUnwindSafe for InlineFlexStr<S>
where S: RefUnwindSafe + ?Sized,

§

impl<S> Send for InlineFlexStr<S>
where S: Send + ?Sized,

§

impl<S> Sync for InlineFlexStr<S>
where S: Sync + ?Sized,

§

impl<S> Unpin for InlineFlexStr<S>
where S: Unpin + ?Sized,

§

impl<S> UnwindSafe for InlineFlexStr<S>
where S: UnwindSafe + ?Sized,

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. 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
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,