logo
pub trait SharedSerializeRegistry: Fallible {
    fn get_shared_ptr(&self, value: *const u8) -> Option<usize>;
fn add_shared_ptr(
        &mut self,
        value: *const u8,
        pos: usize
    ) -> Result<(), Self::Error>; fn get_shared<T: ?Sized>(&self, value: &T) -> Option<usize> { ... }
fn add_shared<T: ?Sized>(
        &mut self,
        value: &T,
        pos: usize
    ) -> Result<(), Self::Error> { ... }
fn serialize_shared<T: SerializeUnsized<Self> + ?Sized>(
        &mut self,
        value: &T
    ) -> Result<usize, Self::Error>
    where
        Self: Serializer
, { ... } }
Expand description

A registry that tracks serialized shared memory.

This trait is required to serialize shared pointers.

Required methods

Gets the position of a previously-added shared pointer.

Returns None if the pointer has not yet been added.

Adds the position of a shared pointer to the registry.

Provided methods

Gets the position of a previously-added shared value.

Returns None if the value has not yet been added.

Adds the position of a shared value to the registry.

Archives the given shared value and returns its position. If the value has already been added then it returns the position of the previously added value.

Implementors