[−][src]Struct blend2d::array::Array
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]
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]
T: Clone,
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]
T: ArrayType + Clone,
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]
R: RangeBounds<usize>,
S: AsRef<[T]>,
Replaces the elements specified by the range of indices with the given slice.
impl<T> Array<T> where
T: ArrayType,
[src]
T: ArrayType,
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]
[T]: Geometry,
T: ArrayType,
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]
T: ArrayType + Clone,
impl<T: ArrayType> PartialEq<Array<T>> for Array<T>
[src]
fn eq(&self, other: &Self) -> bool
[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.
impl<T: ArrayType> Clone for Array<T>
[src]
fn clone(&self) -> Self
[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?
fn into_iter(self) -> Self::IntoIter
[src]
impl<T: ArrayType> Extend<T> for Array<T>
[src]
fn extend<I>(&mut self, iter: I) where
I: IntoIterator<Item = T>,
[src]
I: IntoIterator<Item = T>,
impl<T: ArrayType> Drop for Array<T>
[src]
impl<T: ArrayType> DerefMut for Array<T>
[src]
impl<T: ArrayType> Deref for Array<T>
[src]
impl<T> Debug for Array<T> where
T: ArrayType + Debug,
[src]
T: ArrayType + Debug,
impl<T, I> Index<I> for Array<T> where
T: ArrayType,
I: SliceIndex<[T]>,
[src]
T: ArrayType,
I: SliceIndex<[T]>,
type Output = I::Output
The returned type after indexing.
fn index(&self, index: I) -> &Self::Output
[src]
impl<T: ArrayType> FromIterator<T> for Array<T>
[src]
fn from_iter<I>(iter: I) -> Array<T> where
I: IntoIterator<Item = T>,
[src]
I: IntoIterator<Item = T>,
impl<T: ArrayType> Borrow<[T]> for Array<T>
[src]
impl Write for Array<u8>
[src]
fn write(&mut self, buf: &[u8]) -> Result<usize>
[src]
fn flush(&mut self) -> Result<()>
[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 Self
1.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,
T: Unpin,
impl<T> !Sync for Array<T>
impl<T> !Send for Array<T>
impl<T> RefUnwindSafe for Array<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> UnwindSafe for Array<T> where
T: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> ArrayType for T where
T: WrappedBlCore,
[src]
T: WrappedBlCore,
const IMPL_IDX: usize
[src]
unsafe fn push(&mut BLArrayCore, T)
[src]
unsafe fn insert(&mut BLArrayCore, usize, T)
[src]
unsafe fn replace(&mut BLArrayCore, usize, T)
[src]
impl<T> From<T> for T
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut 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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T, V> SliceConcat<T> for V where
T: Clone,
V: Borrow<[T]>,
[src]
T: Clone,
V: Borrow<[T]>,
type Output = Vec<T>
slice_concat_trait
)The resulting type after concatenation
fn concat(slice: &[V]) -> Vec<T>
[src]
fn join(slice: &[V], sep: &T) -> Vec<T>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,