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

Method new

atomic-core/src/crdt/branch.rs:155–162  ·  view source on GitHub ↗

Creates a new branch with the given properties. The branch starts in the [`BranchState::Alive`] state with an empty content hash.

(id: BranchId, trunk: TrunkId)

Source from the content-addressed store, hash-verified

153 /// The branch starts in the [`BranchState::Alive`] state with
154 /// an empty content hash.
155 pub fn new(id: BranchId, trunk: TrunkId) -> Self {
156 Branch {
157 id,
158 trunk,
159 state: BranchState::Alive,
160 line_hash: Self::FNV_OFFSET_BASIS,
161 }
162 }
163
164 /// Creates a new branch with a pre-computed hash.
165 pub fn with_hash(id: BranchId, trunk: TrunkId, line_hash: u64) -> Self {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected