[][src]Struct immutable_string::ImmutableString

pub struct ImmutableString(_);

Implementations

impl ImmutableString[src]

pub fn use_count(&self) -> usize[src]

Returns the number of ImmutableStrings referencing the same data.

use immutable_string::*;

let a  = ImmutableString::from("a");
let a0 = ImmutableString::from("a");
let a1 = a.clone();
let b  = ImmutableString::from("b");

assert_eq!(a.use_count(), 3);
assert_eq!(a0.use_count(), 3);
assert_eq!(a1.use_count(), 3);
assert_eq!(b.use_count(), 1);

Trait Implementations

impl AsRef<str> for ImmutableString[src]

impl Borrow<str> for ImmutableString[src]

impl Clone for ImmutableString[src]

impl Debug for ImmutableString[src]

impl Deref for ImmutableString[src]

type Target = str

The resulting type after dereferencing.

impl Display for ImmutableString[src]

impl Eq for ImmutableString[src]

impl<T: ?Sized> From<T> for ImmutableString where
    T: Deref<Target = str> + Into<Arc<str>>, 
[src]

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

impl FromIterator<char> for ImmutableString[src]

impl Hash for ImmutableString[src]

impl Ord for ImmutableString[src]

impl PartialEq<ImmutableString> for ImmutableString[src]

impl PartialOrd<ImmutableString> for ImmutableString[src]

impl StructuralEq for ImmutableString[src]

impl StructuralPartialEq for ImmutableString[src]

Auto Trait Implementations

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.