pub struct ShapeRef(pub fn() -> &'static Shape);Expand description
A lazy reference to a Shape via a function pointer.
All shape references use function pointers to enable lazy evaluation, which moves const evaluation overhead from compile time to runtime. This significantly improves compile times for large codebases.
The function is typically a monomorphized generic function like:
ⓘ
fn shape_of<T: Facet>() -> &'static Shape { T::SHAPE }Tuple Fields§
§0: fn() -> &'static ShapeImplementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ShapeRef
impl RefUnwindSafe for ShapeRef
impl Send for ShapeRef
impl Sync for ShapeRef
impl Unpin for ShapeRef
impl UnwindSafe for ShapeRef
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more