feature_gated_source_mod

Macro feature_gated_source_mod 

Source
macro_rules! feature_gated_source_mod {
    ($mod_name:ident, $source_name:literal) => { ... };
    ($mod_name:ident, $struct_prefix:ident, $source_name:literal) => { ... };
}
Expand description

Define a source module that is gated by a feature.

This is to allow some heavy or unpopular source implementations (and their dependencies) to be disabled at compile time, in order to decrease compilation time and binary size.

When the feature is disabled, this macro generates standalone dummy implementations for the source, which return errors indicating the feature is not enabled. The generated types are concrete structs (not type aliases) to avoid conflicts with macro-generated TryFrom/From impls in impl_split.