pub struct VecWithOnePosition<T> { /* private fields */ }Implementations§
Source§impl<T> VecWithOnePosition<T>
impl<T> VecWithOnePosition<T>
pub fn new() -> Self
pub fn get_position(&self) -> usize
pub fn set_position(&mut self, index: usize)
Trait Implementations§
Source§impl<'a, T> VecWithPositions<'a, T> for VecWithOnePosition<T>
impl<'a, T> VecWithPositions<'a, T> for VecWithOnePosition<T>
type Positions = Once<&'a usize>
type PositionsMut = Once<&'a mut usize>
fn vec(&self) -> &Vec<T>
fn vec_mut(&mut self) -> &mut Vec<T>
fn positions(&'a self) -> Self::Positions
fn positions_mut(&'a mut self) -> Self::PositionsMut
fn push(&mut self, value: T)
fn append(&mut self, other: &mut Vec<T>)
fn remove(&'a mut self, index: usize) -> T
fn clear(&mut self)
fn get(&self, index: usize) -> Option<&T>
fn get_mut(&mut self, index: usize) -> Option<&mut T>
fn set(&mut self, index: usize, value: T)
fn is_empty(&self) -> bool
fn len(&self) -> usize
fn iter(&'a self) -> Iter<'a, T>
fn iter_mut(&'a mut self) -> IterMut<'a, T>
Auto Trait Implementations§
impl<T> Freeze for VecWithOnePosition<T>
impl<T> RefUnwindSafe for VecWithOnePosition<T>where
T: RefUnwindSafe,
impl<T> Send for VecWithOnePosition<T>where
T: Send,
impl<T> Sync for VecWithOnePosition<T>where
T: Sync,
impl<T> Unpin for VecWithOnePosition<T>where
T: Unpin,
impl<T> UnwindSafe for VecWithOnePosition<T>where
T: UnwindSafe,
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