#![cfg_attr(test, allow(clippy::unwrap_used))]
mod decode;
mod detect;
#[allow(dead_code)] mod loss;
use cadmpeg_core::decode::{DecodeContext, View};
use cadmpeg_core::{CodecError, ContainerSummary};
use cadmpeg_ir::codec::{CodecBackend, Confidence, DecodeResult};
pub(crate) const FORMAT: &str = "sat";
pub struct SatCodec;
impl CodecBackend for SatCodec {
fn id(&self) -> &'static str {
FORMAT
}
fn detect(&self, prefix: &[u8]) -> Confidence {
detect::confidence(prefix)
}
fn inspect_impl(
&self,
ctx: &DecodeContext<'_>,
root: View<'_>,
) -> Result<ContainerSummary, CodecError> {
detect::inspect(ctx, root)
}
fn decode_impl(
&self,
ctx: &DecodeContext<'_>,
root: View<'_>,
) -> Result<DecodeResult, CodecError> {
decode::decode(ctx, root.window())
}
}
#[cfg(test)]
mod golden_tests;
#[cfg(test)]
pub(crate) mod test_support;