pub fn send<'s: 'c, T>(
        &mut self,
        chan: &'s Sender<T>,
        val: T,
    ) -> SelectSendHandle<'s, T> {
        let mut choice = SendChoice {
            chan: chan,
            guard: None,
            id: None,
            val: Some(val),
        };
        match self.choices.entry(chan.id()) {
            Entry::Occupied(mut prev_choice) => {
                choice.id = prev_choice.get().subscription();
                *prev_choice.get_mut() = Box::new(choice);
            }
            Entry::Vacant(spot) => {
                assert!(self.ids.is_none(),
                        "cannot add new channels after initial select");
                spot.insert(Box::new(choice));
            }
        }
        SelectSendHandle { chan: chan }
    }
/// Register a new send operation with the select.
Register a new send operation with the select.
Register a new send operation with the select .
pub fn send<'s: 'c, T>(
        &mut self,
        chan: &'s Sender<T>,
        val: T,
    ) -> SelectSendHandle<'s, T> {
        let mut choice = SendChoice {
            chan: chan,
            guard: None,
            id: None,
            val: Some(val),
        };
        match self.choices.entry(chan.id()) {
            Entry::Occupied(mut prev_choice) => {
                choice.id = prev_choice.get().subscription();
                *prev_choice.get_mut() = Box::new(choice);
            }
            Entry::Vacant(spot) => {
                assert!(self.ids.is_none(),
                        "cannot add new channels after initial select");
                spot.insert(Box::new(choice));
            }
        }
        SelectSendHandle { chan: chan }
    }
pub fn send < ' s : ' c , T > ( & mut self , chan : & ' s Sender < T > , val : T , ) -> SelectSendHandle < ' s , T > { let mut choice = SendChoice { chan : chan , guard : None , id : None , val : Some ( val ) , } ; match self . choices . entry ( chan . id ( ) ) { Entry :: Occupied ( mut prev_choice ) => { choice . id = prev_choice . get ( ) . subscription ( ) ; * prev_choice . get_mut ( ) = Box :: new ( choice ) ; } Entry :: Vacant ( spot ) => { assert ! ( self ids is_none ( ) " " ) ; spot . insert ( Box :: new ( choice ) ) ; } } SelectSendHandle { chan : chan } }
Register a new send operation with the select.
Register a new send operation with the select .
&mut self
chan
&'s Sender<T>
val
T
&mut self
chan
&'s Sender<T>
val
T