[][src]Struct syntax::symbol::Symbol

pub struct Symbol(_);

A symbol is an interned or gensymed string. The use of newtype_index! means that Option only takes up 4 bytes, because newtype_index! reserves the last 256 values for tagging purposes.

Note that Symbol cannot be a newtype_index! directly because it implements fmt::Debug, Encodable, and Decodable in special ways.

Methods

impl Symbol[src]

pub fn intern(string: &str) -> Symbol[src]

Maps a string to its interned representation.

pub fn interned(self) -> Symbol[src]

pub fn gensym(string: &str) -> Symbol[src]

Gensyms a new usize, using the current interner.

pub fn gensymed(self) -> Symbol[src]

pub fn as_str(self) -> LocalInternedString[src]

pub fn as_interned_str(self) -> InternedString[src]

pub fn as_u32(self) -> u32[src]

Trait Implementations

impl Copy for Symbol[src]

impl Ord for Symbol[src]

fn max(self, other: Self) -> Self
1.21.0
[src]

Compares and returns the maximum of two values. Read more

fn min(self, other: Self) -> Self
1.21.0
[src]

Compares and returns the minimum of two values. Read more

impl Display for Symbol[src]

impl !Sync for Symbol[src]

impl Eq for Symbol[src]

impl Decodable for Symbol[src]

impl<T> PartialEq<T> for Symbol where
    T: Deref<Target = str>, 
[src]

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

This method tests for !=.

impl PartialEq<Symbol> for Symbol[src]

impl !Send for Symbol[src]

impl Debug for Symbol[src]

impl Clone for Symbol[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl PartialOrd<Symbol> for Symbol[src]

impl Hash for Symbol[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 Encodable for Symbol[src]

Blanket Implementations

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

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

type Owned = T

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

impl<T> From for T[src]

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

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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

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

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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

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

impl<T> Encodable for T where
    T: UseSpecializedEncodable + ?Sized
[src]

impl<T> Decodable for T where
    T: UseSpecializedDecodable
[src]

impl<E> SpecializationError for E[src]

impl<T> Erased for T[src]

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

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

impl<T> Erased for T