Trait std::ops::Placer
[−]
[src]
pub trait Placer<Data> where Data: ?Sized {
type Place: InPlace<Data>;
fn make_place(self) -> Self::Place;
}
Interface to implementations of in (PLACE) EXPR
.
in (PLACE) EXPR
effectively desugars into:
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 of
PLACEis
` is P
`P, then the final type of the whole expression is
P::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 the
make_placemethod takes
self` by value.
Associated Types
type Place: InPlace<Data>
Place
`Placeis the intermedate agent guarding the uninitialized state for
Data`.
Required Methods
Implementors
impl<T> Placer<T> for ExchangeHeapSingleton