Skip to main content

with_fields

Function with_fields 

Source
pub fn with_fields<T>(
    overrides: &[(usize, u64)],
    build: impl FnOnce() -> T,
) -> (T, Vec<Field>)
Expand description

Runs build on this thread with each field it writes numbered from 0 in write order: field n is written as v where overrides holds (n, v) (its low width bytes), and as given otherwise. Returns what build returned and every field it wrote, with the value it was given. A nested call runs its build with a numbering of its own.