MCPcopy Create free account
hub / github.com/SSheldon/rust-dispatch / once

Method once

src/once.rs:28–35  ·  view source on GitHub ↗
(predicate: *mut dispatch_once_t, work: F)

Source from the content-addressed store, hash-verified

26 #[cold]
27 #[inline(never)]
28 fn once<F>(predicate: *mut dispatch_once_t, work: F)
29 where F: FnOnce() {
30 let mut work = Some(work);
31 let (context, work) = context_and_sync_function(&mut work);
32 unsafe {
33 dispatch_once_f(predicate, context, work);
34 }
35 }
36
37 unsafe {
38 let predicate = self.predicate.get();

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected