Macro cynic::impl_scalar

source ยท
macro_rules! impl_scalar {
    ($type:path, $type_lock:ident) => { ... };
    ($type:path, $type_lock_segment:ident $(:: $type_lock_rest :ident)::+) => { ... };
    ($type:path, $type_lock_segment:ident $(:: $type_lock_rest :ident)::+, $schema_module:ident $(:: $schema_module_rest : ident)*) => { ... };
    ($type:path, $type_lock:ident, $schema_module:ident $(:: $schema_module_rest : ident)*) => { ... };
}
Expand description

Implements a set of scalar traits for the given type & type lock.

For example, to use uuid::Uuid for a Uuid type defined in a schema:

impl_scalar!(uuid::Uuid, schema::UUID);

This macro can be used on any type that implements serde::Serialize, provided the schema is defined in the current crate