Trait to_shmem::ToShmem

source ·
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§

source

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.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl ToShmem for TokenSerializationType

source§

fn to_shmem(&self, _builder: &mut SharedMemoryBuilder) -> Result<Self>

source§

impl ToShmem for bool

source§

fn to_shmem(&self, _builder: &mut SharedMemoryBuilder) -> Result<Self>

source§

impl ToShmem for f32

source§

fn to_shmem(&self, _builder: &mut SharedMemoryBuilder) -> Result<Self>

source§

impl ToShmem for f64

source§

fn to_shmem(&self, _builder: &mut SharedMemoryBuilder) -> Result<Self>

source§

impl ToShmem for i8

source§

fn to_shmem(&self, _builder: &mut SharedMemoryBuilder) -> Result<Self>

source§

impl ToShmem for i16

source§

fn to_shmem(&self, _builder: &mut SharedMemoryBuilder) -> Result<Self>

source§

impl ToShmem for i32

source§

fn to_shmem(&self, _builder: &mut SharedMemoryBuilder) -> Result<Self>

source§

impl ToShmem for i64

source§

fn to_shmem(&self, _builder: &mut SharedMemoryBuilder) -> Result<Self>

source§

impl ToShmem for isize

source§

fn to_shmem(&self, _builder: &mut SharedMemoryBuilder) -> Result<Self>

source§

impl ToShmem for u8

source§

fn to_shmem(&self, _builder: &mut SharedMemoryBuilder) -> Result<Self>

source§

impl ToShmem for u16

source§

fn to_shmem(&self, _builder: &mut SharedMemoryBuilder) -> Result<Self>

source§

impl ToShmem for u32

source§

fn to_shmem(&self, _builder: &mut SharedMemoryBuilder) -> Result<Self>

source§

impl ToShmem for u64

source§

fn to_shmem(&self, _builder: &mut SharedMemoryBuilder) -> Result<Self>

source§

impl ToShmem for ()

source§

fn to_shmem(&self, _builder: &mut SharedMemoryBuilder) -> Result<Self>

source§

impl ToShmem for usize

source§

fn to_shmem(&self, _builder: &mut SharedMemoryBuilder) -> Result<Self>

source§

impl ToShmem for SourceLocation

source§

fn to_shmem(&self, _builder: &mut SharedMemoryBuilder) -> Result<Self>

source§

impl ToShmem for SourcePosition

source§

fn to_shmem(&self, _builder: &mut SharedMemoryBuilder) -> Result<Self>

source§

impl ToShmem for UnicodeRange

source§

fn to_shmem(&self, _builder: &mut SharedMemoryBuilder) -> Result<Self>

source§

impl ToShmem for SmallBitVec

source§

fn to_shmem(&self, builder: &mut SharedMemoryBuilder) -> Result<Self>

source§

impl ToShmem for Box<str>

source§

fn to_shmem(&self, builder: &mut SharedMemoryBuilder) -> Result<Self>

source§

impl ToShmem for CString

source§

fn to_shmem(&self, builder: &mut SharedMemoryBuilder) -> Result<Self>

source§

impl ToShmem for String

source§

fn to_shmem(&self, builder: &mut SharedMemoryBuilder) -> Result<Self>

source§

impl ToShmem for NonZeroUsize

source§

fn to_shmem(&self, _builder: &mut SharedMemoryBuilder) -> Result<Self>

source§

impl<A: 'static, B: 'static> ToShmem for ArcUnion<A, B>
where Arc<A>: ToShmem, Arc<B>: ToShmem,

source§

fn to_shmem(&self, builder: &mut SharedMemoryBuilder) -> Result<Self>

source§

impl<H: ToShmem, T: ToShmem> ToShmem for Arc<HeaderSlice<H, T>>

source§

fn to_shmem(&self, builder: &mut SharedMemoryBuilder) -> Result<Self>

source§

impl<Static: StaticAtomSet> ToShmem for Atom<Static>

source§

fn to_shmem(&self, _: &mut SharedMemoryBuilder) -> Result<Self>

source§

impl<T> ToShmem for PhantomData<T>

source§

fn to_shmem(&self, _builder: &mut SharedMemoryBuilder) -> Result<Self>

source§

impl<T: ToShmem> ToShmem for Option<T>

source§

fn to_shmem(&self, builder: &mut SharedMemoryBuilder) -> Result<Self>

source§

impl<T: ToShmem> ToShmem for Arc<T>

source§

fn to_shmem(&self, builder: &mut SharedMemoryBuilder) -> Result<Self>

source§

impl<T: ToShmem> ToShmem for ThinVec<T>

source§

fn to_shmem(&self, builder: &mut SharedMemoryBuilder) -> Result<Self>

source§

impl<T: ToShmem> ToShmem for Box<[T]>

source§

fn to_shmem(&self, builder: &mut SharedMemoryBuilder) -> Result<Self>

source§

impl<T: ToShmem> ToShmem for Box<T>

source§

fn to_shmem(&self, builder: &mut SharedMemoryBuilder) -> Result<Self>

source§

impl<T: ToShmem> ToShmem for Vec<T>

source§

fn to_shmem(&self, builder: &mut SharedMemoryBuilder) -> Result<Self>

source§

impl<T: ToShmem> ToShmem for Wrapping<T>

source§

fn to_shmem(&self, builder: &mut SharedMemoryBuilder) -> Result<Self>

source§

impl<T: ToShmem> ToShmem for Range<T>

source§

fn to_shmem(&self, builder: &mut SharedMemoryBuilder) -> Result<Self>

source§

impl<T: ToShmem, A: Array<Item = T>> ToShmem for SmallVec<A>

source§

fn to_shmem(&self, builder: &mut SharedMemoryBuilder) -> Result<Self>

source§

impl<T: ToShmem, S> ToShmem for HashSet<T, S>
where Self: Default,

source§

fn to_shmem(&self, _builder: &mut SharedMemoryBuilder) -> Result<Self>

source§

impl<T: ToShmem, U: ToShmem> ToShmem for (T, U)

source§

fn to_shmem(&self, builder: &mut SharedMemoryBuilder) -> Result<Self>

Implementors§