rkyv/ser/sharing/core.rs
1use crate::ser::{sharing::SharingState, Sharing};
2
3/// A shared pointer strategy that duplicates serializations of the same shared
4/// pointer.
5#[derive(Debug, Default)]
6pub struct Unshare;
7
8impl<E> Sharing<E> for Unshare {
9 fn start_sharing(&mut self, _: usize) -> SharingState {
10 SharingState::Started
11 }
12
13 fn finish_sharing(&mut self, _: usize, _: usize) -> Result<(), E> {
14 Ok(())
15 }
16}