Converts an atom back to its string representation. Returns `None` for invalid atoms.
(&self, atom: Atom<T>)
| 95 | |
| 96 | /// Converts an atom back to its string representation. Returns `None` for invalid atoms. |
| 97 | pub fn atom_to_str(&self, atom: Atom<T>) -> Option<&'static str> { |
| 98 | let bits = atom.as_bits(); |
| 99 | if DynAtomRegistry::<T>::is_dynamic(bits) { self.lookup(bits) } else { Some(T::from_bits(bits).to_str()) } |
| 100 | } |
| 101 | |
| 102 | /// Interns a string, returning its dynamic atom bits. |
| 103 | fn atomize(&self, s: &str) -> u32 { |