(event: StreamEvent)
| 447 | } |
| 448 | |
| 449 | fn validate_event(event: StreamEvent) -> Result<(), StreamingHpcError> { |
| 450 | if !event.price.is_finite() || event.price <= 0.0 { |
| 451 | return Err(StreamingHpcError::InvalidEvent("price must be finite and > 0")); |
| 452 | } |
| 453 | validate_non_negative_finite("buy_volume", event.buy_volume)?; |
| 454 | validate_non_negative_finite("sell_volume", event.sell_volume)?; |
| 455 | if event.total_volume() <= 0.0 { |
| 456 | return Err(StreamingHpcError::InvalidEvent( |
| 457 | "event must have strictly positive total volume", |
| 458 | )); |
| 459 | } |
| 460 | Ok(()) |
| 461 | } |
no test coverage detected