mirror of
https://github.com/fawney19/Aether.git
synced 2026-10-06 17:37:47 +08:00
18 lines
568 B
Rust
18 lines
568 B
Rust
//! Compatibility facade for execution stream framing.
|
|
|
|
use std::io::Error as IoError;
|
|
|
|
use aether_contracts::StreamFrame;
|
|
use axum::body::Bytes;
|
|
|
|
use crate::GatewayError;
|
|
|
|
pub(crate) fn encode_stream_frame_ndjson(frame: &StreamFrame) -> Result<Bytes, IoError> {
|
|
aether_gateway_execution::stream::encode_stream_frame_ndjson(frame)
|
|
}
|
|
|
|
pub(crate) fn decode_stream_frame_ndjson(line: &[u8]) -> Result<StreamFrame, GatewayError> {
|
|
aether_gateway_execution::stream::decode_stream_frame_ndjson(line)
|
|
.map_err(|err| GatewayError::Internal(err.to_string()))
|
|
}
|