Trait Ctx

Source
pub trait Ctx:
    Send
    + Sync
    + 'static {
    type Config: SetupData + Default;
    type Setup: SetupData;

    // Required method
    fn setup(
        config: &Self::Config,
    ) -> impl Future<Output = Result<Self::Setup>> + Send;

    // Provided method
    fn round_label(_config: &Self::Config, _round: u32) -> Option<String> { ... }
}

Required Associated Types§

Required Methods§

Source

fn setup( config: &Self::Config, ) -> impl Future<Output = Result<Self::Setup>> + Send

Runs once for each simulation environment.

Provided Methods§

Source

fn round_label(_config: &Self::Config, _round: u32) -> Option<String>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl Ctx for ()

Source§

type Config = ()

Source§

type Setup = ()

Source§

async fn setup(_config: &Self::Config) -> Result<Self::Setup>

Implementors§