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

Method new

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

Create a new shared view state with the given name and no parent. This is the default constructor for backward compatibility. New code should prefer [`ViewState::with_scope`] for explicit scope/parent. # Example ``` use atomic_core::pristine::ViewState; let view = ViewState::new(1, "main".to_string()); assert_eq!(view.id, 1); assert_eq!(view.name, "main"); assert_eq!(view.change_count, 0); ass

(id: u64, name: String)

Source from the content-addressed store, hash-verified

589 /// assert!(view.parent.is_none());
590 /// ```
591 pub fn new(id: u64, name: String) -> Self {
592 Self {
593 id,
594 name,
595 state: Merkle::ZERO,
596 change_count: 0,
597 kind: ViewScope::Shared,
598 parent: None,
599 }
600 }
601
602 /// Create a new view with explicit scope and parent.
603 ///

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected