Struct devise::DeriveGenerator
source · pub struct DeriveGenerator {
pub input: ItemInput,
pub item: TraitItem,
pub support: Support,
pub validator: Option<Box<dyn Validator + 'static, Global>>,
pub inner_mappers: Vec<Box<dyn Mapper + 'static, Global>, Global>,
pub outer_mappers: Vec<Box<dyn Mapper + 'static, Global>, Global>,
pub type_bound_mapper: Option<Box<dyn Mapper + 'static, Global>>,
/* private fields */
}
Fields§
§input: ItemInput
§item: TraitItem
§support: Support
§validator: Option<Box<dyn Validator + 'static, Global>>
§inner_mappers: Vec<Box<dyn Mapper + 'static, Global>, Global>
§outer_mappers: Vec<Box<dyn Mapper + 'static, Global>, Global>
§type_bound_mapper: Option<Box<dyn Mapper + 'static, Global>>
Implementations§
source§impl DeriveGenerator
impl DeriveGenerator
pub fn build_for<I, T>(input: I, trait_impl: T) -> DeriveGeneratorwhere I: Into<TokenStream>, T: ToTokens,
pub fn support(&mut self, support: Support) -> &mut DeriveGenerator
pub fn type_bound<B>(&mut self, bound: B) -> &mut DeriveGeneratorwhere B: ToTokens,
sourcepub fn replace_generic(
&mut self,
trait_gen: usize,
impl_gen: usize
) -> &mut DeriveGenerator
pub fn replace_generic( &mut self, trait_gen: usize, impl_gen: usize ) -> &mut DeriveGenerator
Take the 0-indexed trait_gen
th generic in the generics in impl<..>
being built and substitute those tokens in place of the 0-indexed
impl_gen
th generic of the same kind in the input type.