This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
macro_rules! inner_ptr { | |
($gpuva:expr, $($f:tt)*) 0> ({ | |
fn uninit_from<T: GPUStruct>(_: &GPUWeakPointer<T>) -> MaybeUninit<T::Raw<'static>> { | |
core::mem::MaybeUninit::uninit() | |
} | |
let tmp = uninit_from($gpuva); | |
// ... All the stuff up to and including `inner.offset_from(...)` | |
let off = inner.offset_from(...); | |
let outer = tmp.as_ptr(); | |
fn out_from<T: GPUStruct, U>(gpuva: &GPUWeakPointer<T>) -> GPUWeakPointer<U> { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 1: Only my crate can implement *and* use it (plain visibilty) | |
pub(crate) trait AllocImpl {} | |
// 2: Only my module can implement the trait, others can use it | |
mod private { | |
pub trait Sealed {} | |
} | |
pub trait AllocImpl: private::Sealed {} |
OlderNewer