devela::_dep::rkyv::ser

Trait Sharing

pub trait Sharing<E = <Self as Fallible>::Error> {
    // Required methods
    fn start_sharing(&mut self, address: usize) -> SharingState;
    fn finish_sharing(&mut self, address: usize, pos: usize) -> Result<(), E> ;
}
Available on crate feature dep_rkyv only.
Expand description

A shared pointer serialization strategy.

This trait is required to serialize Rc and Arc.

Required Methods§

fn start_sharing(&mut self, address: usize) -> SharingState

Starts sharing the value associated with the given address.

fn finish_sharing(&mut self, address: usize, pos: usize) -> Result<(), E>

Finishes sharing the value associated with the given address.

Returns an error if the given address was not pending.

Implementations on Foreign Types§

§

impl<T, E> Sharing<E> for &mut T
where T: Sharing<E> + ?Sized,

§

fn start_sharing(&mut self, address: usize) -> SharingState

§

fn finish_sharing(&mut self, address: usize, pos: usize) -> Result<(), E>

Implementors§

§

impl<E> Sharing<E> for Share
where E: Source,

§

impl<E> Sharing<E> for Unshare

§

impl<T, E> Sharing<E> for Strategy<T, E>
where T: Sharing<E> + ?Sized,

§

impl<W, A, S, E> Sharing<E> for Serializer<W, A, S>
where S: Sharing<E>,