Decode from the versioned byte encoding.
(value: u8)
| 44 | impl RefSyncStatus { |
| 45 | /// Decode from the versioned byte encoding. |
| 46 | pub fn from_u8(value: u8) -> Option<Self> { |
| 47 | match value { |
| 48 | 0 => Some(Self::Synchronized), |
| 49 | 1 => Some(Self::GitAhead), |
| 50 | 2 => Some(Self::AtomicAhead), |
| 51 | 3 => Some(Self::Diverged), |
| 52 | 4 => Some(Self::Unrepresentable), |
| 53 | _ => None, |
| 54 | } |
| 55 | } |
| 56 | |
| 57 | /// Encode for the versioned byte encoding. |
| 58 | pub fn to_u8(self) -> u8 { |
nothing calls this directly
no outgoing calls
no test coverage detected