[][src]Struct smart_buffer::SmartBuffer

pub struct SmartBuffer<T, const N: usize> where
    T: Clone
{ /* fields omitted */ }

Implementations

impl<T, const N: usize> SmartBuffer<T, N> where
    T: Clone
[src]

pub fn clear(&mut self)[src]

Clears all values to the given default value.

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

Safely push a value into the SmartBuffer

pub fn set_size(&mut self, size: usize)[src]

Sets the size of the buffer (does not reduce capacity)

pub fn insert_slice(&mut self, slice: &[T])[src]

Safely inserts a slice of data, starting at the size.

pub fn insert_slice_at(&mut self, slice: &[T], index: usize)[src]

Safely inserts a slice of data at an index;

pub fn insert_arr<const M: usize>(&mut self, arr: &[T; M])[src]

Safely inserts an array, starting at the size.

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

Safely insert a value into the SmartBuffer

pub fn get(&self, index: usize) -> Option<&T>[src]

Safely get a value at an index

pub unsafe fn get_unchecked(&self, index: usize) -> &T[src]

Unsafely get a reference to a value at an index. An index too large will result in a fault

pub unsafe fn get_mut_unchecked(&mut self, index: usize) -> &mut T[src]

Unsafely get a mutable

pub fn as_mut_ptr(self) -> *mut Self[src]

pub fn new(value: T, len: usize) -> Self where
    T: Copy + Clone
[src]

pub fn from_arr(buf: [T; N], len: usize) -> Self where
    T: Clone
[src]

Creates a SmartBuffer from an array

impl<T, const N: usize> SmartBuffer<T, N> where
    T: Clone + PartialEq
[src]

pub fn calc_size(&mut self)[src]

Recalculates the size

Trait Implementations

impl<T, const N: usize> Drop for SmartBuffer<T, N> where
    T: Clone
[src]

impl<T, const N: usize> Index<usize> for &SmartBuffer<T, N> where
    T: Clone
[src]

type Output = T

The returned type after indexing.

impl<T, const N: usize> Index<usize> for SmartBuffer<T, N> where
    T: Clone
[src]

type Output = T

The returned type after indexing.

impl<T, const N: usize> IndexMut<usize> for SmartBuffer<T, N> where
    T: Clone
[src]

impl<T, const N: usize> Into<Vec<T, Global>> for SmartBuffer<T, N> where
    T: Clone
[src]

impl<T, const N: usize> IntoIterator for SmartBuffer<T, N> where
    T: Clone
[src]

type Item = T

The type of the elements being iterated over.

type IntoIter = SmartBufferIter<T, N>

Which kind of iterator are we turning this into?

pub fn into_iter(self) -> Self::IntoIter[src]

Creates a consuming Iterator

impl<'a, T, const N: usize> IntoIterator for &'a SmartBuffer<T, N> where
    T: Clone
[src]

type Item = &'a T

The type of the elements being iterated over.

type IntoIter = SmartBufferIterRef<'a, T, N>

Which kind of iterator are we turning this into?

pub fn into_iter(self) -> Self::IntoIter[src]

Creates a consuming Iterator

impl<'a, T, const N: usize> IntoIterator for &'a mut SmartBuffer<T, N> where
    T: Clone
[src]

type Item = &'a mut T

The type of the elements being iterated over.

type IntoIter = SmartBufferIterRefMut<'a, T, N>

Which kind of iterator are we turning this into?

pub fn into_iter(self) -> Self::IntoIter[src]

Creates a consuming Iterator

Auto Trait Implementations

impl<T, const N: usize> !Send for SmartBuffer<T, N>[src]

impl<T, const N: usize> !Sync for SmartBuffer<T, N>[src]

impl<T, const N: usize> Unpin for SmartBuffer<T, N> where
    T: Unpin
[src]

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.