MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / from_u8

Method from_u8

atomic-core/src/pristine/ref_mapping.rs:46–55  ·  view source on GitHub ↗

Decode from the versioned byte encoding.

(value: u8)

Source from the content-addressed store, hash-verified

44impl 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 {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected