End,
}
+impl From<DecodingState> for u8 {
+ fn from(val: DecodingState) -> Self {
+ match val {
+ DecodingState::Normal => 0,
+ DecodingState::Waiting => 1,
+ DecodingState::Flush => 2,
+ DecodingState::Prefetch => 3,
+ DecodingState::End => 4,
+ DecodingState::Error => 5,
+ }
+ }
+}
+
impl From<u8> for DecodingState {
fn from(val: u8) -> Self {
match val {
}
}
fn set_state(&self, state: DecodingState) {
- self.state.store(state as u8, Ordering::Release);
+ self.state.store(state.into(), Ordering::Release);
}
fn get_state(&self) -> DecodingState {
self.state.load(Ordering::Acquire).into()