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

Method from_info

atomic-cli/src/commands/view/list.rs:166–184  ·  view source on GitHub ↗
(info: ViewInfo, current: &str)

Source from the content-addressed store, hash-verified

164
165impl ViewEntry {
166 fn from_info(info: ViewInfo, current: &str) -> Self {
167 let kind = match info.kind_label() {
168 "draft" => "draft",
169 _ => "shared",
170 };
171 let is_current = info.name == current;
172 let state_short = info.state_short();
173 ViewEntry {
174 name: info.name,
175 parent: info.parent_name,
176 own_change_count: info.own_change_count,
177 change_count: info.change_count,
178 inherited_change_count: info.inherited_change_count,
179 kind,
180 state_short,
181 is_current,
182 has_info: true,
183 }
184 }
185
186 /// A name-only entry used when view metadata is unavailable. Treated as
187 /// having changes so it is never hidden from the listing.

Callers

nothing calls this directly

Calls 2

kind_labelMethod · 0.80
state_shortMethod · 0.80

Tested by

no test coverage detected