Struct SyncStream

pub struct SyncStream<S> { /* private fields */ }

Stream which is Sync.

Examples

use sync_wrapper::SyncStream;
use futures::stream;

let st = stream::iter(vec![1]);
let st = SyncStream::new(st);

Implementations

impl<S: Stream> SyncStream<S>

fn new(inner: S) -> Self
fn into_inner(self) -> S

Trait Implementations

impl<S: Stream> Stream for SyncStream<S>

type Item = <S as Stream>::Item;
fn poll_next(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Option<Self::Item>>

impl<T> Debug for SyncStream<T>

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

Auto Trait Implementations

impl<S> Freeze for SyncStream<S> where SyncWrapper<S>: Freeze,

impl<S> RefUnwindSafe for SyncStream<S> where SyncWrapper<S>: RefUnwindSafe,

impl<S> Send for SyncStream<S> where SyncWrapper<S>: Send,

impl<S> Sync for SyncStream<S> where SyncWrapper<S>: Sync,

impl<S> Unpin for SyncStream<S> where SyncWrapper<S>: Unpin,

impl<S> UnsafeUnpin for SyncStream<S> where SyncWrapper<S>: UnsafeUnpin,

impl<S> UnwindSafe for SyncStream<S> where SyncWrapper<S>: UnwindSafe,

Blanket Implementations

impl<S, T, E> TryStream for SyncStream<S> where S: Stream<Item = Result<T, E>> + ?Sized,

type Ok = T;
type Error = E;
fn try_poll_next(self: Pin<&mut S>, cx: &mut Context<'_>) -> Poll<Option<Result<<S as TryStream>::Ok, <S as TryStream>::Error>>>

impl<T> Any for SyncStream<S> where T: 'static + ?Sized,

fn type_id(&self) -> TypeId

impl<T> Borrow<T> for SyncStream<S> where T: ?Sized,

fn borrow(&self) -> &T

impl<T> BorrowMut<T> for SyncStream<S> where T: ?Sized,

fn borrow_mut(&mut self) -> &mut T

impl<T> From<T> for SyncStream<S>

fn from(t: T) -> T

Returns the argument unchanged.

impl<T, U> Into<U> for SyncStream<S> where U: From<T>,

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

impl<T, U> TryFrom<U> for SyncStream<S> where U: Into<T>,

type Error = Infallible;
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

impl<T, U> TryInto<U> for SyncStream<S> where U: TryFrom<T>,

type Error = <U as TryFrom<T>>::Error;
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>