MCPcopy Index your code
hub / github.com/ChrisFeldmeier/OpenCodeRust / remove_part

Method remove_part

crates/opencode-session/src/session.rs:511–520  ·  view source on GitHub ↗

Remove a specific part from a message

(&mut self, msg_id: &str, part_id: &str)

Source from the content-addressed store, hash-verified

509
510 /// Remove a specific part from a message
511 pub fn remove_part(&mut self, msg_id: &str, part_id: &str) -> Option<MessagePart> {
512 let msg = self.get_message_mut(msg_id)?;
513 if let Some(pos) = msg.parts.iter().position(|p| p.id == part_id) {
514 let removed = msg.parts.remove(pos);
515 self.touch();
516 Some(removed)
517 } else {
518 None
519 }
520 }
521
522 // ========================================================================
523 // Usage Aggregation

Callers 2

test_remove_partFunction · 0.80

Calls 5

get_message_mutMethod · 0.80
publish_eventMethod · 0.80
removeMethod · 0.45
touchMethod · 0.45
get_mutMethod · 0.45

Tested by 2

test_remove_partFunction · 0.64