An Idempotent implementation which wraps a type that is already
Owning.
Keep has an additional function outside of its use with Idempotent,
which is that it implements Clone. Recall that all types which implement
Clone have a blanket implementation of IntoOwning which is just the
identity function. Contrapositively, therefore, any type with a
non-trivialIntoOwning implementation cannot implement Clone. Usually,
the conversion target of a struct’s or enum’s IntoOwning implementation is
the same struct or enum with different generic parameters. You might wish to
be able to clone such an object after it has already been converted into its
owning form, but this is not possible because it breaks Rust’s rules about
conflicting trait implementations. If you already know you have a type that
IntoOwning (and therefore implements its supertrait ToOwning), then you
can work around this by calling .to_owning() instead of .clone() and
this will do the same thing. However, if you need to pass the object to
something whose generic bounds require a Clone implementation, wrapping it
with Keep can be a convenient solution.