#[batch_impl_only]
与 #[batch_impl] 相同,但丢弃 trait 定义本身,只输出 impl 块。
#[batch_impl]
impl
用于 trait 已在别处定义、只需批量生成 impl 的场景。 语法与 #[batch_impl] 完全一致。
trait Greet { fn hello(&self) -> &str; } #[batch_impl_only(usize #hello{"hi"})] trait Greet {} // 此 trait 定义被丢弃,不影响已有的定义