rxls 0.1.2

Native Rust spreadsheet library: reads .xls (BIFF8/5/7), .xlsx, .xlsb, .ods and writes .xlsx. Typed cells, formulas, panic-free, no JVM/POI.
Documentation
//! Compile-time checks for the public API's threading and root-path contracts.

use std::panic::{RefUnwindSafe, UnwindSafe};

use rxls::{
    Cell, CsvOptions, Error, FormulaEvaluation, FormulaRange, Range, ReportEvaluation,
    ReportFeatures, ReportProperties, ReportStats, Sheet, Workbook, WorkbookReport,
};

fn assert_send_sync_static<T: Send + Sync + 'static>() {}
fn assert_unwind_safe<T: UnwindSafe + RefUnwindSafe>() {}
fn assert_std_error<T: std::error::Error + Send + Sync + 'static>() {}

#[test]
fn owned_core_and_output_types_are_send_sync() {
    assert_send_sync_static::<Cell>();
    assert_send_sync_static::<Sheet>();
    assert_send_sync_static::<Workbook>();
    assert_send_sync_static::<WorkbookReport>();
    assert_send_sync_static::<ReportEvaluation>();
    assert_send_sync_static::<CsvOptions>();
    assert_send_sync_static::<FormulaEvaluation>();
    assert_std_error::<Error>();

    #[cfg(feature = "xlsx")]
    {
        assert_send_sync_static::<rxls::Spreadsheet>();
        assert_std_error::<rxls::WriteError>();
    }
}

#[test]
fn immutable_core_views_are_send_sync_and_unwind_safe() {
    assert_send_sync_static::<Range<'static>>();
    assert_send_sync_static::<FormulaRange<'static>>();
    assert_unwind_safe::<Workbook>();
    assert_unwind_safe::<Range<'static>>();
}

#[test]
fn public_return_types_are_nameable_from_the_crate_root() {
    let _: Option<ReportStats> = None;
    let _: Option<ReportProperties> = None;
    let _: Option<ReportFeatures> = None;
    let _: Option<rxls::RangeRowUsedCells<'static, 'static>> = None;
    let _: Option<rxls::FormulaRangeRowUsedCells<'static, 'static>> = None;
    let _ = rxls::CommentAuthor::from("reviewer");
}