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

Method from_local

atomic-cli/src/commands/view/list.rs:681–695  ·  view source on GitHub ↗
(info: &atomic_repository::ViewInfo, current: bool)

Source from the content-addressed store, hash-verified

679
680impl JsonView {
681 pub(crate) fn from_local(info: &atomic_repository::ViewInfo, current: bool) -> Self {
682 Self {
683 name: info.name.clone(),
684 current,
685 scope: info.kind_label().to_string(),
686 parent: info.parent_name.clone(),
687 change_count: info
688 .own_change_count
689 .saturating_add(info.inherited_change_count),
690 own_change_count: Some(info.own_change_count),
691 inherited_change_count: Some(info.inherited_change_count),
692 state: Some(info.state_base32()),
693 set_id: None,
694 }
695 }
696
697 /// One view off the wire's ViewInfo — the routed twin of
698 /// [`JsonView::from_local`]: the handler classifies own/inherited

Callers

nothing calls this directly

Calls 3

kind_labelMethod · 0.80
state_base32Method · 0.80
cloneMethod · 0.45

Tested by

no test coverage detected