Skip to main content

osom_lib_try_clone/
traits.rs

1/// A trait for types that can be cloned with a result.
2pub trait TryClone: Sized {
3    type Error: core::fmt::Debug;
4
5    /// Tries to clone the type.
6    ///
7    /// # Errors
8    ///
9    /// Returns the error if the clone fails for whatever reason.
10    fn try_clone(&self) -> Result<Self, Self::Error>;
11}