use sim_kernel::{Expr, Result};
use sim_lib_stream_core::{
StreamCassette, StreamGoldenFixtureReport, StreamValue, TransportProfile,
};
pub fn stream_to_cassette(
stream: &StreamValue,
profile: TransportProfile,
) -> Result<StreamCassette> {
StreamCassette::from_stream_value(stream, profile)
}
pub fn stream_to_cassette_expr(stream: &StreamValue, profile: TransportProfile) -> Result<Expr> {
Ok(stream_to_cassette(stream, profile)?.to_expr())
}
pub fn cassette_expr_to_stream(expr: &Expr) -> Result<StreamValue> {
StreamCassette::from_expr(expr)?.replay_stream_value()
}
pub fn cassette_to_stream(cassette: &StreamCassette) -> Result<StreamValue> {
cassette.replay_stream_value()
}
pub fn validate_cassette_fixture_path(
cassette: &StreamCassette,
path: &str,
) -> Result<StreamGoldenFixtureReport> {
cassette.validate_golden_fixture(path)
}