[][src]Enum binjs_shared::SharedString

pub enum SharedString {
    Dynamic(Rc<String>),
    Static(&'static str),
}

An implementation of strings that may easily be shared without copies.

Static strings may be imported without copy, while dynamic strings are converted into Rc.

Variants

Dynamic(Rc<String>)
Static(&'static str)

Methods

impl SharedString[src]

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

pub const fn from_str(value: &'static str) -> Self[src]

pub fn from_rc_string(value: Rc<String>) -> Self[src]

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

Trait Implementations

impl Clone for SharedString[src]

impl Debug for SharedString[src]

impl Default for SharedString[src]

impl Deref for SharedString[src]

type Target = str

The resulting type after dereferencing.

impl<'de> Deserialize<'de> for SharedString[src]

Shared strings are deserialized as Dynamic strings.

impl Display for SharedString[src]

impl Eq for SharedString[src]

impl Hash for SharedString[src]

impl Ord for SharedString[src]

impl<'a> PartialEq<&'a str> for SharedString[src]

impl PartialEq<SharedString> for SharedString[src]

impl PartialEq<str> for SharedString[src]

impl PartialOrd<SharedString> for SharedString[src]

impl Serialize for SharedString[src]

Shared strings are serialized as strings. This loses any sharing :/

impl StructuralEq for SharedString[src]

Auto Trait Implementations

impl !RefUnwindSafe for SharedString

impl !Send for SharedString

impl !Sync for SharedString

impl Unpin for SharedString

impl UnwindSafe for SharedString

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> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]

impl<T> Downcast for T where
    T: Any
[src]

impl<T> DowncastSync for T where
    T: Send + Sync + Any
[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.