Struct syntax::parse::token::InternedStringUnstable [-] [+] [src]

pub struct InternedString {
    // some fields omitted
}

Represents a string stored in the task-local interner. Because the interner lives for the life of the task, this can be safely treated as an immortal string, as long as it never crosses between tasks.

FIXME(pcwalton): You must be careful about what you do in the destructors of objects stored in TLS, because they may run after the interner is destroyed. In particular, they must not access string contents. This can be fixed in the future by just leaking all strings until task death somehow.

Methods

impl InternedString

fn new(string: &'static str) -> InternedString

Trait Implementations

impl Deref for InternedString

type Target = str

fn deref(&self) -> &str

impl BytesContainer for InternedString

fn container_as_bytes<'a>(&'a self) -> &'a [u8]

fn container_as_str(&'a self) -> Option<&'a str>

fn is_str(Option<&Self>) -> bool

impl Debug for InternedString

fn fmt(&self, f: &mut Formatter) -> Result

impl Display for InternedString

fn fmt(&self, f: &mut Formatter) -> Result

impl<'a> PartialEq<&'a str> for InternedString

fn eq(&self, other: &&'a str) -> bool

fn ne(&self, other: &&'a str) -> bool

impl Decodable for InternedString

fn decode<D: Decoder>(d: &mut D) -> Result<InternedString, Error>

impl Encodable for InternedString

fn encode<S: Encoder>(&self, s: &mut S) -> Result<(), Error>

Derived Implementations

impl Ord for InternedString

fn cmp(&self, __arg_0: &InternedString) -> Ordering

impl Eq for InternedString

fn assert_receiver_is_total_eq(&self)

impl PartialOrd for InternedString

fn partial_cmp(&self, __arg_0: &InternedString) -> Option<Ordering>

fn lt(&self, __arg_0: &InternedString) -> bool

fn le(&self, __arg_0: &InternedString) -> bool

fn gt(&self, __arg_0: &InternedString) -> bool

fn ge(&self, __arg_0: &InternedString) -> bool

impl Hash for InternedString

fn hash<__H: Hasher>(&self, __arg_0: &mut __H)

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

impl PartialEq for InternedString

fn eq(&self, __arg_0: &InternedString) -> bool

fn ne(&self, __arg_0: &InternedString) -> bool

impl Clone for InternedString

fn clone(&self) -> InternedString

fn clone_from(&mut self, source: &Self)