try-clone 0.2.0

Fallible cloning.
Documentation
  • Coverage
  • 100%
    11 out of 11 items documented0 out of 7 items with examples
  • Size
  • Source code size: 20.1 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 691.54 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 6s Average build duration of successful builds.
  • all releases: 5s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • OpenByteDev/try-clone
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • OpenByteDev

try-clone

CI crates.io Documentation dependency status MIT

Fallible cloning.

This crate defines TryClone, a small trait for types whose cloning operation can fail. Unlike Clone, which is infallible by design, TryClone returns a Result to allow implementations to report errors.

Implementations are provided for standard library types that expose a try_clone API, such as File, as well as for common containers and collections (Box, Arc, Vec, ...) where appropriate APIs exists.

A blanket implementation is available behind the blanket-impl feature, which implements TryClone for all Clone types.

License

Licensed under the MIT license (LICENSE or http://opensource.org/licenses/MIT)