string_cache

Type Alias DefaultAtom

Source
pub type DefaultAtom = Atom<EmptyStaticAtomSet>;
Expand description

Use this if you don’t care about static atoms.

Aliased Type§

struct DefaultAtom { /* private fields */ }

Implementations

Source§

impl<Static: StaticAtomSet> Atom<Static>

Source

pub fn get_hash(&self) -> u32

Get the hash of the string as it is stored in the set.

Source

pub fn try_static(string_to_add: &str) -> Option<Self>

Source§

impl<Static: StaticAtomSet> Atom<Static>

Source

pub fn to_ascii_uppercase(&self) -> Self

Source

pub fn to_ascii_lowercase(&self) -> Self

Source

pub fn eq_ignore_ascii_case(&self, other: &Self) -> bool

Source

pub fn eq_str_ignore_ascii_case(&self, other: &str) -> bool

Like eq_ignore_ascii_case, but takes an unhashed string as other.

Trait Implementations

Source§

impl<Static: StaticAtomSet> AsRef<str> for Atom<Static>

Source§

fn as_ref(&self) -> &str

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl<Static: StaticAtomSet> Clone for Atom<Static>

Source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl<Static: StaticAtomSet> Debug for Atom<Static>

Source§

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

Formats the value using the given formatter. Read more
Source§

impl<Static: StaticAtomSet> Default for Atom<Static>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<Static: StaticAtomSet> Deref for Atom<Static>

Source§

type Target = str

The resulting type after dereferencing.
Source§

fn deref(&self) -> &str

Dereferences the value.
Source§

impl<'a, Static: StaticAtomSet> Deserialize<'a> for Atom<Static>

Source§

fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where D: Deserializer<'a>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl<Static: StaticAtomSet> Display for Atom<Static>

Source§

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

Formats the value using the given formatter. Read more
Source§

impl<Static> Drop for Atom<Static>

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl<'a, Static: StaticAtomSet> From<&'a Atom<Static>> for Atom<Static>

Source§

fn from(atom: &'a Self) -> Self

Converts to this type from the input type.
Source§

impl<'a, Static: StaticAtomSet> From<&'a str> for Atom<Static>

Source§

fn from(string_to_add: &str) -> Self

Converts to this type from the input type.
Source§

impl<'a, Static: StaticAtomSet> From<Cow<'a, str>> for Atom<Static>

Source§

fn from(string_to_add: Cow<'a, str>) -> Self

Converts to this type from the input type.
Source§

impl<Static: StaticAtomSet> From<String> for Atom<Static>

Source§

fn from(string_to_add: String) -> Self

Converts to this type from the input type.
Source§

impl<Static: StaticAtomSet> Hash for Atom<Static>

Source§

fn hash<H>(&self, state: &mut H)
where H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

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

Feeds a slice of this type into the given Hasher. Read more
Source§

impl<Static: StaticAtomSet> Ord for Atom<Static>

Source§

fn cmp(&self, other: &Self) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl<Static: StaticAtomSet> PartialEq<String> for Atom<Static>

Source§

fn eq(&self, other: &String) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<Static: StaticAtomSet> PartialEq<str> for Atom<Static>

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<Static: PartialEq> PartialEq for Atom<Static>

Source§

fn eq(&self, other: &Atom<Static>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<Static: StaticAtomSet> PartialOrd for Atom<Static>

Source§

fn partial_cmp(&self, other: &Self) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl<Static: StaticAtomSet> PrecomputedHash for Atom<Static>

Source§

fn precomputed_hash(&self) -> u32

Return the precomputed hash for this item.
Source§

impl<Static: StaticAtomSet> Serialize for Atom<Static>

Source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl<Static: Eq> Eq for Atom<Static>

Source§

impl<Static> StructuralPartialEq for Atom<Static>