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

Method effect_for_expected_new

atomic-repository/src/repository/switch.rs:139–156  ·  view source on GitHub ↗
(
        &self,
        path: &str,
        predicate: impl Fn(&EffectValue) -> bool,
    )

Source from the content-addressed store, hash-verified

137 }
138
139 fn effect_for_expected_new(
140 &self,
141 path: &str,
142 predicate: impl Fn(&EffectValue) -> bool,
143 ) -> Option<&EffectPlan> {
144 self.operation
145 .payload()
146 .delta
147 .effects
148 .iter()
149 .rev()
150 .find(|effect| {
151 matches!(
152 &effect.target,
153 EffectTarget::FilesystemPath { path: target } if target == path
154 ) && predicate(&effect.expected_new)
155 })
156 }
157
158 fn execute_effect(
159 &self,

Callers 6

execute_absenceMethod · 0.80
execute_directoryMethod · 0.80
execute_fileMethod · 0.80
create_directoryMethod · 0.80
write_fileMethod · 0.80
remove_pathMethod · 0.80

Calls 3

predicateFunction · 0.85
iterMethod · 0.45
payloadMethod · 0.45

Tested by

no test coverage detected