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

Function effect_at

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

Source from the content-addressed store, hash-verified

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

Calls 2

getMethod · 0.65
payloadMethod · 0.45

Tested by

no test coverage detected