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

Method expand_position

atomic-core/src/change/format_v3/compact/compactor.rs:164–170  ·  view source on GitHub ↗

Convert a [`CompactPosition`] to a `Position >`. # Errors Returns [`FormatError::HashIndexOutOfBounds`](super::super::error::FormatError::HashIndexOutOfBounds) if the index is invalid.

(&self, pos: &CompactPosition)

Source from the content-addressed store, hash-verified

162 /// Returns [`FormatError::HashIndexOutOfBounds`](super::super::error::FormatError::HashIndexOutOfBounds)
163 /// if the index is invalid.
164 pub fn expand_position(&self, pos: &CompactPosition) -> FormatResult<Position<Option<Hash>>> {
165 let change = self.index_to_hash(pos.change)?;
166 Ok(Position {
167 change,
168 pos: ChangePosition::new(pos.pos as u64),
169 })
170 }
171
172 /// Convert a [`CompactGraphNode`] to a `GraphNode<Option<Hash>>`.
173 pub fn expand_graph_node(

Calls 1

index_to_hashMethod · 0.80