pub struct AutoVec<T> { /* private fields */ }Implementations§
Source§impl<T> AutoVec<T>
impl<T> AutoVec<T>
pub fn new() -> Self
Sourcepub fn append(&mut self, other: &mut AutoVec<T>)
pub fn append(&mut self, other: &mut AutoVec<T>)
Moves all the elements of other into self, leaving other empty.
See Vec::append() for more details.
Sourcepub fn add(&mut self, child: &mut RawAutoChild<T>)
pub fn add(&mut self, child: &mut RawAutoChild<T>)
If the child is already in the vec, it will not be added a second time. A normal child cannot be added to multiple containers, adding it to another vec will remove it from the previous one.
Sourcepub fn remove(&mut self, child: &mut RawAutoChild<T>)
pub fn remove(&mut self, child: &mut RawAutoChild<T>)
Using Vec::swap_remove()
pub fn clear(&mut self)
pub fn len(&self) -> usize
Sourcepub fn shrink_to(&mut self, min_capacity: usize)
pub fn shrink_to(&mut self, min_capacity: usize)
Reexport Vec::shrink_to()
Sourcepub fn shrink_to_fit(&mut self)
pub fn shrink_to_fit(&mut self)
Reexport Vec::shrink_to_fit()
Sourcepub fn with_capacity(capacity: usize) -> Self
pub fn with_capacity(capacity: usize) -> Self
See Vec::with_capacity() for more details.
Trait Implementations§
Source§impl<T> Index<usize> for AutoVec<T>
use auto_vec::*;
let mut c = AutoChild::new(1);
let mut v = AutoVec::new();
v.add(&mut c);
assert_eq!(1, v[0]);
impl<T> Index<usize> for AutoVec<T>
use auto_vec::*;
let mut c = AutoChild::new(1);
let mut v = AutoVec::new();
v.add(&mut c);
assert_eq!(1, v[0]);Source§impl<'a, T> IntoIterator for &'a AutoVec<T>
impl<'a, T> IntoIterator for &'a AutoVec<T>
Auto Trait Implementations§
impl<T> Freeze for AutoVec<T>
impl<T> RefUnwindSafe for AutoVec<T>where
T: RefUnwindSafe,
impl<T> !Send for AutoVec<T>
impl<T> !Sync for AutoVec<T>
impl<T> Unpin for AutoVec<T>
impl<T> UnwindSafe for AutoVec<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