[−][src]Struct smart_buffer::SmartBuffer
Implementations
impl<T, const N: usize> SmartBuffer<T, N> where
T: Clone,
[src]
T: Clone,
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]
T: Copy + Clone,
pub fn from_arr(buf: [T; N], len: usize) -> Self where
T: Clone,
[src]
T: Clone,
Creates a SmartBuffer from an array
impl<T, const N: usize> SmartBuffer<T, N> where
T: Clone + PartialEq,
[src]
T: Clone + PartialEq,
Trait Implementations
impl<T, const N: usize> Drop for SmartBuffer<T, N> where
T: Clone,
[src]
T: Clone,
impl<T, const N: usize> Index<usize> for &SmartBuffer<T, N> where
T: Clone,
[src]
T: Clone,
type Output = T
The returned type after indexing.
pub fn index(&self, index: usize) -> &Self::Output
[src]
impl<T, const N: usize> Index<usize> for SmartBuffer<T, N> where
T: Clone,
[src]
T: Clone,
type Output = T
The returned type after indexing.
pub fn index(&self, index: usize) -> &Self::Output
[src]
impl<T, const N: usize> IndexMut<usize> for SmartBuffer<T, N> where
T: Clone,
[src]
T: Clone,
impl<T, const N: usize> Into<Vec<T, Global>> for SmartBuffer<T, N> where
T: Clone,
[src]
T: Clone,
impl<T, const N: usize> IntoIterator for SmartBuffer<T, N> where
T: Clone,
[src]
T: Clone,
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]
T: Clone,
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]
T: Clone,
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]
T: Unpin,
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>,