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

Method new

atomic-core/src/crdt/leaf.rs:156–165  ·  view source on GitHub ↗

Creates a new leaf with the given properties. The leaf starts in the [`LeafState::Alive`] state.

(id: LeafId, branch: BranchId, kind: TokenKind, content_range: Range<u32>)

Source from the content-addressed store, hash-verified

154 ///
155 /// The leaf starts in the [`LeafState::Alive`] state.
156 pub fn new(id: LeafId, branch: BranchId, kind: TokenKind, content_range: Range<u32>) -> Self {
157 Leaf {
158 id,
159 branch,
160 kind,
161 content_start: content_range.start,
162 content_end: content_range.end,
163 state: LeafState::Alive,
164 }
165 }
166
167 /// Returns the leaf's unique identifier.
168 #[inline]

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected