2026-07-15 23:47:19 +08:00
|
|
|
//! Compatibility facade for execution stream framing.
|
|
|
|
|
|
2026-04-03 14:59:58 +08:00
|
|
|
use std::io::Error as IoError;
|
|
|
|
|
|
|
|
|
|
use aether_contracts::StreamFrame;
|
|
|
|
|
use axum::body::Bytes;
|
|
|
|
|
|
2026-04-05 20:23:16 +08:00
|
|
|
use crate::GatewayError;
|
2026-04-03 14:59:58 +08:00
|
|
|
|
|
|
|
|
pub(crate) fn encode_stream_frame_ndjson(frame: &StreamFrame) -> Result<Bytes, IoError> {
|
2026-07-15 23:47:19 +08:00
|
|
|
aether_gateway_execution::stream::encode_stream_frame_ndjson(frame)
|
2026-04-03 14:59:58 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
pub(crate) fn decode_stream_frame_ndjson(line: &[u8]) -> Result<StreamFrame, GatewayError> {
|
2026-07-15 23:47:19 +08:00
|
|
|
aether_gateway_execution::stream::decode_stream_frame_ndjson(line)
|
|
|
|
|
.map_err(|err| GatewayError::Internal(err.to_string()))
|
2026-04-03 14:59:58 +08:00
|
|
|
}
|