Trait possibly_uninit::slice::TakeItem[][src]

pub trait TakeItem<T> {
    fn take_item(self) -> T;
}

Abstraction allowing treating T and &T where T: Copy equally.

This is mainly useful when working with iterators, so there don’t have to be two different methods consuming iterator and doing pretty much the same thing with it.

Required methods

fn take_item(self) -> T[src]

Moves or copies the value.

Loading content...

Implementors

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

impl<T: Copy> TakeItem<T> for &T[src]

Loading content...