[−][src]Struct internship::IStr
Interned string type
IStr
is designed for drop-in-replacement of immutable String
.
Conceptually, IStr
is similar to Rc<str>
as both are immutable and zero-copy shareable.
But IStr
is interned, and inlined if small enough.
Methods
impl IStr
[src][−]
pub fn new(src: &str) -> Self
[src]
pub fn from_utf8(src: &[u8]) -> Result<Self, Utf8Error>
[src]
pub fn as_str(&self) -> &str
[src]
pub fn as_bytes(&self) -> &[u8]
[src]
pub fn to_ibytes(&self) -> IBytes
[src]
Trait Implementations
impl Eq for IStr
[src]
impl From<String> for IStr
[src][+]
impl<'a> From<&'a str> for IStr
[src][+]
impl From<Box<str>> for IStr
[src][+]
impl<'a> From<Cow<'a, str>> for IStr
[src][+]
impl From<IStr> for IBytes
[src][+]
impl PartialOrd<IStr> for IStr
[src][+]
impl PartialEq<IStr> for IStr
[src][+]
impl<'a> PartialEq<Cow<'a, str>> for IStr
[src][+]
impl PartialEq<String> for IStr
[src][+]
impl<'a> PartialEq<&'a str> for IStr
[src][+]
impl PartialEq<str> for IStr
[src][+]
impl Default for IStr
[src][+]
impl AsRef<str> for IStr
[src][+]
impl AsRef<[u8]> for IStr
[src][+]
impl Clone for IStr
[src][+]
impl Ord for IStr
[src][+]
impl FromStr for IStr
[src][+]
impl Display for IStr
[src][+]
impl Debug for IStr
[src][+]
impl Hash for IStr
[src][+]
impl Deref for IStr
[src][+]
impl Index<Range<usize>> for IStr
[src][+]
impl Index<RangeFrom<usize>> for IStr
[src][+]
impl Index<RangeTo<usize>> for IStr
[src][+]
impl Index<RangeFull> for IStr
[src][+]
impl Borrow<str> for IStr
[src][+]
impl ToSocketAddrs for IStr
[src][+]
impl Serialize for IStr
[src][+]
impl<'d> Deserialize<'d> for IStr
[src][+]
Auto Trait Implementations
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src][+]
U: From<T>,
impl<T> From<T> for T
[src][+]
impl<T> ToOwned for T where
T: Clone,
[src][+]
T: Clone,
impl<T> ToString for T where
T: Display + ?Sized,
[src][+]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src][+]
U: Into<T>,
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src][+]
U: TryFrom<T>,
impl<T> Borrow<T> for T where
T: ?Sized,
[src][+]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src][+]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src][+]
T: 'static + ?Sized,
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,