1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
use core::fmt;
use core::future;
use core::pin;
use core::task;

/// Future if the inner impls Future
impl<D: ::DataBuf, T: ?Sized> future::Future for super::ValueA<T, D>
where
    T: future::Future,
{
    type Output = T::Output;
    fn poll(self: pin::Pin<&mut Self>, cx: &mut task::Context) -> task::Poll<Self::Output> {
        unsafe { pin::Pin::new_unchecked(&mut **self.get_unchecked_mut()).poll(cx) }
    }
}

impl<D: ::DataBuf, T: ?Sized> fmt::Display for super::ValueA<T, D>
where
    T: fmt::Display,
{
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        (**self).fmt(f)
    }
}

impl<D: ::DataBuf, T: ?Sized> fmt::Debug for super::ValueA<T, D>
where
    T: fmt::Debug,
{
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        (**self).fmt(f)
    }
}