codec/packet: expose predicates for packet flags

This commit is contained in:
Aman Gupta 2015-08-13 17:25:29 -07:00 committed by meh
parent 03b1d25fde
commit 83d3156c62

View File

@ -67,6 +67,14 @@ impl Packet {
self.0.flags = value.bits();
}
pub fn is_key(&self) -> bool {
self.flags().contains(flag::KEY)
}
pub fn is_corrupt(&self) -> bool {
self.flags().contains(flag::CORRUPT)
}
pub fn stream(&self) -> usize {
self.0.stream_index as usize
}