pub struct CollectionSource<T> { /* private fields */ }Expand description
A source that produces elements from a collection
Implementations§
Source§impl<T> CollectionSource<T>
impl<T> CollectionSource<T>
pub fn new(data: impl IntoIterator<Item = T>) -> Self
Trait Implementations§
Source§impl<T> Source<T> for CollectionSource<T>
impl<T> Source<T> for CollectionSource<T>
Source§fn init<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = StreamResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn init<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = StreamResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Initialize the source
Auto Trait Implementations§
impl<T> Freeze for CollectionSource<T>
impl<T> RefUnwindSafe for CollectionSource<T>where
T: RefUnwindSafe,
impl<T> Send for CollectionSource<T>where
T: Send,
impl<T> Sync for CollectionSource<T>where
T: Sync,
impl<T> Unpin for CollectionSource<T>where
T: Unpin,
impl<T> UnwindSafe for CollectionSource<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more