osom_lib_test_macros/traits/pointerable.rs
1/// An object implementing this trait can be converted to a raw mut pointer.
2///
3/// # Safety
4///
5/// This trait doesn't impose any safety guarantees on the returned pointer,
6/// it is up to the caller to ensure that the object is valid
7/// and that the pointer is used correctly. In particular no lifetime checks
8/// are performed.
9pub unsafe trait Pointerable {
10 /// Reinterprets `&self` as `*mut u8`.
11 ///
12 /// # Safety
13 ///
14 /// This function is unsafe because it allows converting an object to a pointer.
15 /// The caller must ensure that the object is valid and that the pointer is
16 /// used correctly. In particular no lifetime checks are performed.
17 unsafe fn as_ptr(&self) -> *mut u8;
18}