magnet_derive 0.8.0

Magnet, a JSON/BSON schema generator
Documentation
1
2
3
4
5
6
7
8
9
10
//! For the time being, `BsonSchema` can't be automatically derived for a `union`.

use syn::{ Attribute, DataUnion };
use proc_macro2::TokenStream;
use error::{ Error, Result };

/// Implements `BsonSchema` for a `union`.
pub fn impl_bson_schema_union(_: Vec<Attribute>, _: DataUnion) -> Result<TokenStream> {
    Err(Error::new("`BsonSchema` can't be implemented for unions"))
}