Add a selectable implementation for *packet_header

This commit is contained in:
Eric Holk 2012-08-06 18:29:05 -07:00
parent 184da12896
commit 8d1922d4c8

View File

@ -624,6 +624,10 @@ trait selectable {
pure fn header() -> *packet_header;
}
impl of selectable for *packet_header {
pure fn header() -> *packet_header { self }
}
/// Returns the index of an endpoint that is ready to receive.
fn selecti<T: selectable>(endpoints: &[T]) -> uint {
wait_many(endpoints.map(|p| p.header()))