17e2e9c0cSopenharmony_ciuse std::fmt::{self, Display}; 27e2e9c0cSopenharmony_ciuse syn::{Ident, Path}; 37e2e9c0cSopenharmony_ci 47e2e9c0cSopenharmony_ci#[derive(Copy, Clone)] 57e2e9c0cSopenharmony_cipub struct Symbol(&'static str); 67e2e9c0cSopenharmony_ci 77e2e9c0cSopenharmony_cipub const ALIAS: Symbol = Symbol("alias"); 87e2e9c0cSopenharmony_cipub const BORROW: Symbol = Symbol("borrow"); 97e2e9c0cSopenharmony_cipub const BOUND: Symbol = Symbol("bound"); 107e2e9c0cSopenharmony_cipub const CONTENT: Symbol = Symbol("content"); 117e2e9c0cSopenharmony_cipub const CRATE: Symbol = Symbol("crate"); 127e2e9c0cSopenharmony_cipub const DEFAULT: Symbol = Symbol("default"); 137e2e9c0cSopenharmony_cipub const DENY_UNKNOWN_FIELDS: Symbol = Symbol("deny_unknown_fields"); 147e2e9c0cSopenharmony_cipub const DESERIALIZE: Symbol = Symbol("deserialize"); 157e2e9c0cSopenharmony_cipub const DESERIALIZE_WITH: Symbol = Symbol("deserialize_with"); 167e2e9c0cSopenharmony_cipub const EXPECTING: Symbol = Symbol("expecting"); 177e2e9c0cSopenharmony_cipub const FIELD_IDENTIFIER: Symbol = Symbol("field_identifier"); 187e2e9c0cSopenharmony_cipub const FLATTEN: Symbol = Symbol("flatten"); 197e2e9c0cSopenharmony_cipub const FROM: Symbol = Symbol("from"); 207e2e9c0cSopenharmony_cipub const GETTER: Symbol = Symbol("getter"); 217e2e9c0cSopenharmony_cipub const INTO: Symbol = Symbol("into"); 227e2e9c0cSopenharmony_cipub const NON_EXHAUSTIVE: Symbol = Symbol("non_exhaustive"); 237e2e9c0cSopenharmony_cipub const OTHER: Symbol = Symbol("other"); 247e2e9c0cSopenharmony_cipub const REMOTE: Symbol = Symbol("remote"); 257e2e9c0cSopenharmony_cipub const RENAME: Symbol = Symbol("rename"); 267e2e9c0cSopenharmony_cipub const RENAME_ALL: Symbol = Symbol("rename_all"); 277e2e9c0cSopenharmony_cipub const RENAME_ALL_FIELDS: Symbol = Symbol("rename_all_fields"); 287e2e9c0cSopenharmony_cipub const REPR: Symbol = Symbol("repr"); 297e2e9c0cSopenharmony_cipub const SERDE: Symbol = Symbol("serde"); 307e2e9c0cSopenharmony_cipub const SERIALIZE: Symbol = Symbol("serialize"); 317e2e9c0cSopenharmony_cipub const SERIALIZE_WITH: Symbol = Symbol("serialize_with"); 327e2e9c0cSopenharmony_cipub const SKIP: Symbol = Symbol("skip"); 337e2e9c0cSopenharmony_cipub const SKIP_DESERIALIZING: Symbol = Symbol("skip_deserializing"); 347e2e9c0cSopenharmony_cipub const SKIP_SERIALIZING: Symbol = Symbol("skip_serializing"); 357e2e9c0cSopenharmony_cipub const SKIP_SERIALIZING_IF: Symbol = Symbol("skip_serializing_if"); 367e2e9c0cSopenharmony_cipub const TAG: Symbol = Symbol("tag"); 377e2e9c0cSopenharmony_cipub const TRANSPARENT: Symbol = Symbol("transparent"); 387e2e9c0cSopenharmony_cipub const TRY_FROM: Symbol = Symbol("try_from"); 397e2e9c0cSopenharmony_cipub const UNTAGGED: Symbol = Symbol("untagged"); 407e2e9c0cSopenharmony_cipub const VARIANT_IDENTIFIER: Symbol = Symbol("variant_identifier"); 417e2e9c0cSopenharmony_cipub const WITH: Symbol = Symbol("with"); 427e2e9c0cSopenharmony_ci 437e2e9c0cSopenharmony_ciimpl PartialEq<Symbol> for Ident { 447e2e9c0cSopenharmony_ci fn eq(&self, word: &Symbol) -> bool { 457e2e9c0cSopenharmony_ci self == word.0 467e2e9c0cSopenharmony_ci } 477e2e9c0cSopenharmony_ci} 487e2e9c0cSopenharmony_ci 497e2e9c0cSopenharmony_ciimpl<'a> PartialEq<Symbol> for &'a Ident { 507e2e9c0cSopenharmony_ci fn eq(&self, word: &Symbol) -> bool { 517e2e9c0cSopenharmony_ci *self == word.0 527e2e9c0cSopenharmony_ci } 537e2e9c0cSopenharmony_ci} 547e2e9c0cSopenharmony_ci 557e2e9c0cSopenharmony_ciimpl PartialEq<Symbol> for Path { 567e2e9c0cSopenharmony_ci fn eq(&self, word: &Symbol) -> bool { 577e2e9c0cSopenharmony_ci self.is_ident(word.0) 587e2e9c0cSopenharmony_ci } 597e2e9c0cSopenharmony_ci} 607e2e9c0cSopenharmony_ci 617e2e9c0cSopenharmony_ciimpl<'a> PartialEq<Symbol> for &'a Path { 627e2e9c0cSopenharmony_ci fn eq(&self, word: &Symbol) -> bool { 637e2e9c0cSopenharmony_ci self.is_ident(word.0) 647e2e9c0cSopenharmony_ci } 657e2e9c0cSopenharmony_ci} 667e2e9c0cSopenharmony_ci 677e2e9c0cSopenharmony_ciimpl Display for Symbol { 687e2e9c0cSopenharmony_ci fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { 697e2e9c0cSopenharmony_ci formatter.write_str(self.0) 707e2e9c0cSopenharmony_ci } 717e2e9c0cSopenharmony_ci} 72