interface_test

Attribute Macro interface_test 

Source
#[interface_test]
Expand description

Marks a test as defining an interface.

This macro generates a proof type that implementations must consume. Without this test existing, implementations cannot compile.

§Example

// In tests/cpu_interface.rs
#[interface_test(CpuMetrics)]
fn test_cpu_metrics_has_frequency() {
    let metrics = CpuMetrics::default();
    let _freq: u64 = metrics.frequency; // Defines the interface
}

// In src/cpu.rs - this line requires the test to exist:
use crate::tests::cpu_interface::CpuMetricsInterfaceProof;