Struct glib::SourceStream [−][src]
pub struct SourceStream<F, T> { /* fields omitted */ }
Represents a Stream
around a glib::Source
. The stream will
be provide all values that are provided by the source
Methods
impl<F, T: 'static> SourceStream<F, T> where
F: FnOnce(UnboundedSender<T>) -> Source + Send + 'static,
[src]
impl<F, T: 'static> SourceStream<F, T> where
F: FnOnce(UnboundedSender<T>) -> Source + Send + 'static,
pub fn new(create_source: F) -> SourceStream<F, T>
[src]
pub fn new(create_source: F) -> SourceStream<F, T>
Create a new SourceStream
The provided closure should return a newly created glib::Source
when called
and pass the values provided by the source to the sender that is passed
to the closure.
Trait Implementations
impl<F, T> Stream for SourceStream<F, T> where
F: FnOnce(UnboundedSender<T>) -> Source + Send + 'static,
[src]
impl<F, T> Stream for SourceStream<F, T> where
F: FnOnce(UnboundedSender<T>) -> Source + Send + 'static,
type Item = T
Values yielded by the stream.
type Error = Never
Errors yielded by the stream.
fn poll_next(&mut self, ctx: &mut Context) -> Result<Async<Option<T>>, Never>
[src]
fn poll_next(&mut self, ctx: &mut Context) -> Result<Async<Option<T>>, Never>
Attempt to pull out the next value of this stream, registering the current task for wakeup if the value is not yet available, and returning None
if the stream is exhausted. Read more
impl<T, F> Drop for SourceStream<T, F>
[src]
impl<T, F> Drop for SourceStream<T, F>
Auto Trait Implementations
impl<F, T> Send for SourceStream<F, T> where
F: Send,
T: Send,
impl<F, T> Send for SourceStream<F, T> where
F: Send,
T: Send,
impl<F, T> Sync for SourceStream<F, T> where
F: Sync,
T: Send,
impl<F, T> Sync for SourceStream<F, T> where
F: Sync,
T: Send,