pub struct AverVector<T> { /* private fields */ }Implementations§
Source§impl<T: Clone> AverVector<T>
impl<T: Clone> AverVector<T>
pub fn new(size: usize, default: T) -> Self
pub fn get(&self, index: usize) -> Option<&T>
Sourcepub fn set_unchecked(self, index: usize, value: T) -> Self
pub fn set_unchecked(self, index: usize, value: T) -> Self
O(1) amortized if unique owner, O(n) clone if shared.
Caller must ensure index < len().
Sourcepub fn set_owned(self, index: usize, value: T) -> Option<Self>
pub fn set_owned(self, index: usize, value: T) -> Option<Self>
O(1) amortized if unique owner, O(n) clone if shared. None if out of bounds.
Sourcepub fn set(&self, index: usize, value: T) -> Option<Self>
pub fn set(&self, index: usize, value: T) -> Option<Self>
O(n) because &self preserves the original vector.
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn from_vec(v: Vec<T>) -> Self
pub fn to_vec(&self) -> Vec<T>
Sourcepub fn from_list(list: &AverList<T>) -> Selfwhere
T: Clone,
pub fn from_list(list: &AverList<T>) -> Selfwhere
T: Clone,
O(1) if list is Flat with start=0 (e.g. after List.reverse), O(n) otherwise.
pub fn iter(&self) -> Iter<'_, T>
Trait Implementations§
Source§impl<T: AverDisplay + Clone> AverDisplay for AverVector<T>
impl<T: AverDisplay + Clone> AverDisplay for AverVector<T>
fn aver_display(&self) -> String
fn aver_display_inner(&self) -> String
Source§impl<T> Clone for AverVector<T>
impl<T> Clone for AverVector<T>
Source§impl<T: Debug> Debug for AverVector<T>
impl<T: Debug> Debug for AverVector<T>
Source§impl<T: Hash> Hash for AverVector<T>
impl<T: Hash> Hash for AverVector<T>
Source§impl<T: PartialEq> PartialEq for AverVector<T>
impl<T: PartialEq> PartialEq for AverVector<T>
impl<T: Eq> Eq for AverVector<T>
Auto Trait Implementations§
impl<T> Freeze for AverVector<T>
impl<T> RefUnwindSafe for AverVector<T>where
T: RefUnwindSafe,
impl<T> !Send for AverVector<T>
impl<T> !Sync for AverVector<T>
impl<T> Unpin for AverVector<T>
impl<T> UnsafeUnpin for AverVector<T>
impl<T> UnwindSafe for AverVector<T>where
T: RefUnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more