[][src]Struct generic_vec::iter::RawCursor

pub struct RawCursor<'a, T, S: ?Sized + Storage<T>> { /* fields omitted */ }

This struct is created by GenericVec::raw_cursor. See its documentation for more.

Implementations

impl<'a, T, S: ?Sized + Storage<T>> RawCursor<'a, T, S>[src]

pub fn finish(&mut self)[src]

Skip all the remaining elements, and ensure that the GenericVec is valid

pub fn len(&self) -> usize[src]

The number of remaining elements in range of this RawCursor

The RawCursor is empty when there are 0 remaining elements

pub fn is_empty(&self) -> bool[src]

Returns true if the RawCursor is empty

pub fn is_write_empty(&self) -> bool[src]

Returns true if the RawCursor is has no unfilled slots and the RawCursor is empty

pub fn is_write_front_empty(&self) -> bool[src]

Returns true if there is an unfilled slot at the front of the RawCursor

pub fn is_write_back_empty(&self) -> bool[src]

Returns true if there is an unfilled slot at the back of the RawCursor

pub fn write_len(&self) -> usize[src]

Returns the number of unfilled slots if the RawCursor is empty if the RawCursor is not empty, the behavior is unspecified

pub fn write_front_len(&self) -> usize[src]

Returns the number of unfilled slots at the front of the RawCursor

pub fn write_back_len(&self) -> usize[src]

Returns the number of unfilled slots at the back of the RawCursor

pub unsafe fn front(&self) -> &T[src]

Returns a reference to the next element of the RawCursor.

Note: this does not advance the RawCursor or change the number of unfilled slots

Safety

The RawCursor must not be empty

pub unsafe fn front_mut(&mut self) -> &mut T[src]

Returns a mutable reference to the next element of the RawCursor.

Note: this does not advance the RawCursor or change the number of unfilled slots

Safety

The RawCursor must not be empty

pub unsafe fn back(&self) -> &T[src]

Returns a reference to the last element of the RawCursor.

Note: this does not advance the RawCursor or change the number of unfilled slots

Safety

The RawCursor must not be empty

pub unsafe fn back_mut(&mut self) -> &mut T[src]

Returns a mutable reference to the last element of the RawCursor.

Note: this does not advance the RawCursor or change the number of unfilled slots

Safety

The RawCursor must not be empty

pub unsafe fn take_front(&mut self) -> T[src]

Removes the next element of the RawCursor and removes it from the underlying GenericVec

Advances the RawCursor by 1 element

Creates 1 unfilled slot at the front of the RawCursor.

Safety

The RawCursor must not be empty

pub unsafe fn take_back(&mut self) -> T[src]

Removes the last element of the Cursor and removes it from the underlying [GenericVec`]

Advances the RawCursor by 1 element

Creates 1 unfilled slot at the back of the RawCursor.

Safety

The RawCursor must not be empty

pub unsafe fn drop_front(&mut self)[src]

Drops the next element of the RawCursor and removes them it the underlying GenericVec

Advances the RawCursor by 1 element

Creates 1 unfilled slot at the front of the RawCursor.

Safety

The RawCursor must not be empty

pub unsafe fn drop_back(&mut self)[src]

Drops the last element of the RawCursor and removes them it the underlying GenericVec

Advances the RawCursor by 1 element

Creates 1 unfilled slot at the back of the RawCursor.

Safety

The RawCursor must not be empty

pub unsafe fn drop_n_front(&mut self, n: usize)[src]

Drops the next n elements of the RawCursor and removes them from the underlying GenericVec

Advances the RawCursor by n elements

Creates n unfilled slots at the front of the RawCursor.

Safety

The RawCursor's length must be at least equal to n

pub unsafe fn drop_n_back(&mut self, n: usize)[src]

Drops the last n elements of the RawCursor and removes them from the underlying GenericVec

Advances the RawCursor by n elements

Creates n unfilled slots at the back of the RawCursor.

Safety

The RawCursor's length must be at least equal to n

pub unsafe fn write_front(&mut self, value: T)[src]

Writes value into the unfilled slot at the front of the RawCursor if there is an unfilled slot at the front of the RawCursor

Fills in 1 unfilled slot at the front of the RawCursor

Safety

There must be at least 1 unfilled slot at the front of the RawCursor

pub unsafe fn write_back(&mut self, value: T)[src]

Writes value into the unfilled slot at the back of the RawCursor if there is an unfilled slot at the back of the RawCursor

Fills in 1 unfilled slot at the back of the RawCursor

Safety

There must be at least 1 unfilled slot at the back of the RawCursor

pub unsafe fn write_slice_front(&mut self, slice: &[T])[src]

Moves slice into the unfilled slots at the front of the RawCursor if there are slice.len() unfilled slots at the front of the RawCursor

Fills in slice.len() unfilled slots at the front of the RawCursor

Safety

  • There must be at least slice.len() unfilled slots at the front of the RawCursor
  • You must not drop any of the values in slice

pub unsafe fn write_slice_back(&mut self, slice: &[T])[src]

Moves slice into the unfilled slots at the back of the RawCursor if there are slice.len() unfilled slots at the back of the RawCursor

Fills in slice.len() unfilled slots at the back of the RawCursor

Safety

  • There must be at least slice.len() unfilled slots at the back of the RawCursor
  • You must not drop any of the values in slice

pub unsafe fn skip_front(&mut self)[src]

Skips the next element of the RawCursor and keeps it in the underlying GenericVec

Advances the RawCursor by 1 element

Does not change the number of unfilled slots.

Safety

The RawCursor must not be empty

pub unsafe fn skip_back(&mut self)[src]

Skips the last element of the RawCursor and keeps it in the underlying GenericVec

Advances the RawCursor by 1 element

Does not change the number of unfilled slots.

Safety

The RawCursor must not be empty

pub unsafe fn skip_n_front(&mut self, n: usize)[src]

Skips the next n elements of the RawCursor and keeps them in the underlying GenericVec

Advances the RawCursor by n elements

Does not change the number of unfilled slots.

Safety

The RawCursor's length must be at least equal to n

pub unsafe fn skip_n_back(&mut self, n: usize)[src]

Skips the last n elements of the RawCursor and keeps them in the underlying GenericVec

Advances the RawCursor by n elements

Does not change the number of unfilled slots.

Safety

The RawCursor's length must be at least equal to n

pub fn reserve(&mut self, space: usize)[src]

Reserve at least space unfilled slots in the RawCursor

Panic

  • Panics if the RawCursor is not empty
  • May panic if the underlying GenericVec cannot reserve more space

Trait Implementations

impl<T, S: ?Sized + Storage<T>, '_> Drop for RawCursor<'_, T, S>[src]

impl<T: Send, S: ?Sized + Storage<T> + Send, '_> Send for RawCursor<'_, T, S>[src]

impl<T: Sync, S: ?Sized + Storage<T> + Sync, '_> Sync for RawCursor<'_, T, S>[src]

Auto Trait Implementations

impl<'a, T, S: ?Sized> RefUnwindSafe for RawCursor<'a, T, S> where
    S: RefUnwindSafe,
    T: RefUnwindSafe

impl<'a, T, S: ?Sized> Unpin for RawCursor<'a, T, S>

impl<'a, T, S> !UnwindSafe for RawCursor<'a, T, S>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.