Skip to main content

SaveToFile

Trait SaveToFile 

Source
pub trait SaveToFile {
    // Required method
    fn save_to_file(&self, path: impl AsRef<Path>) -> Result<()>;
}
Expand description

Writes a Document/Workbook/Presentation directly to a path on disk — doc.save_to_file("report.docx")? instead of manually creating a File and calling the type’s own write_to.

Required Methods§

Source

fn save_to_file(&self, path: impl AsRef<Path>) -> Result<()>

Writes self to the file at path, creating it (or truncating an existing one) as needed.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl SaveToFile for Document

Available on crate feature word only.
Source§

impl SaveToFile for Presentation

Available on crate feature powerpoint only.
Source§

impl SaveToFile for Workbook

Available on crate feature excel only.