fn wait_for_message(socket: &mut CrasServerSocket) -> Result<ServerResult> {
        #[derive(PollToken)]
        enum Token {
            ServerMsg,
        }
        let poll_ctx: PollContext<Token> =
            PollContext::new().and_then(|pc| pc.add(socket, Token::ServerMsg).and(Ok(pc)))?;

        let events = poll_ctx.wait()?;
        // Check the first readable message
        let tokens: Vec<Token> = events.iter_readable().map(|e| e.token()).collect();
        tokens
            .get(0)
            .ok_or(Error::UnexpectedExit)
            .and_then(|ref token| {
                match token {
                    Token::ServerMsg => ServerResult::handle_server_message(socket),
                }
                .map_err(Into::into)
            })
    }
// Blocks handling the first server message received from `socket`.
Blocks handling the first server message received from `socket`.
Blocks handling the first server message received from ` socket ` .
fn wait_for_message(socket: &mut CrasServerSocket) -> Result<ServerResult> {
        #[derive(PollToken)]
        enum Token {
            ServerMsg,
        }
        let poll_ctx: PollContext<Token> =
            PollContext::new().and_then(|pc| pc.add(socket, Token::ServerMsg).and(Ok(pc)))?;
        let events = poll_ctx.wait()?;
        // Check the first readable message
        let tokens: Vec<Token> = events.iter_readable().map(|e| e.token()).collect();
        tokens
            .get(0)
            .ok_or(Error::UnexpectedExit)
            .and_then(|ref token| {
                match token {
                    Token::ServerMsg => ServerResult::handle_server_message(socket),
                }
                .map_err(Into::into)
            })
    }
fn wait_for_message ( socket : & mut CrasServerSocket ) -> Result < ServerResult > { # [ derive ( PollToken ) ] enum Token { ServerMsg , } let poll_ctx : PollContext < Token > = PollContext :: new ( ) . and_then ( | pc | pc . add ( socket , Token :: ServerMsg ) . and ( Ok ( pc ) ) ) ? ; let events = poll_ctx . wait ( ) ? ; // Check the first readable message let tokens : Vec < Token > = events . iter_readable ( ) . map ( | e | e . token ( ) ) . collect ( ) ; tokens . get ( 0 ) . ok_or ( Error :: UnexpectedExit ) . and_then ( | ref token | { match token { Token :: ServerMsg => ServerResult :: handle_server_message ( socket ) , } . map_err ( Into :: into ) } ) }
Blocks handling the first server message received from `socket`.
Blocks handling the first server message received from ` socket ` .
socket
&mut CrasServerSocket
socket
&mut CrasServerSocket