pub struct SharedBuf { /* private fields */ }Expand description
A borrowed view of the host’s shared-data buffer for the current call, or none (in which case shared access falls back to the slot model).
The type is not Send/Sync (a NonNull field), matching the
single-threaded virtual machine. It owns no memory; the host owns the
buffer and outlives the borrow.
Implementations§
Sourcepub fn new() -> Self
pub fn new() -> Self
An inactive buffer. Shared access uses the slot model until set is
called with a non-empty buffer.
Sourcepub fn set(&mut self, buf: &mut [u8])
pub fn set(&mut self, buf: &mut [u8])
Capture the host buffer for the current call.
An empty slice is treated as “no buffer”: the buffer goes inactive and
the caller routes shared access to the slot model. This is the
coexistence path for hosts that drive the virtual machine through the
plain call/resume and populate shared slots through set_data.
Sourcepub fn clear(&mut self)
pub fn clear(&mut self)
Release the borrowed buffer. The virtual machine calls this before the
call_with_shared/resume_with_shared entry point returns, so a stale
pointer is never observable.
Trait Implementations§
Auto Trait Implementations§
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
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
Source§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out indicating that a T is niched.