use marque_ism::MarkingCandidate;
use marque_rules::Diagnostic;
#[derive(Debug, thiserror::Error)]
pub enum SourceError {
#[error("I/O error: {0}")]
Io(#[from] std::io::Error),
#[error("Source error: {0}")]
Other(String),
}
#[derive(Debug)]
pub struct TextChunk {
pub offset: usize,
pub data: Vec<u8>,
}
pub trait Source: futures_core::Stream<Item = Result<TextChunk, SourceError>> + Send {}
impl<T> Source for T where T: futures_core::Stream<Item = Result<TextChunk, SourceError>> + Send {}
pub trait Sink: Send {
fn accept_diagnostic(&mut self, diag: Diagnostic);
fn accept_candidate(&mut self, candidate: MarkingCandidate);
}