[−][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]
fn partial_cmp(&self, other: &IStr) -> Option<Ordering>
[src]
fn lt(&self, other: &IStr) -> bool
[src]
fn le(&self, other: &IStr) -> bool
[src]
fn gt(&self, other: &IStr) -> bool
[src]
fn ge(&self, other: &IStr) -> bool
[src]
impl PartialEq<IStr> for IStr
[src]
impl<'a> PartialEq<Cow<'a, str>> for IStr
[src]
fn eq(&self, other: &Cow<str>) -> bool
[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.
impl PartialEq<String> for IStr
[src]
fn eq(&self, other: &String) -> bool
[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.
impl<'a> PartialEq<&'a str> for IStr
[src]
fn eq(&self, other: &&str) -> bool
[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.
impl PartialEq<str> for IStr
[src]
fn eq(&self, other: &str) -> bool
[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.
impl Default for IStr
[src]
impl AsRef<str> for IStr
[src]
impl AsRef<[u8]> for IStr
[src]
impl Clone for IStr
[src]
fn clone(&self) -> IStr
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Ord for IStr
[src]
fn cmp(&self, other: &IStr) -> Ordering
[src]
fn max(self, other: Self) -> Self
1.21.0[src]
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
1.21.0[src]
Compares and returns the minimum of two values. Read more
fn clamp(self, min: Self, max: Self) -> Self
[src]
clamp
)Restrict a value to a certain interval. Read more
impl FromStr for IStr
[src]
type Err = ParseError
The associated error which can be returned from parsing.
fn from_str(src: &str) -> Result<Self, ParseError>
[src]
impl Display for IStr
[src]
impl Debug for IStr
[src]
impl Hash for IStr
[src]
fn hash<H: Hasher>(&self, hasher: &mut H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl Deref for IStr
[src]
impl Index<Range<usize>> for IStr
[src]
type Output = str
The returned type after indexing.
fn index(&self, index: Range<usize>) -> &str
[src]
impl Index<RangeFrom<usize>> for IStr
[src]
type Output = str
The returned type after indexing.
fn index(&self, index: RangeFrom<usize>) -> &str
[src]
impl Index<RangeTo<usize>> for IStr
[src]
type Output = str
The returned type after indexing.
fn index(&self, index: RangeTo<usize>) -> &str
[src]
impl Index<RangeFull> for IStr
[src]
impl Borrow<str> for IStr
[src]
impl ToSocketAddrs for IStr
[src]
type Iter = <str as ToSocketAddrs>::Iter
Returned iterator over socket addresses which this type may correspond to. Read more
fn to_socket_addrs(&self) -> Result<Self::Iter>
[src]
impl Serialize for IStr
[src]
impl<'d> Deserialize<'d> for IStr
[src]
fn deserialize<D: Deserializer<'d>>(d: D) -> Result<IStr, D::Error>
[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,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
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>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
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>,