pub unsafe trait Emplace<T: DropRaw + Pointee + ?Sized, R: Region> {
fn emplaced_meta(&self) -> <T as Pointee>::Metadata;
unsafe fn emplace_unsized_unchecked(self, out: In<Slot<'_, T>, R>);
}
Expand description
A value emplacer.
Safety
emplaced_meta
must return valid metadata for the value emplaced withemplace_unsized_unchecked
.emplace_unsized_unchecked
must initialize itsout
parameter.
Required Methods
sourcefn emplaced_meta(&self) -> <T as Pointee>::Metadata
fn emplaced_meta(&self) -> <T as Pointee>::Metadata
Returns the metadata of the T
that this emplaces.
For sized T
, this is always ()
.
sourceunsafe fn emplace_unsized_unchecked(self, out: In<Slot<'_, T>, R>)
unsafe fn emplace_unsized_unchecked(self, out: In<Slot<'_, T>, R>)
Emplaces a value into a given slot within some memory region.
Safety
out
must have the metadata returned by emplaced_meta
.