[−][src]Struct memur::Array
Continuous memory block containing many elements of the same type.
Implementations
impl<T> Array<T> where
T: Sized,
[src]
T: Sized,
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]
arena: &Arena,
capacity: usize
) -> Result<UninitArray<T>, UploadError>
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]
arena: &Arena,
iter: impl ExactSizeIterator<Item = T>
) -> Result<Array<T>, UploadError>
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]
T: Debug,
T: Sized,
impl<T> Index<Range<usize>> for Array<T>
[src]
type Output = [T]
The returned type after indexing.
fn index(&self, range: Range<usize>) -> &[T]
[src]
impl<T> Index<RangeFrom<usize>> for Array<T>
[src]
type Output = [T]
The returned type after indexing.
fn index(&self, range: RangeFrom<usize>) -> &[T]
[src]
impl<T> Index<RangeFull> for Array<T>
[src]
impl<T> Index<RangeTo<usize>> for Array<T>
[src]
type Output = [T]
The returned type after indexing.
fn index(&self, range: RangeTo<usize>) -> &[T]
[src]
impl<T> Index<RangeToInclusive<usize>> for Array<T>
[src]
type Output = [T]
The returned type after indexing.
fn index(&self, range: RangeToInclusive<usize>) -> &[T]
[src]
impl<T> Index<usize> for Array<T>
[src]
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]
fn index_mut(&mut self, range: RangeToInclusive<usize>) -> &mut [T]
[src]
impl<T> IndexMut<usize> for Array<T>
[src]
Auto Trait Implementations
impl<T> RefUnwindSafe for Array<T> where
T: RefUnwindSafe,
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,
T: RefUnwindSafe,
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,
pub 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.
pub 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>,