cloneless_cow

Crates.iocloneless_cow
lib.rscloneless_cow
version0.1.1
sourcesrc
created_at2024-11-17 05:49:40.782733
updated_at2024-11-17 06:02:31.907909
descriptionA greatly-reduced implementation of Cow that does not require T to be Clone but allows for storing either a reference or an owned instance for future needs of references to T.
homepage
repositoryhttps://github.com/AustinHellerRepo/cloneless_cow
max_upload_size
id1450910
size16,064
(AustinHellerRepo)

documentation

README

Cloneless Cow

Allows for the storage of a reference or owned instance of a generic type T.

Features

  • Convenient storage of a reference or owned instance, even (and especially) for types that do not implement Clone

  • Able to access the instance reference via .as_ref()

Limitations

  • Impossible to clone T directly out of the instance or get back the owned T
    • This feature of Cow is also a limitation of Cow which this crate does not suffer from, as Cow requires T to implement the Clone trait when you may only want access to a reference of T
Commit count: 2

cargo fmt