2 releases

0.1.1 Oct 6, 2020
0.1.0 Sep 28, 2020

#580 in Memory management

Download history 17/week @ 2024-07-20 23/week @ 2024-07-27 27/week @ 2024-08-03 355/week @ 2024-08-10 198/week @ 2024-08-17 390/week @ 2024-08-24 26/week @ 2024-08-31 189/week @ 2024-09-07 32/week @ 2024-09-14 24/week @ 2024-09-21 29/week @ 2024-09-28 5/week @ 2024-10-05 17/week @ 2024-10-12 83/week @ 2024-10-19 53/week @ 2024-10-26 33/week @ 2024-11-02

186 downloads per month
Used in 4 crates (via ufotofu)

CC-PDDC license

7KB
112 lines

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.


lib.rs:

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.

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.

Dependencies

~8KB