[][src]Struct crossbeam_epoch::ArrayBox

pub struct ArrayBox<T> { /* fields omitted */ }

A box that owns an array.

Memory layout

An array box points to the memory location containing array size and elements:

This example is not tested
         elements
         |
         |
------------------------------------
| size | 0 | 1 | 2 | 3 | 4 | 5 | 6 |
------------------------------------

It is different from Box<[T]> in that size is in the allocation of array box, while size is in Box<[T]>'s representation along with pointer.

Ownership

An array box owns the array elements. In particular, when an array box is dropped, its elements are dropped.

Examples

use crossbeam_epoch::{self as epoch, ArrayOwned, ArrayBox};

let a = ArrayBox::<i32>::new(10);
let o = ArrayOwned::from(a);

Methods

impl<T> ArrayBox<T>[src]

pub unsafe fn new_uninit(size: usize) -> Self[src]

Allocates a new array and returns an array box that owns the new array.

Safety

The array is not initialized.

pub fn new(size: usize, value: T) -> Self where
    T: Copy
[src]

Allocates a new array, initializes it with the given value, and returns an array box that owns the new array.

Trait Implementations

impl<T: Debug> Debug for ArrayBox<T>[src]

impl<T> Deref for ArrayBox<T>[src]

type Target = [T]

The resulting type after dereferencing.

impl<T> DerefMut for ArrayBox<T>[src]

impl<T> Drop for ArrayBox<T>[src]

impl<T> Handle for ArrayBox<T>[src]

Auto Trait Implementations

impl<T> RefUnwindSafe for ArrayBox<T> where
    T: RefUnwindSafe

impl<T> !Send for ArrayBox<T>

impl<T> !Sync for ArrayBox<T>

impl<T> Unpin for ArrayBox<T> where
    T: Unpin

impl<T> UnwindSafe for ArrayBox<T> where
    T: RefUnwindSafe + UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.