[][src]Struct memur::Array

pub struct Array<T> where
    T: Sized
{ /* fields omitted */ }

Continuous memory block containing many elements of the same type.

Implementations

impl<T> Array<T> where
    T: Sized
[src]

pub fn len(&self) -> Option<usize>[src]

Returns the length of this array if the Arena is alive.

pub fn is_empty(&self) -> bool[src]

Returns true if arena is dead or array is empty.

pub fn with_capacity(
    arena: &Arena,
    capacity: usize
) -> Result<UninitArray<T>, UploadError>
[src]

Creates a new array with specified capacity and does not place data to it, the array items are not initialized.

If array is dropped in this state, nothing happens, because the len is zero.

Once the items are initialized, this array can be converted to Array type. The total number of items in array can not exceed the initial capacity.

pub fn new(
    arena: &Arena,
    iter: impl ExactSizeIterator<Item = T>
) -> Result<Array<T>, UploadError>
[src]

Creates a new array and places the data to it.

pub fn safer_iter(&self) -> Option<impl ExactSizeIterator<Item = &T>>[src]

Iterates over the item references in arena if the arena is alive.

pub fn iter(&self) -> impl ExactSizeIterator<Item = &T>[src]

Iterates over the item references in arena, returns no items if the arena is dead.

pub fn safer_iter_mut(&self) -> Option<impl ExactSizeIterator<Item = &mut T>>[src]

Iterates over the mutable item references in arena if the arena is alive.

pub fn iter_mut(&mut self) -> impl ExactSizeIterator<Item = &mut T>[src]

Iterates over the mutable item references in arena, returns no items if the arena is dead.

Trait Implementations

impl<T> AsMut<[T]> for Array<T>[src]

impl<T> AsRef<[T]> for Array<T>[src]

impl<T> Borrow<[T]> for Array<T>[src]

impl<T> Debug for Array<T> where
    T: Debug,
    T: Sized
[src]

impl<T> Index<Range<usize>> for Array<T>[src]

type Output = [T]

The returned type after indexing.

impl<T> Index<RangeFrom<usize>> for Array<T>[src]

type Output = [T]

The returned type after indexing.

impl<T> Index<RangeFull> for Array<T>[src]

type Output = [T]

The returned type after indexing.

impl<T> Index<RangeTo<usize>> for Array<T>[src]

type Output = [T]

The returned type after indexing.

impl<T> Index<RangeToInclusive<usize>> for Array<T>[src]

type Output = [T]

The returned type after indexing.

impl<T> Index<usize> for Array<T>[src]

type Output = T

The returned type after indexing.

impl<T> IndexMut<Range<usize>> for Array<T>[src]

impl<T> IndexMut<RangeFrom<usize>> for Array<T>[src]

impl<T> IndexMut<RangeFull> for Array<T>[src]

impl<T> IndexMut<RangeTo<usize>> for Array<T>[src]

impl<T> IndexMut<RangeToInclusive<usize>> for Array<T>[src]

impl<T> IndexMut<usize> for Array<T>[src]

Auto Trait Implementations

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

impl<T> !Send for Array<T>

impl<T> !Sync for Array<T>

impl<T> Unpin for Array<T>

impl<T> UnwindSafe for Array<T> where
    T: RefUnwindSafe

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.