(&self, hook_type: HookType, input: &[u8])
| 163 | } |
| 164 | |
| 165 | fn parse_json(&self, hook_type: HookType, input: &[u8]) -> AgentResult<Value> { |
| 166 | if input.is_empty() { |
| 167 | return Err(AgentError::HookInputEmpty { |
| 168 | agent: self.name().to_string(), |
| 169 | hook_type: hook_type.as_str().to_string(), |
| 170 | }); |
| 171 | } |
| 172 | |
| 173 | serde_json::from_slice(input).map_err(|e| AgentError::HookParseFailed { |
| 174 | agent: self.name().to_string(), |
| 175 | hook_type: hook_type.as_str().to_string(), |
| 176 | reason: e.to_string(), |
| 177 | }) |
| 178 | } |
| 179 | |
| 180 | fn parse_value<T: for<'de> Deserialize<'de>>( |
| 181 | &self, |
no test coverage detected