# Trait std::ops::Placer [−] [src]

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

🔬 This is a nightly-only experimental API. (`placement_new_protocol` #27779)

Interface to implementations of `PLACE <- EXPR`.

`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)
    }Run

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

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

## Associated Types

### `type Place: InPlace<Data>`

🔬 This is a nightly-only experimental API. (`placement_new_protocol` #27779)

`Place` is the intermediate agent guarding the uninitialized state for `Data`.

## Required Methods

### `fn make_place(self) -> Self::Place`

🔬 This is a nightly-only experimental API. (`placement_new_protocol` #27779)

Creates a fresh place from `self`.

## Implementors

- `impl<'a, T> Placer<T> for FrontPlace<'a, T> type Place = FrontPlace<'a, T>;`
- `impl<'a, T> Placer<T> for std::collections::vec_deque::PlaceBack<'a, T> type Place = PlaceBack<'a, T>;`
- `impl<'a, T> Placer<T> for std::vec::PlaceBack<'a, T> type Place = PlaceBack<'a, T>;`
- `impl<'a, T> Placer<T> for BackPlace<'a, T> type Place = BackPlace<'a, T>;`
- `impl<'a, T> Placer<T> for PlaceFront<'a, T> type Place = PlaceFront<'a, T>;`
- `impl<'a, T> Placer<T> for &'a mut BinaryHeap<T> where
  T: 'a + Clone + Ord, type Place = BinaryHeapPlace<'a, T>;`
- `impl<T> Placer<T> for ExchangeHeapSingleton type Place = IntermediateBox<T>;`
- `impl<'a, K, V> Placer<V> for Entry<'a, K, V> type Place = EntryPlace<'a, K, V>;`

# Help

## Keyboard Shortcuts

?
  Show this help dialog
S
  Focus the search field
⇤
  Move up in search results
⇥
  Move down in search results
⏎
  Go to active search result
+
  Collapse/expand all sections

## Search Tricks

Prefix searches with a type followed by a colon (e.g. `fn:`) to restrict the search to a given type.

Accepted types are: `fn`, `mod`, `struct`, `enum`, `trait`, `type`, `macro`, and `const`.

Search functions by type signature (e.g. `vec -> usize` or `* -> vec`)