# Trait bitflags::__core::ops::Boxed [−] [src]

    pub trait Boxed {
        type Data;
        type Place: BoxPlace<Self::Data>;
        unsafe fn finalize(filled: Self::Place) -> Self;
    }

Unstable (`placement_new_protocol`)

Core trait for the `box EXPR` form.

`box EXPR` effectively desugars into:

    let mut place = BoxPlace::make_place();
    let raw_place = Place::pointer(&mut place);
    let value = EXPR;
    unsafe {
        ::std::ptr::write(raw_place, value);
        Boxed::finalize(place)
    }

The type of `box EXPR` is supplied from its surrounding context; in the above expansion, the result type `T` is used to determine which implementation of `Boxed` to use, and that `<T as Boxed>` in turn dictates determines which implementation of `BoxPlace` to use, namely: `<<T as Boxed>::Place as BoxPlace>`.

## Associated Types

### `type Data`

Unstable (`placement_new_protocol`)

The kind of data that is stored in this kind of box.

### `type Place: BoxPlace<Self::Data>`

Unstable (`placement_new_protocol`)

The place that will negotiate the storage of the data.

## Required Methods

### `unsafe fn finalize(filled: Self::Place) -> Self`

Unstable (`placement_new_protocol`)

Converts filled place into final owning value, shifting deallocation/cleanup responsibilities (if any remain), over to returned instance of `Self` and forgetting `filled`.

## Implementors

- `impl<T> Boxed for Box<T>`

# 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

## 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`)