pub struct Slot<'s> { /* private fields */ }Expand description
A carved component-pool slot: slot_bytes of 8-aligned storage for one
type-erased TypedSlot<C>.
The slot outlives every closure that dispatches through it because the
BACKING is 'static — which is the point of W5, and why the
Arc<ComponentCell> refcount that currently proves that lifetime becomes
unnecessary.
Implementations§
Source§impl Slot<'_>
impl Slot<'_>
Sourcepub fn fits<T>(&self) -> bool
pub fn fits<T>(&self) -> bool
Whether T fits this slot, in both size and alignment.
A false here is a REGISTRATION error, not a compile error: the pool is
heterogeneous and the FFI seam cannot name a generic. Callers surface it
as “raise NROS_RUNTIME_COMPONENT_SLOT_BYTES”.
Sourcepub fn as_mut_ptr(&mut self) -> *mut u8
pub fn as_mut_ptr(&mut self) -> *mut u8
Pointer to the slot’s storage, for an in-place write of TypedSlot<C>.
Auto Trait Implementations§
impl<'s> !UnwindSafe for Slot<'s>
impl<'s> Freeze for Slot<'s>
impl<'s> RefUnwindSafe for Slot<'s>
impl<'s> Send for Slot<'s>
impl<'s> Sync for Slot<'s>
impl<'s> Unpin for Slot<'s>
impl<'s> UnsafeUnpin for Slot<'s>
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