MCPcopy Create free account
hub / github.com/ChrisFeldmeier/OpenCodeRust / new

Method new

crates/opencode-plugin/src/lib.rs:95–102  ·  view source on GitHub ↗
(event: HookEvent)

Source from the content-addressed store, hash-verified

93
94impl HookContext {
95 pub fn new(event: HookEvent) -> Self {
96 Self {
97 event,
98 data: HashMap::new(),
99 session_id: None,
100 timestamp: Utc::now(),
101 }
102 }
103
104 pub fn with_data(mut self, key: &str, value: serde_json::Value) -> Self {
105 self.data.insert(key.to_string(), value);

Callers

nothing calls this directly

Calls 1

newFunction · 0.85

Tested by

no test coverage detected