Skip to main content

Cloned

Trait Cloned 

Source
pub trait Cloned<'a, T, S>
where S: Stream<Item = &'a T>, T: Clone + 'a,
{ // Required method fn cloned(self) -> Map<S, fn(&T) -> T>; }
Expand description

Clones items yielded by a stream of shared references.

Each referenced value is cloned only when its stream item is polled. Item order and readiness follow the source stream unchanged.

Required Methods§

Source

fn cloned(self) -> Map<S, fn(&T) -> T>

Returns a stream of owned clones from the borrowed items.

The adapter uses Clone::clone for each yielded reference. It performs no eager collection or buffering.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<'a, T, S> Cloned<'a, T, S> for S
where S: Stream<Item = &'a T>, T: Clone + 'a,