[−][src]Trait vec_utils::TupleElem
This trait abstracts away elements of the input stream
Safety
- It must be valid to call
next_unchecked
at leastlen
times len <= capacity
- if
next_unchecked
defers to anotherT: TupleElem
, then you should not callT::next_unchecked
more than once in your ownnext_unchecked
Associated Types
type Item
The items yielded from this element
type Data
The data-segment that Output<V>
is derived from
and yields Item
s
type Iter: Iterator<Item = Self::Item>
An iterator over the items in the collection
Required methods
fn capacity(data: &Self::Data) -> usize
The capacity of the data-segment
fn len(&self) -> usize
The currently initialized length of the data-segment
must be less than or equal to the capacity
fn into_data(self) -> Self::Data
Convert into a raw data-segment
fn into_iterator(self) -> Self::Iter
Convert to an iterator if we cannot reuse the data-segment
fn check_layout<V>() -> bool
If this returns true
if it is safe to call
take_output
unsafe fn take_output<V>(data: &mut Self::Data) -> Output<V>
Try and create a new output data-segment, if the output segment
is created, then it owns it's allocation. So you must not deallocate
the allocation backing Output<V>
Safety
check_layout::<V>
must return true.
unsafe fn next_unchecked(data: &mut Self::Data) -> Self::Item
unsafe fn drop_rest(data: &mut Self::Data, len: usize)
Drop the rest of the buffer and deallocate
if do_pick
was never called
Safety
This function should only be called once, and
data
should not be used again