sob 0.0.1

Serializable Owned/Borrow. `Cow`-like type with no `Clone` requirement, implements Serialize and Deserialize
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#[cfg(feature = "serde")]
pub mod serde;

/// Serializable Owned/Borrowed.
///
/// A type representing borrowed or owned data, similar to `Cow`, but without the requirement
/// that the inner type must implement the `Clone` trait, making it easily serializable and deserializable.
#[derive(Debug, PartialEq, Eq, Clone, Hash)]
pub enum Sob<'a, T> {
    /// Borrowed data.
    Borrowed(&'a T),
    /// Owned data.
    Owned(T),
}