Struct glib::SourceFuture [−][src]
pub struct SourceFuture<F, T> { /* fields omitted */ }
Represents a Future
around a glib::Source
. The future will
be resolved once the source has provided a value
Methods
impl<F, T: 'static> SourceFuture<F, T> where
F: FnOnce(Sender<T>) -> Source + Send + 'static,
[src]
impl<F, T: 'static> SourceFuture<F, T> where
F: FnOnce(Sender<T>) -> Source + Send + 'static,
pub fn new(create_source: F) -> SourceFuture<F, T>
[src]
pub fn new(create_source: F) -> SourceFuture<F, T>
Create a new SourceFuture
The provided closure should return a newly created glib::Source
when called
and pass the value provided by the source to the oneshot sender that is passed
to the closure.
Trait Implementations
impl<F, T> Future for SourceFuture<F, T> where
F: FnOnce(Sender<T>) -> Source + Send + 'static,
[src]
impl<F, T> Future for SourceFuture<F, T> where
F: FnOnce(Sender<T>) -> Source + Send + 'static,
type Item = T
A successful value
type Error = Never
An error
fn poll(&mut self, ctx: &mut Context) -> Result<Async<T>, Never>
[src]
fn poll(&mut self, ctx: &mut Context) -> Result<Async<T>, Never>
Attempt to resolve the future to a final value, registering the current task for wakeup if the value is not yet available. Read more
impl<T, F> Drop for SourceFuture<T, F>
[src]
impl<T, F> Drop for SourceFuture<T, F>
Auto Trait Implementations
impl<F, T> Send for SourceFuture<F, T> where
F: Send,
T: Send,
impl<F, T> Send for SourceFuture<F, T> where
F: Send,
T: Send,
impl<F, T> Sync for SourceFuture<F, T> where
F: Sync,
T: Send,
impl<F, T> Sync for SourceFuture<F, T> where
F: Sync,
T: Send,