InPlaceVecBuilder

Struct InPlaceVecBuilder 

Source
pub struct InPlaceVecBuilder<'a, T> { /* private fields */ }
Expand description

builds a SmallVec out of itself

Implementations§

Source§

impl<'a, T> InPlaceVecBuilder<'a, T>

Source

pub fn target_slice(&self) -> &[T]

The current target part as a slice

Source

pub fn source_slice(&self) -> &[T]

The current source part as a slice

Source

pub fn source_slice_mut(&mut self) -> &mut [T]

The current source part as a slice

Source

pub fn extend_from_iter<I: Iterator<Item = T>>(&mut self, iter: I, n: usize)

Take at most n elements from iter to the target

Source

pub fn push(&mut self, value: T)

Push a single value to the target

Source

pub fn consume(&mut self, n: usize, take: bool)

Consume n elements from the source. If take is true they will be added to the target, else they will be dropped.

Source

pub fn skip(&mut self, n: usize)

Skip up to n elements from source without adding them to the target. They will be immediately dropped!

Source

pub fn take(&mut self, n: usize)

Take up to n elements from source to target. If n is larger than the size of the remaining source, this will only copy all remaining elements in source.

Source

pub fn pop_front(&mut self) -> Option<T>

Takes the next element from the source, if it exists

Trait Implementations§

Source§

impl<'a, T: Debug> Debug for InPlaceVecBuilder<'a, T>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'a, T> Drop for InPlaceVecBuilder<'a, T>

the purpose of drop is to clean up and make the SmallVec that we reference into a normal SmallVec again.

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl<'a, T> From<&'a mut Vec<T>> for InPlaceVecBuilder<'a, T>

initializes the source part of this flip buffer with the given vector. The target part is initially empty.

Source§

fn from(value: &'a mut Vec<T>) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl<'a, T> Freeze for InPlaceVecBuilder<'a, T>

§

impl<'a, T> RefUnwindSafe for InPlaceVecBuilder<'a, T>
where T: RefUnwindSafe,

§

impl<'a, T> Send for InPlaceVecBuilder<'a, T>
where T: Send,

§

impl<'a, T> Sync for InPlaceVecBuilder<'a, T>
where T: Sync,

§

impl<'a, T> Unpin for InPlaceVecBuilder<'a, T>

§

impl<'a, T> !UnwindSafe for InPlaceVecBuilder<'a, T>

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.