pub struct InlineFlexStr<S: ?Sized + StringToFromBytes> { /* private fields */ }Expand description
Inline bytes type - used to store small strings inline
Implementations§
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<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<S> Display for InlineFlexStr<S>
impl<S> Display for InlineFlexStr<S>
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<&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<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 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<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: ?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 into_string(self) -> String
fn into_string(self) -> String
Consume a string and convert it to a String
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<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<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.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