pub trait PdfMarkdownProcessor: Send + Sync {
// Required method
fn process(
&self,
input: &PdfInput,
document: PdfDocumentModel,
) -> Result<(PdfDocumentModel, Vec<MarkdownWarning>)>;
// Provided method
fn capabilities(&self) -> MarkdownProcessorCapabilities { ... }
}Expand description
在基础文本提取之后、Markdown 渲染之前增强语义文档模型。
实现可对接表格检测、图片提取、页面渲染 OCR 或领域专用结构识别。 处理器接收原始输入描述和上一个处理器产出的模型,并返回新的模型; 因而多个处理器可按注册顺序确定性组合,且无需让核心 crate 依赖具体 OCR/AI SDK。
Required Methods§
Sourcefn process(
&self,
input: &PdfInput,
document: PdfDocumentModel,
) -> Result<(PdfDocumentModel, Vec<MarkdownWarning>)>
fn process( &self, input: &PdfInput, document: PdfDocumentModel, ) -> Result<(PdfDocumentModel, Vec<MarkdownWarning>)>
Provided Methods§
Sourcefn capabilities(&self) -> MarkdownProcessorCapabilities
fn capabilities(&self) -> MarkdownProcessorCapabilities
返回处理器能够真正提供的能力。
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".