darling_core 0.1.3

Helper crate for proc-macro library for reading attributes into structs when implementing custom derives. Use https://crates.io/crates/darling in your code.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use syn::Variant;

use Result;

/// Creates an instance from a specified `syn::Variant`.
pub trait FromVariant: Sized {
    /// Create an instance from `syn::Variant`, or return an error.
    fn from_variant(variant: &Variant) -> Result<Self>;
}

impl FromVariant for Variant {
    fn from_variant(variant: &Variant) -> Result<Self> {
        Ok(variant.clone())
    }
}