rustmeter_beacon_core/
lib.rs1#![cfg_attr(not(feature = "std"), no_std)]
2
3pub mod buffer;
4pub mod protocol;
5pub mod time_delta;
6pub mod tracing;
7pub mod varint;
8
9#[cfg(test)]
10pub mod mocks;
11
12#[inline(always)]
13pub fn compressed_task_id(task_id: u32) -> u16 {
14 let shifted = task_id >> 2;
17
18 let folded = (shifted ^ (shifted >> 16)) as u16;
21
22 folded
23}
24
25unsafe extern "Rust" {
26 pub fn get_current_core_id() -> u8;
27}
28
29#[cfg(feature = "std")]
30mod std_core_id {
31 #[unsafe(no_mangle)]
32 unsafe fn get_current_core_id() -> u8 {
33 0
34 }
35}