pub struct Circular<T> { /* private fields */ }Implementations§
Source§impl<T> Circular<T>
We have a vector and “position” therein.
impl<T> Circular<T>
We have a vector and “position” therein.
TODO: More tests.
pub fn new() -> Self
pub fn vec(&self) -> &Vec<T>
pub fn push(&mut self, value: T)
pub fn append(&mut self, other: &mut Vec<T>)
pub fn remove_unsafe(&mut self, index: usize) -> T
pub fn remove_by_pos_id(&mut self, pos_id: PositionID) -> Option<T>
pub fn is_empty(&self) -> bool
pub fn len(&self) -> usize
pub fn positions_is_empty(&self) -> bool
pub fn positions_len(&self) -> usize
pub fn iter(&self) -> Iter<'_, T>
pub fn iter_mut(&mut self) -> IterMut<'_, T>
pub fn create_position(&mut self) -> PositionID
pub fn destroy_position(&mut self, pos_id: PositionID)
pub fn get_position(&self, pos_id: PositionID) -> &Option<usize>
pub fn set_position_unsafe(&mut self, pos_id: PositionID, index: Option<usize>)
pub fn get_by_pos_id(&self, pos_id: PositionID) -> Option<&T>
pub fn get_by_pos_id_mut(&mut self, pos_id: PositionID) -> Option<&mut T>
Sourcepub fn force_get_by_pos_id_mut(&mut self, pos_id: PositionID) -> Option<&mut T>
pub fn force_get_by_pos_id_mut(&mut self, pos_id: PositionID) -> Option<&mut T>
If current is None tries to set it to Some.
pub fn clear(&mut self)
pub fn next(&mut self, pos_id: PositionID) -> Option<&T>
Auto Trait Implementations§
impl<T> Freeze for Circular<T>
impl<T> RefUnwindSafe for Circular<T>where
T: RefUnwindSafe,
impl<T> Send for Circular<T>where
T: Send,
impl<T> Sync for Circular<T>where
T: Sync,
impl<T> Unpin for Circular<T>where
T: Unpin,
impl<T> UnwindSafe for Circular<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