Skip to main content

Document

Struct Document 

Source
pub struct Document { /* private fields */ }
Expand description

持有整本样式文档的数值样本,跨阶段不创建 Python 字符对象。

Implementations§

Source§

impl Document

Source

pub fn append( &mut self, page: i64, source: i64, height: f64, records: Vec<Sample>, )

接收已完成坐标转换和字体编码的一行,保持重复来源行的成员追加次序。

Source

pub fn prepare( self, families: &[usize], legacy: Option<Vec<(Option<[f64; 4]>, [f64; 2], i32)>>, ) -> Option<Prepared>

只在 Rust 内生成完整前置数据,样本坐标不经过 Python 往返。

Source

pub fn finish( self, families: Vec<usize>, ) -> Option<(Vec<usize>, Vec<((i64, i64), f64)>, Vec<(usize, usize, usize, Option<f64>, Option<f64>, f64, f64, bool, bool, bool)>)>

样式分支只返回最终诊断,消费完成即释放全部字符数据。

Trait Implementations§

Source§

impl Default for Document

Source§

fn default() -> Document

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.