aya-friday-obj 0.2.2

An eBPF object file parsing library with BTF and relocation support.
Documentation
1
2
3
4
5
6
7
use core::{ptr, slice};
pub(crate) use std::collections::{HashMap, HashSet};

/// Converts a <T> to a byte slice.
pub(crate) const unsafe fn bytes_of<T>(val: &T) -> &[u8] {
    unsafe { slice::from_raw_parts(ptr::from_ref(val).cast(), size_of_val(val)) }
}