devela::_dep::rkyv::ser::sharing

Trait SharingExt

pub trait SharingExt<E>: Sharing<E> {
    // Provided method
    fn serialize_shared<T>(&mut self, value: &T) -> Result<usize, Self::Error> 
       where T: SerializeUnsized<Self> + ?Sized,
             Self: Fallible<Error = E>,
             E: Source { ... }
}
Available on crate feature dep_rkyv only.
Expand description

Helper methods for Sharing.

Provided Methods§

fn serialize_shared<T>(&mut self, value: &T) -> Result<usize, Self::Error>
where T: SerializeUnsized<Self> + ?Sized, Self: Fallible<Error = E>, E: Source,

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

Returns an error if cyclic shared pointers are encountered.

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.

Implementors§

§

impl<S, E> SharingExt<E> for S
where S: Sharing<E> + ?Sized,