Skip to main content

batch_impl_only

Attribute Macro batch_impl_only 

Source
#[batch_impl_only]
Expand description

#[batch_impl] 相同,但丢弃 trait 定义本身,只输出 impl 块。

用于 trait 已在别处定义、只需批量生成 impl 的场景。 语法与 #[batch_impl] 完全一致。

§示例

trait Greet { fn hello(&self) -> &str; }

#[batch_impl_only(usize #hello{"hi"})]
trait Greet {}  // 此 trait 定义被丢弃,不影响已有的定义