pub trait ToShmem: Sized {
// Required method
fn to_shmem(&self, builder: &mut SharedMemoryBuilder) -> Result<Self>;
}
Expand description
A type that can be copied into a SharedMemoryBuilder.
Required Methods§
Sourcefn to_shmem(&self, builder: &mut SharedMemoryBuilder) -> Result<Self>
fn to_shmem(&self, builder: &mut SharedMemoryBuilder) -> Result<Self>
Clones this value into a form suitable for writing into a SharedMemoryBuilder.
If this value owns any heap allocations, they should be written into
builder
so that the return value of this function can point to the
copy in the shared memory buffer.
The return type is wrapped in ManuallyDrop to make it harder to accidentally invoke the destructor of the value that is produced.
Returns a Result so that we can gracefully recover from unexpected content.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.