[][src]Struct webdav_handler::async_stream::AsyncStream

#[must_use]
pub struct AsyncStream<Item, Error> { /* fields omitted */ }

An abstraction around a future, where the future can internally loop and yield items.

AsyncStream::new() takes a futures 0.3 Future (async closure, usually) and AsyncStream then implements both a futures 0.1 Stream and a futures 0.3 Stream.

Methods

impl<Item, Error: 'static + Send> AsyncStream<Item, Error>[src]

pub fn new<F, R>(f: F) -> Self where
    F: FnOnce(Sender<Item, Error>) -> R,
    R: Future03<Output = Result<(), Error>> + Send + 'static,
    Item: 'static, 
[src]

Create a new stream from a closure returning a Future 0.3, or an "async closure" (which is the same).

The closure is passed one argument, the sender, which has a method "send" that can be called to send a item to the stream.

The AsyncStream instance that is returned impl's both a futures 0.1 Stream and a futures 0.3 Stream.

Trait Implementations

impl<I, E> Stream for AsyncStream<I, E>[src]

Stream implementation for Futures 0.1.

type Item = I

The type of item this stream will yield on success.

type Error = E

The type of error this stream may generate.

impl<I, E: Unpin> Stream for AsyncStream<I, E>[src]

Stream implementation for Futures 0.3.

type Item = Result<I, E>

Values yielded by the stream.

Auto Trait Implementations

impl<Item, Error> Send for AsyncStream<Item, Error>

impl<Item, Error> !Sync for AsyncStream<Item, Error>

impl<Item, Error> Unpin for AsyncStream<Item, Error> where
    Error: Unpin

impl<Item, Error> !UnwindSafe for AsyncStream<Item, Error>

impl<Item, Error> !RefUnwindSafe for AsyncStream<Item, Error>

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

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

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<St> Stream01CompatExt for St where
    St: Stream
[src]

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

type Ok = T

The type of successful values yielded by this future

type Error = E

The type of failures yielded by this future

impl<T> StreamExt for T where
    T: Stream + ?Sized
[src]

impl<S> TryStreamExt for S where
    S: TryStream + ?Sized
[src]