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

Method to_text

atomic-repository/src/manifest.rs:145–164  ·  view source on GitHub ↗

Serialize to the text wire format.

(&self)

Source from the content-addressed store, hash-verified

143
144 /// Serialize to the text wire format.
145 pub fn to_text(&self) -> String {
146 let scope = if self.scope.is_draft() {
147 "draft"
148 } else {
149 "shared"
150 };
151 let parent = self.parent.as_deref().unwrap_or(NONE_FIELD);
152 let state = if self.changes.is_empty() {
153 NONE_FIELD.to_string()
154 } else {
155 self.state.to_base32()
156 };
157
158 let mut out = format!("{}\t{}\t{}\t{}\n", self.name, scope, parent, state);
159 for hash in &self.changes {
160 out.push_str(&hash.to_base32());
161 out.push('\n');
162 }
163 out
164 }
165
166 /// Parse the text wire format.
167 ///

Calls 4

is_draftMethod · 0.45
is_emptyMethod · 0.45
to_base32Method · 0.45
pushMethod · 0.45