pub trait PathFormatter {
type Output;
// Required method
fn format(&self, commands: &[PathCommand]) -> Self::Output;
}Expand description
将通用路径命令转换成具体后端输出的扩展契约。
库内置 SVG path data formatter;Godot、Canvas、函数调用列表等格式可以在库外实现
这个 trait,并通过 crate::SmoothPath::export_with 复用同一份路径中间表示。
Required Associated Types§
Required Methods§
Sourcefn format(&self, commands: &[PathCommand]) -> Self::Output
fn format(&self, commands: &[PathCommand]) -> Self::Output
将路径命令格式化为目标输出。