[][src]Struct pstr::IStr

pub struct IStr(_);

Immutable Interning String

Implementations

impl IStr[src]

pub fn new(s: impl AsRef<str>) -> Self[src]

Create a IStr from str slice

Example

let s = IStr::new("hello world");

pub fn from_string(s: String) -> Self[src]

Create a IStr from String

pub fn from_boxed(s: Box<str>) -> Self[src]

Create a IStr from Box<str>

pub fn from_arc(s: Arc<str>) -> Self[src]

Create a IStr from Arc<str>

pub fn from_rc(s: Rc<str>) -> Self[src]

Create a IStr from Rc<str>

pub fn from_mow(s: MowStr) -> Self[src]

Create a IStr from MowStr

pub fn from_to_arc<S: AsRef<str>>(
    s: S,
    to_arc: impl FnOnce(S) -> Arc<str>
) -> Self
[src]

Create a IStr from custom fn

impl IStr[src]

pub fn as_str(&self) -> &str[src]

Extracts a string slice containing the entire IStr

pub fn into_boxed_str(&self) -> Box<str>[src]

Clone a boxed string slice containing the entire IStr

pub fn into_mut(&self) -> MowStr[src]

Convert to MowStr

Trait Implementations

impl AsRef<[u8]> for IStr[src]

impl AsRef<OsStr> for IStr[src]

impl AsRef<Path> for IStr[src]

impl AsRef<str> for IStr[src]

impl Borrow<str> for IStr[src]

impl Clone for IStr[src]

impl Debug for IStr[src]

impl Deref for IStr[src]

type Target = str

The resulting type after dereferencing.

impl Eq for IStr[src]

impl Extend<IStr> for MowStr[src]

impl<'_> From<&'_ String> for IStr[src]

impl<'_> From<&'_ mut str> for IStr[src]

impl<'_> From<&'_ str> for IStr[src]

impl<'a> From<&'a IStr> for Cow<'a, str>[src]

impl From<Arc<str>> for IStr[src]

impl From<Box<str>> for IStr[src]

impl<'a> From<Cow<'a, str>> for IStr[src]

impl From<IStr> for Box<str>[src]

impl From<IStr> for Vec<u8>[src]

impl From<IStr> for MowStr[src]

impl From<IStr> for Arc<str>[src]

impl From<IStr> for Rc<str>[src]

impl<'a> From<IStr> for Cow<'a, str>[src]

impl From<IStr> for Box<dyn Error>[src]

impl From<IStr> for Box<dyn Error + Send + Sync>[src]

impl From<IStr> for OsString[src]

impl From<IStr> for PathBuf[src]

impl From<IStr> for String[src]

impl From<MowStr> for IStr[src]

impl From<Rc<str>> for IStr[src]

impl From<String> for IStr[src]

impl From<char> for IStr[src]

impl<'a> FromIterator<&'a char> for IStr[src]

impl<'a> FromIterator<&'a str> for IStr[src]

impl FromIterator<Box<str>> for IStr[src]

impl<'a> FromIterator<Cow<'a, str>> for IStr[src]

impl FromIterator<String> for IStr[src]

impl FromIterator<char> for IStr[src]

impl FromStr for IStr[src]

type Err = ParseError

The associated error which can be returned from parsing.

impl Hash for IStr[src]

impl<I: SliceIndex<str>> Index<I> for IStr[src]

type Output = <I as SliceIndex<str>>::Output

The returned type after indexing.

impl Interning for IStr[src]

type Outern = IStr

impl Muterning for IStr[src]

type Outern = MowStr

impl Ord for IStr[src]

impl<'_> PartialEq<&'_ OsStr> for IStr[src]

impl<'_> PartialEq<&'_ str> for IStr[src]

impl PartialEq<IStr> for IStr[src]

impl PartialEq<OsStr> for IStr[src]

impl PartialEq<OsString> for IStr[src]

impl PartialEq<String> for IStr[src]

impl PartialEq<str> for IStr[src]

impl PartialOrd<IStr> for IStr[src]

impl StructuralEq for IStr[src]

impl StructuralPartialEq 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 ToString for IStr[src]

Auto Trait Implementations

impl RefUnwindSafe for IStr

impl Send for IStr

impl Sync for IStr

impl Unpin for IStr

impl UnwindSafe for IStr

Blanket Implementations

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

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

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

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

impl<T, U> Into<U> for T where
    U: From<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.