Skip to main content

with_context

Function with_context 

Source
pub fn with_context<F, R>(f: F) -> Option<R>
where F: FnOnce(&ComputeContext) -> R,
Expand description

Access the thread-local compute context

Returns None if called from a non-worker thread or if context wasn’t initialized