mod def { use core::num; use std::net::Ipv4Addr; use std::{cell, string}; #[portrait::make(import( core::num, std::net::Ipv4Addr, std::{cell, string}, ))] pub trait Definition { fn foo() -> i32; fn bar(&self) -> u32; fn qux( &mut self, ip: Ipv4Addr, val: cell::RefMut<'_, (num::NonZeroU8,)>, ) -> std::collections::BTreeSet; type Corge; } } mod user { use crate::def::{definition_portrait, Definition}; struct DefaultUser(T); #[portrait::fill(portrait::default)] impl Definition for DefaultUser { // portrait::default cannot fill types because there is no such thing as "default type". type Corge = Option; } struct DelegateUser { inner: DefaultUser, } #[portrait::fill(portrait::delegate(DefaultUser; self.inner))] impl Definition for DelegateUser {} } fn main() {}