pub struct InlineFlexStr<S: ?Sized + StringToFromBytes> { /* private fields */ }Expand description
Inline bytes type - used to store small strings inline
Implementations§
Source§impl InlineFlexStr<CStr>
impl InlineFlexStr<CStr>
Sourcepub fn try_from_bytes_with_or_without_nul(
bytes: &[u8],
) -> Result<Self, TooLongOrNulError>
Available on crate feature cstr only.
pub fn try_from_bytes_with_or_without_nul( bytes: &[u8], ) -> Result<Self, TooLongOrNulError>
cstr only.Attempt to create an inlined string from borrowed bytes with or without a trailing NUL byte.
Sourcepub fn as_bytes_with_nul(&self) -> &[u8] ⓘ
Available on crate feature cstr only.
pub fn as_bytes_with_nul(&self) -> &[u8] ⓘ
cstr only.Borrow the CStr as bytes with a trailing NUL byte
Source§impl<S: ?Sized + StringToFromBytes> InlineFlexStr<S>
impl<S: ?Sized + StringToFromBytes> InlineFlexStr<S>
Sourcepub fn try_from_type(s: &S) -> Result<Self, TooLongForInlining>
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.
Sourcepub fn as_raw_bytes(&self) -> &[u8] ⓘ
Available on non-crate feature safe only.
pub fn as_raw_bytes(&self) -> &[u8] ⓘ
safe only.Borrow the inline bytes as a raw byte slice (NOTE: includes trailing NUL for CStr)
Sourcepub fn as_ref_type(&self) -> &S
pub fn as_ref_type(&self) -> &S
Borrow a string reference as &S
Sourcepub fn into_owned_type(self) -> S::Owned
pub fn into_owned_type(self) -> S::Owned
Consume a string and convert it to an owned string.
Sourcepub fn to_owned_type(&self) -> S::Owned
pub fn to_owned_type(&self) -> S::Owned
Convert a string reference to an owned string.
Source§impl<S: ?Sized + StringFromBytesMut> InlineFlexStr<S>
impl<S: ?Sized + StringFromBytesMut> InlineFlexStr<S>
Sourcepub fn as_mut_type(&mut self) -> &mut S
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>
impl<S: ?Sized + StringFromBytesMut> AsMut<S> for InlineFlexStr<S>
Source§impl<S> AsRef<[u8]> for InlineFlexStr<S>
Available on crate feature bytes only.
impl<S> AsRef<[u8]> for InlineFlexStr<S>
Available on crate feature
bytes only.Source§impl<S> AsRef<CStr> for InlineFlexStr<S>
Available on crate feature cstr only.
impl<S> AsRef<CStr> for InlineFlexStr<S>
Available on crate feature
cstr only.Source§impl<S> AsRef<OsStr> for InlineFlexStr<S>
Available on crate features std and osstr only.
impl<S> AsRef<OsStr> for InlineFlexStr<S>
Available on crate features
std and osstr only.Source§impl<S> AsRef<Path> for InlineFlexStr<S>
Available on crate features std and path only.
impl<S> AsRef<Path> for InlineFlexStr<S>
Available on crate features
std and path only.Source§impl<S> AsRef<str> for InlineFlexStr<S>
Available on crate feature str only.
impl<S> AsRef<str> for InlineFlexStr<S>
Available on crate feature
str only.Source§impl<S: ?Sized + StringToFromBytes> Borrow<S> for InlineFlexStr<S>
impl<S: ?Sized + StringToFromBytes> Borrow<S> for InlineFlexStr<S>
Source§impl<S: ?Sized + StringFromBytesMut> BorrowMut<S> for InlineFlexStr<S>
impl<S: ?Sized + StringFromBytesMut> BorrowMut<S> for InlineFlexStr<S>
Source§fn borrow_mut(&mut self) -> &mut S
fn borrow_mut(&mut self) -> &mut S
Mutably borrows from an owned value. Read more
Source§impl<S: ?Sized + StringToFromBytes> Clone for InlineFlexStr<S>
impl<S: ?Sized + StringToFromBytes> Clone for InlineFlexStr<S>
Source§impl<S: Debug + ?Sized + StringToFromBytes> Debug for InlineFlexStr<S>
impl<S: Debug + ?Sized + StringToFromBytes> Debug for InlineFlexStr<S>
Source§impl<S: ?Sized + StringToFromBytes> Default for InlineFlexStr<S>
impl<S: ?Sized + StringToFromBytes> Default for InlineFlexStr<S>
Source§impl<S: ?Sized + StringToFromBytes> Deref for InlineFlexStr<S>
impl<S: ?Sized + StringToFromBytes> Deref for InlineFlexStr<S>
Source§impl<S: ?Sized + StringFromBytesMut> DerefMut for InlineFlexStr<S>
impl<S: ?Sized + StringFromBytesMut> DerefMut for InlineFlexStr<S>
Source§impl<'de, S: ?Sized + StringToFromBytes> Deserialize<'de> for InlineFlexStr<S>where
Box<S>: Deserialize<'de>,
Available on crate feature serde only.
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>
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>
impl<S> Display for InlineFlexStr<S>
Source§impl FromStr for InlineFlexStr<[u8]>
Available on crate feature bytes only.
impl FromStr for InlineFlexStr<[u8]>
Available on crate feature
bytes only.Source§impl FromStr for InlineFlexStr<CStr>
Available on crate feature cstr only.
impl FromStr for InlineFlexStr<CStr>
Available on crate feature
cstr only.Source§impl FromStr for InlineFlexStr<OsStr>
Available on crate features std and osstr only.
impl FromStr for InlineFlexStr<OsStr>
Available on crate features
std and osstr only.Source§impl FromStr for InlineFlexStr<Path>
Available on crate features std and path only.
impl FromStr for InlineFlexStr<Path>
Available on crate features
std and path only.Source§impl FromStr for InlineFlexStr<str>
Available on crate feature str only.
impl FromStr for InlineFlexStr<str>
Available on crate feature
str only.Source§impl<S> Hash for InlineFlexStr<S>
impl<S> Hash for InlineFlexStr<S>
Source§impl<S, I: SliceIndex<S>> Index<I> for InlineFlexStr<S>
impl<S, I: SliceIndex<S>> Index<I> for InlineFlexStr<S>
Source§impl<S, I: SliceIndex<S>> IndexMut<I> for InlineFlexStr<S>
impl<S, I: SliceIndex<S>> IndexMut<I> for InlineFlexStr<S>
Source§impl<S> Ord for InlineFlexStr<S>
impl<S> Ord for InlineFlexStr<S>
Source§impl<S> PartialEq<&[u8]> for InlineFlexStr<S>
Available on crate feature bytes only.
impl<S> PartialEq<&[u8]> for InlineFlexStr<S>
Available on crate feature
bytes only.Source§impl<S> PartialEq<&CStr> for InlineFlexStr<S>
Available on crate feature cstr only.
impl<S> PartialEq<&CStr> for InlineFlexStr<S>
Available on crate feature
cstr only.Source§impl<S> PartialEq<&OsStr> for InlineFlexStr<S>
Available on crate features std and osstr only.
impl<S> PartialEq<&OsStr> for InlineFlexStr<S>
Available on crate features
std and osstr only.Source§impl<S> PartialEq<&Path> for InlineFlexStr<S>
Available on crate features std and path only.
impl<S> PartialEq<&Path> for InlineFlexStr<S>
Available on crate features
std and path only.Source§impl<S> PartialEq<&str> for InlineFlexStr<S>
Available on crate feature str only.
impl<S> PartialEq<&str> for InlineFlexStr<S>
Available on crate feature
str only.Source§impl<S> PartialEq<[u8]> for InlineFlexStr<S>
Available on crate feature bytes only.
impl<S> PartialEq<[u8]> for InlineFlexStr<S>
Available on crate feature
bytes only.Source§impl<S> PartialEq<CStr> for InlineFlexStr<S>
Available on crate feature cstr only.
impl<S> PartialEq<CStr> for InlineFlexStr<S>
Available on crate feature
cstr only.Source§impl<S> PartialEq<CString> for InlineFlexStr<S>
Available on crate feature cstr only.
impl<S> PartialEq<CString> for InlineFlexStr<S>
Available on crate feature
cstr only.Source§impl<S> PartialEq<Cow<'_, OsStr>> for InlineFlexStr<S>
Available on crate features std and osstr only.
impl<S> PartialEq<Cow<'_, OsStr>> for InlineFlexStr<S>
Available on crate features
std and osstr only.Source§impl<S> PartialEq<Cow<'_, Path>> for InlineFlexStr<S>
Available on crate features std and path only.
impl<S> PartialEq<Cow<'_, Path>> for InlineFlexStr<S>
Available on crate features
std and path only.Source§impl<S> PartialEq<InlineFlexStr<S>> for &[u8]
Available on crate feature bytes only.
impl<S> PartialEq<InlineFlexStr<S>> for &[u8]
Available on crate feature
bytes only.Source§impl<S> PartialEq<InlineFlexStr<S>> for &CStr
Available on crate feature cstr only.
impl<S> PartialEq<InlineFlexStr<S>> for &CStr
Available on crate feature
cstr only.Source§impl<S> PartialEq<InlineFlexStr<S>> for &OsStr
Available on crate features std and osstr only.
impl<S> PartialEq<InlineFlexStr<S>> for &OsStr
Available on crate features
std and osstr only.Source§impl<S> PartialEq<InlineFlexStr<S>> for &Path
Available on crate features std and path only.
impl<S> PartialEq<InlineFlexStr<S>> for &Path
Available on crate features
std and path only.Source§impl<S> PartialEq<InlineFlexStr<S>> for &str
Available on crate feature str only.
impl<S> PartialEq<InlineFlexStr<S>> for &str
Available on crate feature
str only.Source§impl<S> PartialEq<InlineFlexStr<S>> for [u8]
Available on crate feature bytes only.
impl<S> PartialEq<InlineFlexStr<S>> for [u8]
Available on crate feature
bytes only.Source§impl<S> PartialEq<InlineFlexStr<S>> for CStr
Available on crate feature cstr only.
impl<S> PartialEq<InlineFlexStr<S>> for CStr
Available on crate feature
cstr only.Source§impl<S> PartialEq<InlineFlexStr<S>> for CString
Available on crate feature cstr only.
impl<S> PartialEq<InlineFlexStr<S>> for CString
Available on crate feature
cstr only.Source§impl<S> PartialEq<InlineFlexStr<S>> for Cow<'_, OsStr>
Available on crate features std and osstr only.
impl<S> PartialEq<InlineFlexStr<S>> for Cow<'_, OsStr>
Available on crate features
std and osstr only.Source§impl<S> PartialEq<InlineFlexStr<S>> for Cow<'_, Path>
Available on crate features std and path only.
impl<S> PartialEq<InlineFlexStr<S>> for Cow<'_, Path>
Available on crate features
std and path only.Source§impl<S> PartialEq<InlineFlexStr<S>> for OsStr
Available on crate features std and osstr only.
impl<S> PartialEq<InlineFlexStr<S>> for OsStr
Available on crate features
std and osstr only.Source§impl<S> PartialEq<InlineFlexStr<S>> for OsString
Available on crate features std and osstr only.
impl<S> PartialEq<InlineFlexStr<S>> for OsString
Available on crate features
std and osstr only.Source§impl<S> PartialEq<InlineFlexStr<S>> for Path
Available on crate features std and path only.
impl<S> PartialEq<InlineFlexStr<S>> for Path
Available on crate features
std and path only.Source§impl<S> PartialEq<InlineFlexStr<S>> for PathBuf
Available on crate features std and path only.
impl<S> PartialEq<InlineFlexStr<S>> for PathBuf
Available on crate features
std and path only.Source§impl<S> PartialEq<InlineFlexStr<S>> for String
Available on crate feature str only.
impl<S> PartialEq<InlineFlexStr<S>> for String
Available on crate feature
str only.Source§impl<S> PartialEq<InlineFlexStr<S>> for str
Available on crate feature str only.
impl<S> PartialEq<InlineFlexStr<S>> for str
Available on crate feature
str only.Source§impl<S> PartialEq<OsStr> for InlineFlexStr<S>
Available on crate features std and osstr only.
impl<S> PartialEq<OsStr> for InlineFlexStr<S>
Available on crate features
std and osstr only.Source§impl<S> PartialEq<OsString> for InlineFlexStr<S>
Available on crate features std and osstr only.
impl<S> PartialEq<OsString> for InlineFlexStr<S>
Available on crate features
std and osstr only.Source§impl<S> PartialEq<Path> for InlineFlexStr<S>
Available on crate features std and path only.
impl<S> PartialEq<Path> for InlineFlexStr<S>
Available on crate features
std and path only.Source§impl<S> PartialEq<PathBuf> for InlineFlexStr<S>
Available on crate features std and path only.
impl<S> PartialEq<PathBuf> for InlineFlexStr<S>
Available on crate features
std and path only.Source§impl<S> PartialEq<String> for InlineFlexStr<S>
Available on crate feature str only.
impl<S> PartialEq<String> for InlineFlexStr<S>
Available on crate feature
str only.Source§impl<S> PartialEq<str> for InlineFlexStr<S>
Available on crate feature str only.
impl<S> PartialEq<str> for InlineFlexStr<S>
Available on crate feature
str only.Source§impl<S> PartialEq for InlineFlexStr<S>
impl<S> PartialEq for InlineFlexStr<S>
Source§impl<S> PartialOrd for InlineFlexStr<S>
impl<S> PartialOrd for InlineFlexStr<S>
Source§impl<S> Serialize for InlineFlexStr<S>
Available on crate feature serde only.
impl<S> Serialize for InlineFlexStr<S>
Available on crate feature
serde only.Source§impl<S: ?Sized + StringToFromBytes + 'static> StringLike<S> for InlineFlexStr<S>
impl<S: ?Sized + StringToFromBytes + 'static> StringLike<S> for InlineFlexStr<S>
Source§fn as_ref_type(&self) -> &S
fn as_ref_type(&self) -> &S
Borrow a string reference as
&SSource§fn into_owned_type(self) -> S::Owned
fn into_owned_type(self) -> S::Owned
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
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 as_os_str(&self) -> &OsStr
fn as_os_str(&self) -> &OsStr
Available on crate features
std and osstr only.Borrow the string as an
&OsStrSource§fn as_path(&self) -> &Path
fn as_path(&self) -> &Path
Available on crate features
std and path only.Borrow the string as a
&PathSource§fn into_string(self) -> String
fn into_string(self) -> String
Consume a string and convert it to a String
Source§fn into_os_string(self) -> OsString
fn into_os_string(self) -> OsString
Available on crate features
std and osstr only.Consume a string and convert it to an OsString
Source§fn into_path_buf(self) -> PathBuf
fn into_path_buf(self) -> PathBuf
Available on crate features
std and path only.Consume a string and convert it to a PathBuf
Source§fn into_c_string(self) -> CString
fn into_c_string(self) -> CString
Available on crate feature
cstr only.Consume a string and convert it to a CString
Source§fn into_vec_bytes(self) -> Vec<u8> ⓘ
fn into_vec_bytes(self) -> Vec<u8> ⓘ
Available on crate feature
bytes only.Consume a string and convert it to a
Vec<u8>Source§fn to_os_string(&self) -> OsString
fn to_os_string(&self) -> OsString
Available on crate features
std and osstr only.Convert a string reference to an OsString
Source§fn to_path_buf(&self) -> PathBuf
fn to_path_buf(&self) -> PathBuf
Available on crate features
std and path only.Convert a string reference to a PathBuf
Source§fn to_c_string(&self) -> CString
fn to_c_string(&self) -> CString
Available on crate feature
cstr only.Convert a string reference to a CString
Source§impl<S> ToSocketAddrs for InlineFlexStr<S>
Available on crate feature std only.
impl<S> ToSocketAddrs for InlineFlexStr<S>
Available on crate feature
std only.Source§type Iter = <S as ToSocketAddrs>::Iter
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>
fn to_socket_addrs(&self) -> Result<<S as ToSocketAddrs>::Iter>
Converts this object to an iterator of resolved
SocketAddrs. Read moreSource§impl<'s> TryFrom<&'s OsStr> for InlineFlexStr<OsStr>
Available on crate features std and osstr only.
impl<'s> TryFrom<&'s OsStr> for InlineFlexStr<OsStr>
Available on crate features
std and osstr only.Source§impl<'s> TryFrom<&'s OsStr> for InlineFlexStr<Path>
Available on crate features std and path only.
impl<'s> TryFrom<&'s OsStr> for InlineFlexStr<Path>
Available on crate features
std and path only.Source§impl<'s> TryFrom<&'s OsStr> for InlineFlexStr<str>
Available on crate features str and std only.
impl<'s> TryFrom<&'s OsStr> for InlineFlexStr<str>
Available on crate features
str and std only.Source§impl<'s> TryFrom<&'s Path> for InlineFlexStr<OsStr>
Available on crate features std and osstr only.
impl<'s> TryFrom<&'s Path> for InlineFlexStr<OsStr>
Available on crate features
std and osstr only.Source§impl<'s> TryFrom<&'s Path> for InlineFlexStr<Path>
Available on crate features std and path only.
impl<'s> TryFrom<&'s Path> for InlineFlexStr<Path>
Available on crate features
std and path only.Source§impl<'s> TryFrom<&'s Path> for InlineFlexStr<str>
Available on crate features str and std only.
impl<'s> TryFrom<&'s Path> for InlineFlexStr<str>
Available on crate features
str and std only.Source§impl<'s> TryFrom<&'s str> for InlineFlexStr<OsStr>
Available on crate features std and osstr only.
impl<'s> TryFrom<&'s str> for InlineFlexStr<OsStr>
Available on crate features
std and osstr only.Source§impl<'s> TryFrom<&'s str> for InlineFlexStr<Path>
Available on crate features std and path only.
impl<'s> TryFrom<&'s str> for InlineFlexStr<Path>
Available on crate features
std and path only.impl<S: ?Sized + StringToFromBytes> Copy for InlineFlexStr<S>
impl<S> Eq for InlineFlexStr<S>
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>
impl<S> Sync for InlineFlexStr<S>
impl<S> Unpin for InlineFlexStr<S>
impl<S> UnwindSafe for InlineFlexStr<S>where
S: UnwindSafe + ?Sized,
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