pub unsafe trait CloneableCart: Clone { }
Expand description

This trait marks cart types that do not change source on cloning

This is conceptually similar to stable_deref_trait::CloneStableDeref, however stable_deref_trait::CloneStableDeref is not (and should not) be implemented on Option (since it’s not Deref). CloneableCart essentially is “if there is data to borrow from here, cloning the cart gives you an additional handle to the same data”.

Safety

This trait is safe to implement StableDeref types which, once Cloned, point to the same underlying data.

(This trait is also implemented on Option<T> and (), which are the two non-StableDeref cart types that Yokes can be constructed for)

Implementations on Foreign Types

Implementors