use crate::lmd::MatchDistance;
use crate::types::{ShortBuffer, ShortWriter};
use super::backend_type::BackendType;
use std::io;
pub trait Backend {
type Type: BackendType;
fn init<O: ShortWriter>(&mut self, dst: &mut O, len: Option<u32>) -> io::Result<()>;
fn push_literals<I: ShortBuffer, O: ShortWriter>(
&mut self,
dst: &mut O,
literals: I,
) -> io::Result<()>;
fn push_match<I: ShortBuffer, O: ShortWriter>(
&mut self,
dst: &mut O,
literals: I,
match_len: u32,
match_distance: MatchDistance<Self::Type>,
) -> io::Result<()>;
fn finalize<O: ShortWriter>(&mut self, dst: &mut O) -> io::Result<()>;
}