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

Method trunk

atomic-core/src/change/ops.rs:344–352  ·  view source on GitHub ↗
(
            id: &mut TrunkId,
            f: &mut impl FnMut(crate::types::NodeId) -> Result<crate::types::NodeId, E>,
        )

Source from the content-addressed store, hash-verified

342 Ok(mapping[&id])
343 };
344 fn trunk<E>(
345 id: &mut TrunkId,
346 f: &mut impl FnMut(crate::types::NodeId) -> Result<crate::types::NodeId, E>,
347 ) -> Result<(), E> {
348 if !id.change_id().is_root() {
349 *id = TrunkId::new(f(id.change_id())?, id.file_idx());
350 }
351 Ok(())
352 }
353 fn branch<E>(
354 id: &mut BranchId,
355 f: &mut impl FnMut(crate::types::NodeId) -> Result<crate::types::NodeId, E>,

Callers

nothing calls this directly

Calls 3

file_idxMethod · 0.80
is_rootMethod · 0.45
change_idMethod · 0.45

Tested by

no test coverage detected