Workbook

概述

Workbook 是 Aspose.Cells 为 Rust 提供的 FOSS 中的结构体。继承自:Debug、Clone、PartialEq,以及另外 1 个。

表示用于创建、加载、修改和保存 XLSX 工作簿的根电子表格对象。

此结构体为 Rust 程序中的 Workbook 对象声明了 58 个方法。可用的方法包括:add_worksheet、default、defined_names、dispose、document_properties、get_defined_names、get_document_properties、get_document_properties_mut、get_load_diagnostics、get_properties、get_properties_mut、get_protection,以及另外 46 个方法。公共成员在安装 Aspose.Cells FOSS for Rust 包后,可供任何 Rust 应用程序访问。

方法

签名描述
default() → Self在此 Workbook 实例上调用 default。
new() → Self初始化一个新实例。
add_worksheet(name: impl Into<String>) → Result<usize, CellsError>添加一个项目。
worksheet(name: &str) → Result<&Worksheet, CellsError>获取具有指定名称的工作表。
worksheet_or_cells_exception(name: &str) → Result<&Worksheet, CellsException>获取具有指定名称的工作表,失败时返回一个 CellsException。
worksheet_at(index: usize) → Result<&Worksheet, CellsError>获取指定零基索引处的工作表。
worksheet_at_or_cells_exception(index: usize) → Result<&Worksheet, CellsException>获取指定零基索引处的工作表,失败时返回一个 CellsException。
get_worksheets() → Worksheets<'_>获取工作簿顺序中的工作表。
get_worksheets_mut() → WorksheetsMut<'_>获取关联的值。
settings() → WorkbookSettings获取工作簿级别的设置,例如日期系统和显示区域文化。
get_settings() → WorkbookSettings获取工作簿级别的设置,例如日期系统和显示区域。
set_settings(settings: WorkbookSettings)设置工作簿级别的设置,例如日期系统和显示区域。
protect()保护当前对象。
unprotect()移除对当前对象的保护。
protection() → WorkbookProtection获取关联的值。
get_protection() → WorkbookProtection获取关联的值。
protection_mut() → &mut WorkbookProtection获取关联的值。
get_protection_mut() → &mut WorkbookProtection获取关联的值。
is_protected() → bool返回是否受保护。
properties() → &WorkbookProperties获取受支持的公共 API 所公开的工作簿元数据和视图设置。
get_properties() → &WorkbookProperties获取受支持的公共 API 所公开的工作簿元数据和视图设置。
get_properties_mut() → &mut WorkbookProperties获取关联的值。
document_properties() → &DocumentProperties获取核心和扩展元数据的文档属性外观。
get_document_properties() → &DocumentProperties获取核心和扩展元数据的文档属性外观。
get_document_properties_mut() → &mut DocumentProperties获取关联的值。
defined_names() → DefinedNameCollection<'_>获取工作簿定义的名称集合。
get_defined_names() → DefinedNameCollection<'_>获取工作簿定义的名称集合。
load_diagnostics() → &LoadDiagnostics获取在加载当前工作簿时收集的诊断信息。
get_load_diagnostics() → &LoadDiagnostics获取在加载当前工作簿时收集的诊断信息。
load_xlsx(path: impl AsRef<Path>) → Result<Self, CellsError>加载工作簿。
open(path: impl AsRef<Path>) → Result<Self, CellsError>打开现有工作簿。
open_with_options(path: impl AsRef<Path>, options: &LoadOptions) → Result<Self, CellsError>打开现有工作簿。
load_xlsx_with_options(path: impl AsRef<Path>, options: &LoadOptions) → Result<Self, CellsError>加载工作簿。
load_xlsx_from_stream(stream: R) → Result<Self, CellsError>使用默认加载选项从流中加载现有工作簿。
open_from_stream(stream: R) → Result<Self, CellsError>使用默认加载选项从流中打开现有工作簿。
open_from_stream_with_options(stream: R, options: &LoadOptions) → Result<Self, CellsError>使用显式加载选项从流中打开现有工作簿。
load_xlsx_from_stream_or_workbook_load_exception(stream: R) → Result<Self, WorkbookLoadException>使用默认加载选项从流中加载现有工作簿。
load_xlsx_from_stream_with_options(stream: R, options: &LoadOptions) → Result<Self, CellsError>使用显式加载选项从流中加载现有工作簿。
load_xlsx_from_bytes(bytes: &[u8]) → Result<Self, CellsError>加载工作簿。
load_xlsx_from_bytes_or_workbook_load_exception(bytes: &[u8]) → Result<Self, WorkbookLoadException>加载工作簿。
load_xlsx_from_bytes_with_options(bytes: &[u8], options: &LoadOptions) → Result<Self, CellsError>加载工作簿。
save_xlsx(path: impl AsRef<Path>) → Result<(), CellsError>保存工作簿。
save(path: impl AsRef<Path>) → Result<(), CellsError>使用显式保存选项将工作簿保存到流中。
save_with_format(path: impl AsRef<Path>, format: SaveFormat) → Result<(), CellsError>保存工作簿。
save_with_options(path: impl AsRef<Path>, options: &SaveOptions) → Result<(), CellsError>保存工作簿。
save_xlsx_with_format(path: impl AsRef<Path>, format: SaveFormat) → Result<(), CellsError>保存工作簿。
save_xlsx_with_options(path: impl AsRef<Path>, options: &SaveOptions) → Result<(), CellsError>保存工作簿。
save_xlsx_to_stream(stream: W) → Result<(), CellsError>使用默认保存选项将工作簿保存到流中。
save_to_stream_with_format(stream: W, format: SaveFormat) → Result<(), CellsError>使用指定的保存格式将工作簿保存到流中。
save_to_stream_with_options(stream: W, options: &SaveOptions) → Result<(), CellsError>使用显式保存选项将工作簿保存到流中。
save_xlsx_to_stream_or_workbook_save_exception(stream: W) → Result<(), WorkbookSaveException>将工作簿保存到流中,并将失败包装在 WorkbookSaveException 中。
save_xlsx_to_stream_with_format(stream: W, format: SaveFormat) → Result<(), CellsError>使用指定的保存格式将工作簿保存到流中。
save_xlsx_to_stream_with_options(stream: W, options: &SaveOptions) → Result<(), CellsError>使用显式保存选项将工作簿保存到流中。
save_xlsx_to_bytes() → Result<Vec<u8>, CellsError>保存工作簿。
save_xlsx_to_bytes_or_workbook_save_exception() → Result<Vec<u8>, WorkbookSaveException>保存工作簿。
save_xlsx_to_bytes_with_format(format: SaveFormat) → Result<Vec<u8>, CellsError>保存工作簿。
save_xlsx_to_bytes_with_options(options: &SaveOptions) → Result<Vec<u8>, CellsError>保存工作簿。
dispose()释放与工作簿实例关联的资源。

另请参阅

 中文