[−][src]Struct crossbeam_epoch::ArrayBox
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]
T: Copy,
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]
impl<T> DerefMut for ArrayBox<T>
[src]
impl<T> Drop for ArrayBox<T>
[src]
impl<T> Handle for ArrayBox<T>
[src]
const ALIGN: usize
[src]
fn into_usize(self) -> usize
[src]
unsafe fn from_usize(ptr: usize) -> Self
[src]
Auto Trait Implementations
impl<T> RefUnwindSafe for ArrayBox<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> !Send for ArrayBox<T>
impl<T> !Sync for ArrayBox<T>
impl<T> Unpin for ArrayBox<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for ArrayBox<T> where
T: RefUnwindSafe + UnwindSafe,
T: RefUnwindSafe + UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,