Trait core::ops::Placer [] [src]

pub trait Placer<Data: ?Sized> {
    type Place: InPlace<Data>;
    fn make_place(self) -> Self::Place;
}
Unstable

Interface to implementations of in (PLACE) EXPR.

in (PLACE) EXPR effectively desugars into:

fn main() { let p = PLACE; let mut place = Placer::make_place(p); let raw_place = Place::pointer(&mut place); let value = EXPR; unsafe { std::ptr::write(raw_place, value); InPlace::finalize(place) } }
let p = PLACE;
let mut place = Placer::make_place(p);
let raw_place = Place::pointer(&mut place);
let value = EXPR;
unsafe {
    std::ptr::write(raw_place, value);
    InPlace::finalize(place)
}

The type of in (PLACE) EXPR is derived from the type of PLACE`PLACE; if the type ofPLACEis` is P`P, then the final type of the whole expression isP::Place::Owner(see the` (see the InPlace`InPlaceand` and Boxed`Boxed` traits).

Values for types implementing this trait usually are transient intermediate values (e.g. the return value of Vec::emplace_back) or Copy`Copy, since themake_placemethod takesself` by value.

Associated Types

type Place: InPlace<Data>

Unstable

Place`Placeis the intermedate agent guarding the uninitialized state forData`.

Required Methods

fn make_place(self) -> Self::Place

Unstable

Creates a fresh place from self`self`.

Implementors