pub struct RowData<'a> {
pub row_index: u32,
pub sheet: &'a str,
pub header: &'a HeaderMap,
pub cells: &'a [Cell],
pub images: &'a [RowImage],
pub merges: &'a [MergeRange],
pub styles: &'a Styles,
pub hyperlinks: &'a [Hyperlink],
pub comments: &'a [Comment],
pub validations: &'a [DataValidation],
pub conditional_formats: &'a [ConditionalFormat],
}Expand description
一行原始数据(解析后、映射前)
Fields§
§row_index: u32Excel 行号(1 基)
sheet: &'a str工作表名
header: &'a HeaderMap表头解析结果(含列序对应关系)
cells: &'a [Cell]本行单元格(可能稀疏:空单元格不出现)
images: &'a [RowImage]本行图片(仅当开启读图)
merges: &'a [MergeRange]与本行相交的合并区域(仅当开启合并读取;见 crate::ReadOptions::with_merges)
styles: &'a Styles单元格样式表(判断字体颜色 / 底色 / 加粗 / 斜体)
hyperlinks: &'a [Hyperlink]本工作表的超链接(仅当 crate::ReadOptions::with_hyperlinks 开启时非空)
comments: &'a [Comment]本工作表的批注(仅当 crate::ReadOptions::with_comments 开启时非空)
validations: &'a [DataValidation]本工作表的数据验证(仅当 crate::ReadOptions::with_validations 开启时非空)
conditional_formats: &'a [ConditionalFormat]本工作表的条件格式(仅当 crate::ReadOptions::with_conditional_formats 开启时非空)
Implementations§
Source§impl<'a> RowData<'a>
impl<'a> RowData<'a>
pub fn value_of(&self, header: &str) -> Option<&CellValue>
pub fn text_of(&self, header: &str) -> String
Sourcepub fn merged_at(&self, col: u16) -> Option<&MergeRange>
pub fn merged_at(&self, col: u16) -> Option<&MergeRange>
本行是否落在某个合并区域内(返回该区域)
Sourcepub fn cell_style(&self, header: &str) -> Option<CellStyle>
pub fn cell_style(&self, header: &str) -> Option<CellStyle>
某列的样式(底色 / 字体颜色 / 加粗 / 斜体);列不存在返回 None
Sourcepub fn comment_at(&self, col: u16) -> Option<&Comment>
pub fn comment_at(&self, col: u16) -> Option<&Comment>
某列的批注
Sourcepub fn validation_at(&self, col: u16) -> Option<&DataValidation>
pub fn validation_at(&self, col: u16) -> Option<&DataValidation>
某列命中的数据验证(下拉 / 数值区间)
Sourcepub fn conditional_format_at(&self, col: u16) -> Option<&ConditionalFormat>
pub fn conditional_format_at(&self, col: u16) -> Option<&ConditionalFormat>
某列命中的条件格式
Sourcepub fn comment_of(&self, header: &str) -> Option<&str>
pub fn comment_of(&self, header: &str) -> Option<&str>
某列的批注文本
Sourcepub fn to_text_row(&self) -> Vec<String>
pub fn to_text_row(&self) -> Vec<String>
把本行的单元格按文件列序转换为文本(错误报告 / 预览用)
Sourcepub fn missing_columns(&self) -> Vec<String>
pub fn missing_columns(&self) -> Vec<String>
未在表头出现但模型声明过的列(用于区分“缺列“与“空值“)
Auto Trait Implementations§
impl<'a> Freeze for RowData<'a>
impl<'a> RefUnwindSafe for RowData<'a>
impl<'a> Send for RowData<'a>
impl<'a> Sync for RowData<'a>
impl<'a> Unpin for RowData<'a>
impl<'a> UnsafeUnpin for RowData<'a>
impl<'a> UnwindSafe for RowData<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more