[][src]Struct internship::IStr

pub struct 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]

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests for !=.

impl PartialEq<String> for IStr[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]

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests for !=.

impl PartialEq<str> for IStr[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_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Ord for IStr[src]

fn max(self, other: Self) -> Self1.21.0[src]

Compares and returns the maximum of two values. Read more

fn min(self, other: Self) -> Self1.21.0[src]

Compares and returns the minimum of two values. Read more

fn clamp(self, min: Self, max: Self) -> Self[src]

🔬 This is a nightly-only experimental API. (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.

impl Display for IStr[src]

impl Debug for IStr[src]

impl Hash for IStr[src]

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

Feeds a slice of this type into the given [Hasher]. Read more

impl Deref for IStr[src]

type Target = str

The resulting type after dereferencing.

impl Index<Range<usize>> for IStr[src]

type Output = str

The returned type after indexing.

impl Index<RangeFrom<usize>> for IStr[src]

type Output = str

The returned type after indexing.

impl Index<RangeTo<usize>> for IStr[src]

type Output = str

The returned type after indexing.

impl Index<RangeFull> for IStr[src]

type Output = str

The returned type after indexing.

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

impl Serialize for IStr[src]

impl<'d> Deserialize<'d> for IStr[src]

Auto Trait Implementations

impl !Send for IStr

impl !Sync for IStr

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

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