Installation

Installation

Aspose.Cells FOSS for Rust is distributed as the aspose-cells-foss-rust crate. It is not yet published on crates.io, so it installs as a standard Cargo git dependency — fully supported by Cargo and reproducible via Cargo.lock.


Prerequisites

RequirementDetail
Rust toolchainEdition 2021
CargoIncluded with the Rust toolchain
Operating systemWindows, Linux, or macOS
Microsoft OfficeNot required

1. Add the Dependency

Add the crate to the [dependencies] section of your Cargo.toml:

# Cargo.toml
[dependencies]
aspose-cells-foss-rust = { git = "https://github.com/aspose-cells-foss/Aspose.Cells-FOSS-for-Rust" }

Cargo resolves the repository, records the exact commit in Cargo.lock, and builds the crate as part of your project.


2. Build Your Project

cargo build

The first build fetches the repository and compiles the crate; subsequent builds use the locked revision.


3. Verify the Installation

Create a minimal program that writes and reloads a workbook:

use aspose_cells_foss_rust::Workbook;
use std::error::Error;

fn main() -> Result<(), Box<dyn Error>> {
    let mut workbook = Workbook::new();
    {
        let mut worksheets = workbook.get_worksheets_mut();
        let sheet = worksheets.get(0)?;
        let mut cells = sheet.get_cells_mut();
        cells.get("A1")?.put_value_string("Hello")?;
    }
    workbook.save("verify.xlsx")?;

    let loaded = Workbook::load_xlsx("verify.xlsx")?;
    let sheet = loaded.worksheet("Sheet1")?;
    println!("A1 = {}", sheet.get_cells().get("A1")?.display_string_value());
    Ok(())
}

Run it:

cargo run

If the program prints A1 = Hello, the installation works end to end.


Next Steps

See Also