MCPcopy Create free account
hub / github.com/Bloom-Engine/engine / register

Method register

native/shared/src/frame_callbacks.rs:36–47  ·  view source on GitHub ↗

Register a callback with a priority. Returns an ID for removal. Lower priority numbers run first (matching R3F convention).

(&mut self, priority: i32, callback: extern "C" fn(f64))

Source from the content-addressed store, hash-verified

34 /// Register a callback with a priority. Returns an ID for removal.
35 /// Lower priority numbers run first (matching R3F convention).
36 pub fn register(&mut self, priority: i32, callback: extern "C" fn(f64)) -> u64 {
37 let id = self.next_id;
38 self.next_id += 1;
39 self.callbacks.push(FrameCallback {
40 priority,
41 callback,
42 active: true,
43 });
44 self.ids.push(id);
45 self.sorted = false;
46 id
47 }
48
49 /// Unregister a callback by ID.
50 pub fn unregister(&mut self, id: u64) {

Calls 1

pushMethod · 0.45

Tested by

no test coverage detected