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

Function effect_at

atomic-repository/src/repository/operation.rs:4644–4657  ·  view source on GitHub ↗
(operation: &Operation, ordinal: u32)

Source from the content-addressed store, hash-verified

4642}
4643
4644fn effect_at(operation: &Operation, ordinal: u32) -> Result<&EffectPlan, RepositoryError> {
4645 operation
4646 .payload()
4647 .delta
4648 .effects
4649 .get(ordinal as usize)
4650 .filter(|effect| effect.ordinal == ordinal)
4651 .ok_or_else(|| RepositoryError::InvalidOperation {
4652 message: format!(
4653 "operation {} has no effect ordinal {ordinal}",
4654 operation.id()
4655 ),
4656 })
4657}
4658
4659pub(super) fn working_copy_state_ref(record: WorkingCopyRecord) -> WorkingCopyStateRef {
4660 WorkingCopyStateRef {

Calls 2

getMethod · 0.65
payloadMethod · 0.45

Tested by

no test coverage detected