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

Method id

crates/opencode-session/src/message_v2.rs:444–459  ·  view source on GitHub ↗

Get the ID of this part, regardless of variant

(&self)

Source from the content-addressed store, hash-verified

442impl Part {
443 /// Get the ID of this part, regardless of variant
444 pub fn id(&self) -> Option<&str> {
445 match self {
446 Part::Text { id, .. } => Some(id),
447 Part::Subtask(p) => Some(&p.id),
448 Part::Reasoning { id, .. } => Some(id),
449 Part::File(p) => Some(&p.id),
450 Part::Tool(p) => Some(&p.id),
451 Part::StepStart(p) => Some(&p.id),
452 Part::StepFinish(p) => Some(&p.id),
453 Part::Snapshot { id, .. } => Some(id),
454 Part::Patch { id, .. } => Some(id),
455 Part::Agent(p) => Some(&p.id),
456 Part::Retry(p) => Some(&p.id),
457 Part::Compaction(p) => Some(&p.id),
458 }
459 }
460}
461
462#[derive(Debug, Clone, Serialize, Deserialize)]

Callers 1

list_modelsFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected