wrapper 0.1.1

A trait for types that wrap other types.
Documentation
  • Coverage
  • 100%
    3 out of 3 items documented0 out of 2 items with examples
  • Size
  • Source code size: 13.57 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 858.16 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 10s Average build duration of successful builds.
  • all releases: 10s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • AljoschaMeyer/wrapper-rs
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • AljoschaMeyer icanvardar

Wrapper

A Wrapper is a value which took ownership of some of the value, such that the wrapped value can later be retrieved again. Conceptually this is identical to the regular Into trait, but that trait is hard to implement because of conflicts with the reflexive blanket implementation.

/// A type that wraps a value of type `Inner` that can be retrieved via `into_inner`.
pub trait Wrapper<Inner> {
    /// Retrieve ownership of the wrapped value.
    fn into_inner(self) -> Inner;
}

Feature Flags

By default, this crate only provides implementations for types in core. The alloc feature enables implementations for types in alloc, likewise std for std. Implementations for unstable types are enabled with the unstable feature.