(&self, hook_type: HookType, input: &[u8])
| 178 | } |
| 179 | |
| 180 | fn parse_json(&self, hook_type: HookType, input: &[u8]) -> AgentResult<Value> { |
| 181 | if input.is_empty() { |
| 182 | return Err(AgentError::HookInputEmpty { |
| 183 | agent: self.name().to_string(), |
| 184 | hook_type: hook_type.as_str().to_string(), |
| 185 | }); |
| 186 | } |
| 187 | |
| 188 | serde_json::from_slice(input).map_err(|e| AgentError::HookParseFailed { |
| 189 | agent: self.name().to_string(), |
| 190 | hook_type: hook_type.as_str().to_string(), |
| 191 | reason: e.to_string(), |
| 192 | }) |
| 193 | } |
| 194 | |
| 195 | fn parse_value<T: for<'de> Deserialize<'de>>( |
| 196 | &self, |
no test coverage detected