Lines Matching +full:rustc +full:- +full:serialize
33 /// auto-derives `std::str::FromStr` on the enum (for Rust 1.34 and above, `std::convert::TryFrom<&…
35 /// This can be overridden using `serialize="DifferentName"` or `to_string="DifferentName"`
67 /// #[strum(serialize = "blue", serialize = "b")]
84 /// fn from_str(s: &str) -> ::core::result::Result<Color, Self::Err> {
103 /// // was disabled for parsing = returns parse-error
112 pub fn from_string(input: proc_macro::TokenStream) -> proc_macro::TokenStream { in from_string()
134 /// #[strum(serialize = "redred")]
143 /// // uses the serialize string for Display
157 pub fn as_ref_str(input: proc_macro::TokenStream) -> proc_macro::TokenStream { in as_ref_str()
178 /// #[strum(serialize_all = "kebab-case")]
185 /// assert_eq!(["red", "blue", "yellow", "rebecca-purple"], Color::VARIANTS);
188 pub fn variant_names(input: proc_macro::TokenStream) -> proc_macro::TokenStream { in variant_names()
202 pub fn as_static_str(input: proc_macro::TokenStream) -> proc_macro::TokenStream { in as_static_str()
218 /// The Rust `std` provides a blanket impl of the reverse direction - i.e. `impl Into<&'static str>…
244 pub fn into_static_str(input: proc_macro::TokenStream) -> proc_macro::TokenStream { in into_static_str()
265 /// #[strum(serialize = "redred")]
274 /// // uses the serialize string for Display
286 pub fn to_string(input: proc_macro::TokenStream) -> proc_macro::TokenStream { in to_string()
302 /// 1. Of the various `serialize` properties, the value with the longest length is chosen. If that
304 /// 1. The name of the variant will be used if there are no `serialize` or `to_string` attributes.
313 /// #[strum(serialize = "redred")]
322 /// // uses the serialize string for Display
336 pub fn display(input: proc_macro::TokenStream) -> proc_macro::TokenStream { in display()
349 /// create [unbounded lifetimes](https://doc.rust-lang.org/nightly/nomicon/unbounded-lifetimes.html…
378 pub fn enum_iter(input: proc_macro::TokenStream) -> proc_macro::TokenStream { in enum_iter()
404 pub fn enum_is(input: proc_macro::TokenStream) -> proc_macro::TokenStream { in enum_is()
412 /// Generated `try_as_*()` methods for all tuple-style variants.
415 /// These methods will only be generated for tuple-style variants, not for named or unit variants.
438 pub fn enum_try_as(input: proc_macro::TokenStream) -> proc_macro::TokenStream { in enum_try_as()
450 /// `from_repr(discriminant: usize) -> Option<YourEnum>` as a standalone function on the enum. For
452 /// data. The discriminant follows the same rules as `rustc`. The first discriminant is zero and ea…
457 /// When the macro is applied using rustc >= 1.46 and when there is no additional data on any of
458 /// the variants, the `from_repr` function is marked `const`. rustc >= 1.46 is required
463 /// create [unbounded lifetimes](https://doc.rust-lang.org/nightly/nomicon/unbounded-lifetimes.html…
507 /// const fn number_from_repr(d: u8) -> Option<Number> {
512 /// # fn number_from_repr(d: u8) -> Option<Number> {
523 pub fn from_repr(input: proc_macro::TokenStream) -> proc_macro::TokenStream { in from_repr()
555 /// #[strum(serialize = "b", serialize = "blue")]
562 /// fn get_message(&self) -> ::core::option::Option<&'static str> {
570 /// fn get_detailed_message(&self) -> ::core::option::Option<&'static str> {
578 /// fn get_documentation(&self) -> ::std::option::Option<&'static str> {
585 /// fn get_serializations(&self) -> &'static [&'static str] {
611 pub fn enum_messages(input: proc_macro::TokenStream) -> proc_macro::TokenStream { in enum_messages()
624 /// experimental in the rustc compiler. The generated code works by nesting match statements.
663 pub fn enum_properties(input: proc_macro::TokenStream) -> proc_macro::TokenStream { in enum_properties()
676 /// an `enum` but one or more of the variants contains a non-`Default` field. `From`
729 /// // Make use of the auto-From conversion to check whether an instance of `MyEnum` matches a
775 pub fn enum_discriminants(input: proc_macro::TokenStream) -> proc_macro::TokenStream { in enum_discriminants()
809 pub fn enum_count(input: proc_macro::TokenStream) -> proc_macro::TokenStream { in enum_count()