pub struct EnumOptions {
pub variant_casing: Casing,
pub content_prop_name: Option<String>,
pub tag_prop_name: Option<String>,
pub untagged: bool,
pub rust_module: Option<String>,
}Fields§
§variant_casing: Casing§content_prop_name: Option<String>§tag_prop_name: Option<String>§untagged: boolIf true, serialized variants are not tagged, and a match is found
by attempting to deserialize variants in order, where the first one to
successfully deserialize is used as the result.
rust_module: Option<String>Rust module path where the type can be found for the given generator. If present, the generator can use this type instead of generating it.
§Example:
#[fp(rust_module = "my_crate")]
enum MyEnum { /* ... */ }This will set "my_crate" as the rust_module, to
be used by the Rust plugin generator to generate a use statement such
as:
pub use my_crate::MyEnum;Instead of generating the enum definition itself.
Implementations§
Source§impl EnumOptions
impl EnumOptions
pub fn from_attrs(attrs: &[Attribute]) -> Self
pub fn to_serde_attrs(&self) -> Vec<String>
Trait Implementations§
Source§impl Clone for EnumOptions
impl Clone for EnumOptions
Source§fn clone(&self) -> EnumOptions
fn clone(&self) -> EnumOptions
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for EnumOptions
impl Debug for EnumOptions
Source§impl Default for EnumOptions
impl Default for EnumOptions
Source§fn default() -> EnumOptions
fn default() -> EnumOptions
Returns the “default value” for a type. Read more
Source§impl Hash for EnumOptions
impl Hash for EnumOptions
Source§impl Parse for EnumOptions
impl Parse for EnumOptions
fn parse(input: ParseStream<'_>) -> Result<Self>
Source§impl PartialEq for EnumOptions
impl PartialEq for EnumOptions
impl Eq for EnumOptions
impl StructuralPartialEq for EnumOptions
Auto Trait Implementations§
impl Freeze for EnumOptions
impl RefUnwindSafe for EnumOptions
impl Send for EnumOptions
impl Sync for EnumOptions
impl Unpin for EnumOptions
impl UnwindSafe for EnumOptions
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.