[][src]Struct blend2d::array::Array

#[repr(transparent)]
pub struct Array<T: ArrayType> { /* fields omitted */ }

A contiguous growable array for use with the blend2d api. This is an array managed by blend2d, unless required one should use Vec instead. Its api tries to mimic Vec as close as possible.

Methods

impl<T: ArrayType> Array<T>[src]

pub fn new() -> Self[src]

Creates a new empty array.

pub fn with_capacity(cap: usize) -> Self[src]

Creates a new empty array with space for cap elements.

pub fn clear(&mut self)[src]

Clears the array and its contents.

pub fn shrink_to_fit(&mut self)[src]

Shrinks the arrays allocated capacity down to its currently used size.

pub fn reserve(&mut self, n: usize)[src]

Reserves capacity for at least n items.

Panics

Panics if blend2d returns an OutOfMemory error

pub fn try_reserve(&mut self, n: usize) -> Result<(), OutOfMemory>[src]

Reserves capacity for at least n items.

pub fn truncate(&mut self, n: usize)[src]

Truncates the array down to n elements.

pub fn resize(&mut self, n: usize, fill: T) where
    T: Clone
[src]

Resizes the array so that its len is equal to n, filling any new items with fill.

pub fn remove(&mut self, index: usize) -> Result<()>[src]

Removes the element at the given index.

pub fn remove_range<R: RangeBounds<usize>>(&mut self, range: R) -> Result<()>[src]

Removes the elements whose indices reside inside of the range

pub fn as_slice(&self) -> &[T][src]

Returns the array as a slice.

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

Returns the length of the array.

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

Returns true if this array has no elements.

pub fn capacity(&self) -> usize[src]

Returns the current capacity of the array.

impl<T> Array<T> where
    T: ArrayType + Clone
[src]

pub fn extend_from_slice<S: AsRef<[T]>>(&mut self, data: S)[src]

Appends all items in the slice to the array.

pub fn insert_from_slice<S: AsRef<[T]>>(&mut self, index: usize, data: S)[src]

Inserts all items in the slice into the array at the given index.

pub fn replace_from_slice<R, S>(&mut self, range: R, data: S) where
    R: RangeBounds<usize>,
    S: AsRef<[T]>, 
[src]

Replaces the elements specified by the range of indices with the given slice.

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

pub fn push(&mut self, item: T)[src]

pub fn insert(&mut self, index: usize, item: T)[src]

pub fn replace(&mut self, index: usize, item: T)[src]

impl Array<ImageCodec>[src]

pub fn find_codec_by_name(&self, name: &str) -> Option<&ImageCodec>[src]

Searches for an image codec in the array by the given name.

pub fn find_codec_by_data<R: AsRef<[u8]>>(&self, data: R) -> Option<&ImageCodec>[src]

Searches for an image codec in the array by the given data.

Trait Implementations

impl<T> Geometry for Array<T> where
    [T]: Geometry,
    T: ArrayType
[src]

impl<T: ArrayType + Clone> From<Vec<T>> for Array<T>[src]

impl<'a, T> From<&'a [T]> for Array<T> where
    T: ArrayType + Clone
[src]

impl<T: ArrayType> PartialEq<Array<T>> for Array<T>[src]

#[must_use] fn ne(&self, other: &Rhs) -> bool1.0.0[src]

This method tests for !=.

impl<T: ArrayType> Clone for Array<T>[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

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

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

impl<T: ArrayType> Default for Array<T>[src]

impl<'a, T: ArrayType> IntoIterator for &'a Array<T>[src]

type Item = &'a T

The type of the elements being iterated over.

type IntoIter = Iter<'a, T>

Which kind of iterator are we turning this into?

impl<T: ArrayType> Extend<T> for Array<T>[src]

impl<T: ArrayType> Drop for Array<T>[src]

impl<T: ArrayType> DerefMut for Array<T>[src]

impl<T: ArrayType> Deref for Array<T>[src]

type Target = [T]

The resulting type after dereferencing.

impl<T> Debug for Array<T> where
    T: ArrayType + Debug
[src]

impl<T, I> Index<I> for Array<T> where
    T: ArrayType,
    I: SliceIndex<[T]>, 
[src]

type Output = I::Output

The returned type after indexing.

impl<T: ArrayType> FromIterator<T> for Array<T>[src]

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

impl Write for Array<u8>[src]

fn write_vectored(&mut self, bufs: &[IoSlice]) -> Result<usize, Error>1.36.0[src]

Like write, except that it writes from a slice of buffers. Read more

fn write_all(&mut self, buf: &[u8]) -> Result<(), Error>1.0.0[src]

Attempts to write an entire buffer into this writer. Read more

fn write_fmt(&mut self, fmt: Arguments) -> Result<(), Error>1.0.0[src]

Writes a formatted string into this writer, returning any error encountered. Read more

fn by_ref(&mut self) -> &mut Self1.0.0[src]

Creates a "by reference" adaptor for this instance of Write. Read more

Auto Trait Implementations

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

impl<T> !Sync for Array<T>

impl<T> !Send for Array<T>

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

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

Blanket Implementations

impl<T> ArrayType for T where
    T: WrappedBlCore, 
[src]

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

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.

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

impl<T, V> SliceConcat<T> for V where
    T: Clone,
    V: Borrow<[T]>, 
[src]

type Output = Vec<T>

🔬 This is a nightly-only experimental API. (slice_concat_trait)

The resulting type after concatenation

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

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