VecWithOnePosition

Struct VecWithOnePosition 

Source
pub struct VecWithOnePosition<T> { /* private fields */ }

Implementations§

Source§

impl<T> VecWithOnePosition<T>

Source

pub fn new() -> Self

Source

pub fn get_position(&self) -> usize

Source

pub fn set_position(&mut self, index: usize)

Trait Implementations§

Source§

impl<'a, T> VecWithPositions<'a, T> for VecWithOnePosition<T>

Source§

type Positions = Once<&'a usize>

Source§

type PositionsMut = Once<&'a mut usize>

Source§

fn vec(&self) -> &Vec<T>

Source§

fn vec_mut(&mut self) -> &mut Vec<T>

Source§

fn positions(&'a self) -> Self::Positions

Source§

fn positions_mut(&'a mut self) -> Self::PositionsMut

Source§

fn push(&mut self, value: T)

Source§

fn append(&mut self, other: &mut Vec<T>)

Source§

fn remove(&'a mut self, index: usize) -> T

Source§

fn clear(&mut self)

Source§

fn get(&self, index: usize) -> Option<&T>

Source§

fn get_mut(&mut self, index: usize) -> Option<&mut T>

Source§

fn set(&mut self, index: usize, value: T)

Source§

fn is_empty(&self) -> bool

Source§

fn len(&self) -> usize

Source§

fn iter(&'a self) -> Iter<'a, T>

Source§

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.