#![cfg_attr(test, allow(clippy::unwrap_used))]
mod coverage;
mod decode;
mod detect;
mod dialect;
mod loss;
include!("dialect/registry_ids.rs");
use cadmpeg_core::decode::{DecodeContext, View};
use cadmpeg_core::dialect::DialectId;
use cadmpeg_core::CodecError;
use cadmpeg_ir::codec::{CodecBackend, Confidence, Decoded, FormatId};
use cadmpeg_ir::ContainerSummary;
pub struct SatCodec;
impl CodecBackend for SatCodec {
const FORMAT: FormatId = FormatId::new(FORMAT);
fn detect_impl(
&self,
_ctx: &cadmpeg_core::decode::DecodeContext<'_>,
prefix: cadmpeg_core::decode::View<'_>,
) -> Result<Confidence, cadmpeg_core::CodecError> {
Ok(detect::confidence(prefix.window()))
}
fn inspect_impl(
&self,
ctx: &DecodeContext<'_>,
root: View<'_>,
) -> Result<ContainerSummary, CodecError> {
detect::inspect(ctx, root)
}
fn decode_impl(&self, ctx: &DecodeContext<'_>, root: View<'_>) -> Result<Decoded, CodecError> {
decode::decode(ctx, root.window())
}
}
#[cfg(test)]
mod golden_tests;
#[cfg(test)]
pub(crate) mod test_support;
#[cfg(test)]
mod integration_tests;