Skip to main content

derive_deftly_template_SomeMockRuntime

Macro derive_deftly_template_SomeMockRuntime 

Source
macro_rules! derive_deftly_template_SomeMockRuntime {
    ({ $($driver:tt)* } [$($aoptions:tt)*] ($($future:tt)*) $($tpassthrough:tt)*) => { ... };
    ($($wrong:tt)*) => { ... };
}
Expand description

Implements Runtime for a struct made of multiple sub-providers

The type must be a struct containing field(s) which implement SleepProvider, NetProvider, etc.

The corresponding fields must be decorated with:

  • #[deftly(mock(task))] to indicate the field implementing Spawn + BlockOn
  • #[deftly(mock(net))] to indicate the field implementing NetProvider
  • #[deftly(mock(sleep))] to indicate the field implementing SleepProvider and CoarseTimeProvider.
  • #[deftly(mock(toplevel))] to indicate the field implementing ToplevelBlockOn unconditionally.
  • #[deftly(mock(toplevel_where = "BOUND"))] to indicate the field implementing ToplevelBlockOn only if BOUND is satisfied. For example, #[deftly(mock(toplevel_where = "R: ToplevelBlockOn"))] runtime: R,.

This is a derive_deftly template. Do not invoke it directly. To use it, write: #[derive(Deftly)] #[derive_deftly(SomeMockRuntime)].