Skip to main content

Conformance

Trait Conformance 

Source
pub trait Conformance: Send + Sync {
    // Required method
    fn commit(seed: u64) -> impl Future<Output = Vec<u8>> + Send;
}
Expand description

Trait for types that can produce deterministic bytes for conformance testing.

Implementations must be deterministic: the same seed must always produce the same output across runs and platforms.

§Example

use commonware_conformance::Conformance;

struct MyConformance;

impl Conformance for MyConformance {
    async fn commit(seed: u64) -> Vec<u8> {
        // Generate deterministic bytes from the seed
        seed.to_le_bytes().to_vec()
    }
}

Required Methods§

Source

fn commit(seed: u64) -> impl Future<Output = Vec<u8>> + Send

Produce deterministic bytes from a seed for conformance testing.

The implementation should use the seed to generate deterministic test data and return a byte vector representing the commitment.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§