1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use crate::ser::Sharing;

/// A shared pointer strategy that duplicates serializations of the same shared
/// pointer.
#[derive(Debug, Default)]
pub struct Duplicate;

impl<E> Sharing<E> for Duplicate {
    fn get_shared_ptr(&self, _: usize) -> Option<usize> {
        None
    }

    fn add_shared_ptr(&mut self, _: usize, _: usize) -> Result<(), E> {
        Ok(())
    }
}