pub fn channel<T>() -> (Sender<T>, Receiver<T>) {
    let inner = Arc::new(Inner {
        state: AtomicUsize::new(State::new().as_usize()),
        value: CausalCell::new(None),
        tx_task: CausalCell::new(ManuallyDrop::new(unsafe { mem::uninitialized() })),
        rx_task: CausalCell::new(ManuallyDrop::new(unsafe { mem::uninitialized() })),
    });

    let tx = Sender {
        inner: Some(inner.clone()),
    };
    let rx = Receiver { inner: Some(inner) };

    (tx, rx)
}
/// Create a new one-shot channel for sending single values across asynchronous
/// tasks.
///
/// The function returns separate "send" and "receive" handles. The `Sender`
/// handle is used by the producer to send the value. The `Receiver` handle is
/// used by the consumer to receive the value.
///
/// Each handle can be used on separate tasks.
///
/// # Examples
///
/// ```
/// extern crate futures;
/// extern crate tokio;
///
/// use tokio::sync::oneshot;
/// use futures::Future;
/// use std::thread;
///
/// let (sender, receiver) = oneshot::channel::<i32>();
///
/// # let t =
/// thread::spawn(|| {
///     let future = receiver.map(|i| {
///         println!("got: {:?}", i);
///     });
///     // ...
/// # return future;
/// });
///
/// sender.send(3).unwrap();
/// # t.join().unwrap().wait().unwrap();
/// ```
Create a new one-shot channel for sending single values across asynchronous
tasks.

The function returns separate "send" and "receive" handles. The `Sender`
handle is used by the producer to send the value. The `Receiver` handle is
used by the consumer to receive the value.

Each handle can be used on separate tasks.
Create a new one - shot channel for sending single values across asynchronous tasks . The function returns separate " send " and " receive " handles . The ` Sender ` handle is used by the producer to send the value . The ` Receiver ` handle is used by the consumer to receive the value . Each handle can be used on separate tasks .
pub fn channel<T>() -> (Sender<T>, Receiver<T>) {
    let inner = Arc::new(Inner {
        state: AtomicUsize::new(State::new().as_usize()),
        value: CausalCell::new(None),
        tx_task: CausalCell::new(ManuallyDrop::new(unsafe { mem::uninitialized() })),
        rx_task: CausalCell::new(ManuallyDrop::new(unsafe { mem::uninitialized() })),
    });
    let tx = Sender {
        inner: Some(inner.clone()),
    };
    let rx = Receiver { inner: Some(inner) };
    (tx, rx)
}
pub fn channel < T > ( ) -> ( Sender < T > , Receiver < T > ) { let inner = Arc :: new ( Inner { state : AtomicUsize :: new ( State :: new ( ) . as_usize ( ) ) , value : CausalCell :: new ( None ) , tx_task : CausalCell :: new ( ManuallyDrop :: new ( unsafe { mem :: uninitialized ( ) } ) ) , rx_task : CausalCell :: new ( ManuallyDrop :: new ( unsafe { mem :: uninitialized ( ) } ) ) , } ) ; let tx = Sender { inner : Some ( inner . clone ( ) ) , } ; let rx = Receiver { inner : Some ( inner ) } ; ( tx , rx ) }
Create a new one-shot channel for sending single values across asynchronous
tasks.
Create a new one - shot channel for sending single values across asynchronous tasks .
examples
```
extern crate futures;
extern crate tokio.

use tokio::sync::oneshot;
use futures::Future;
use std::thread.

let (sender, receiver) = oneshot::channel::().
` ` ` extern crate futures ; extern crate tokio . use tokio :: sync :: oneshot ; use futures :: Future ; use std :: thread . let ( sender receiver ) = oneshot :: channel :: () .
let t 
None
return future;
None
t.join().unwrap().wait().unwrap();
None