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

Method from_u8

atomic-core/src/pristine/traits/view.rs:458–464  ·  view source on GitHub ↗

Convert from a raw u8 value. Returns `None` if the value is not a valid `ViewScope`.

(value: u8)

Source from the content-addressed store, hash-verified

456 ///
457 /// Returns `None` if the value is not a valid `ViewScope`.
458 pub fn from_u8(value: u8) -> Option<Self> {
459 match value {
460 0 => Some(Self::Draft),
461 1 => Some(Self::Shared),
462 _ => None,
463 }
464 }
465}
466
467impl std::fmt::Display for ViewScope {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected