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

Method from_segment

atomic-objects/src/sync.rs:104–114  ·  view source on GitHub ↗

Parse a family from its storage key segment; `None` for an unknown one.

(s: &str)

Source from the content-addressed store, hash-verified

102
103 /// Parse a family from its storage key segment; `None` for an unknown one.
104 pub fn from_segment(s: &str) -> Option<Self> {
105 match s {
106 "changes" => Some(ObjectFamily::Change),
107 "tags" => Some(ObjectFamily::Tag),
108 "provenance" => Some(ObjectFamily::Provenance),
109 "attest" => Some(ObjectFamily::Attest),
110 "views" => Some(ObjectFamily::View),
111 "conflicts" => Some(ObjectFamily::Conflict),
112 _ => None,
113 }
114 }
115
116 /// Every family, for iteration (inventory scans, closure walks).
117 pub fn all() -> [ObjectFamily; 6] {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected