pub const fn assert_contract<P, T>()Expand description
Force preset and parts output types to match during macro expansion. 在宏展开时强制 preset 与 parts 的输出类型相同。
ⓘ
use nichlink::{assert_contract, PartsContract, PresetContract};
struct Expected;
struct Supplied;
impl PresetContract for Expected {
type Output = Expected;
const REQUIRED_PARTS: &'static [&'static str] = &[];
}
impl PartsContract for Supplied {
type Output = Supplied;
const PROVIDED_PARTS: &'static [&'static str] = &[];
}
const _: () = assert_contract::<Expected, Supplied>();