Properties

Struct Properties 

Source
pub struct Properties<'a> { /* private fields */ }

Implementations§

Source§

impl<'a> Properties<'a>

Source

pub fn set_title(&mut self, title: &'a str) -> &mut Self

Examples found in repository?
examples/doc_properties.rs (line 7)
3fn main() -> WorkbookResult<()> {
4    // Create a new workbook
5    let mut workbook = Workbook::new();
6    let mut properties = Properties::default();
7    properties.set_title("This is an example spreadsheet")
8        .set_subject("With document properties")
9        .set_author("pt")
10        .set_manager("example manager")
11        .set_company("example company")
12        .set_category("Example spreadsheets")
13        .set_keywords("Sample, Example, Properties")
14        .set_comments("Created with Rust")
15        .set_status("example status");
16    workbook.set_properties(&properties)?;
17    // Use the default worksheet
18    let worksheet = workbook.get_worksheet_mut(1)?;
19    worksheet.set_columns_width("A:A", 70.0)?;
20    worksheet.write("A1", "Select 'Workbook Properties' to see properties.")?;
21    workbook.save_as("examples/doc_properties.xlsx")?;
22    Ok(())
23}
Source

pub fn set_subject(&mut self, subject: &'a str) -> &mut Self

Examples found in repository?
examples/doc_properties.rs (line 8)
3fn main() -> WorkbookResult<()> {
4    // Create a new workbook
5    let mut workbook = Workbook::new();
6    let mut properties = Properties::default();
7    properties.set_title("This is an example spreadsheet")
8        .set_subject("With document properties")
9        .set_author("pt")
10        .set_manager("example manager")
11        .set_company("example company")
12        .set_category("Example spreadsheets")
13        .set_keywords("Sample, Example, Properties")
14        .set_comments("Created with Rust")
15        .set_status("example status");
16    workbook.set_properties(&properties)?;
17    // Use the default worksheet
18    let worksheet = workbook.get_worksheet_mut(1)?;
19    worksheet.set_columns_width("A:A", 70.0)?;
20    worksheet.write("A1", "Select 'Workbook Properties' to see properties.")?;
21    workbook.save_as("examples/doc_properties.xlsx")?;
22    Ok(())
23}
Source

pub fn set_author(&mut self, author: &'a str) -> &mut Self

Examples found in repository?
examples/doc_properties.rs (line 9)
3fn main() -> WorkbookResult<()> {
4    // Create a new workbook
5    let mut workbook = Workbook::new();
6    let mut properties = Properties::default();
7    properties.set_title("This is an example spreadsheet")
8        .set_subject("With document properties")
9        .set_author("pt")
10        .set_manager("example manager")
11        .set_company("example company")
12        .set_category("Example spreadsheets")
13        .set_keywords("Sample, Example, Properties")
14        .set_comments("Created with Rust")
15        .set_status("example status");
16    workbook.set_properties(&properties)?;
17    // Use the default worksheet
18    let worksheet = workbook.get_worksheet_mut(1)?;
19    worksheet.set_columns_width("A:A", 70.0)?;
20    worksheet.write("A1", "Select 'Workbook Properties' to see properties.")?;
21    workbook.save_as("examples/doc_properties.xlsx")?;
22    Ok(())
23}
Source

pub fn set_manager(&mut self, manager: &'a str) -> &mut Self

Examples found in repository?
examples/doc_properties.rs (line 10)
3fn main() -> WorkbookResult<()> {
4    // Create a new workbook
5    let mut workbook = Workbook::new();
6    let mut properties = Properties::default();
7    properties.set_title("This is an example spreadsheet")
8        .set_subject("With document properties")
9        .set_author("pt")
10        .set_manager("example manager")
11        .set_company("example company")
12        .set_category("Example spreadsheets")
13        .set_keywords("Sample, Example, Properties")
14        .set_comments("Created with Rust")
15        .set_status("example status");
16    workbook.set_properties(&properties)?;
17    // Use the default worksheet
18    let worksheet = workbook.get_worksheet_mut(1)?;
19    worksheet.set_columns_width("A:A", 70.0)?;
20    worksheet.write("A1", "Select 'Workbook Properties' to see properties.")?;
21    workbook.save_as("examples/doc_properties.xlsx")?;
22    Ok(())
23}
Source

pub fn set_company(&mut self, company: &'a str) -> &mut Self

Examples found in repository?
examples/doc_properties.rs (line 11)
3fn main() -> WorkbookResult<()> {
4    // Create a new workbook
5    let mut workbook = Workbook::new();
6    let mut properties = Properties::default();
7    properties.set_title("This is an example spreadsheet")
8        .set_subject("With document properties")
9        .set_author("pt")
10        .set_manager("example manager")
11        .set_company("example company")
12        .set_category("Example spreadsheets")
13        .set_keywords("Sample, Example, Properties")
14        .set_comments("Created with Rust")
15        .set_status("example status");
16    workbook.set_properties(&properties)?;
17    // Use the default worksheet
18    let worksheet = workbook.get_worksheet_mut(1)?;
19    worksheet.set_columns_width("A:A", 70.0)?;
20    worksheet.write("A1", "Select 'Workbook Properties' to see properties.")?;
21    workbook.save_as("examples/doc_properties.xlsx")?;
22    Ok(())
23}
Source

pub fn set_category(&mut self, category: &'a str) -> &mut Self

Examples found in repository?
examples/doc_properties.rs (line 12)
3fn main() -> WorkbookResult<()> {
4    // Create a new workbook
5    let mut workbook = Workbook::new();
6    let mut properties = Properties::default();
7    properties.set_title("This is an example spreadsheet")
8        .set_subject("With document properties")
9        .set_author("pt")
10        .set_manager("example manager")
11        .set_company("example company")
12        .set_category("Example spreadsheets")
13        .set_keywords("Sample, Example, Properties")
14        .set_comments("Created with Rust")
15        .set_status("example status");
16    workbook.set_properties(&properties)?;
17    // Use the default worksheet
18    let worksheet = workbook.get_worksheet_mut(1)?;
19    worksheet.set_columns_width("A:A", 70.0)?;
20    worksheet.write("A1", "Select 'Workbook Properties' to see properties.")?;
21    workbook.save_as("examples/doc_properties.xlsx")?;
22    Ok(())
23}
Source

pub fn set_keywords(&mut self, keywords: &'a str) -> &mut Self

Examples found in repository?
examples/doc_properties.rs (line 13)
3fn main() -> WorkbookResult<()> {
4    // Create a new workbook
5    let mut workbook = Workbook::new();
6    let mut properties = Properties::default();
7    properties.set_title("This is an example spreadsheet")
8        .set_subject("With document properties")
9        .set_author("pt")
10        .set_manager("example manager")
11        .set_company("example company")
12        .set_category("Example spreadsheets")
13        .set_keywords("Sample, Example, Properties")
14        .set_comments("Created with Rust")
15        .set_status("example status");
16    workbook.set_properties(&properties)?;
17    // Use the default worksheet
18    let worksheet = workbook.get_worksheet_mut(1)?;
19    worksheet.set_columns_width("A:A", 70.0)?;
20    worksheet.write("A1", "Select 'Workbook Properties' to see properties.")?;
21    workbook.save_as("examples/doc_properties.xlsx")?;
22    Ok(())
23}
Source

pub fn set_comments(&mut self, comments: &'a str) -> &mut Self

Examples found in repository?
examples/doc_properties.rs (line 14)
3fn main() -> WorkbookResult<()> {
4    // Create a new workbook
5    let mut workbook = Workbook::new();
6    let mut properties = Properties::default();
7    properties.set_title("This is an example spreadsheet")
8        .set_subject("With document properties")
9        .set_author("pt")
10        .set_manager("example manager")
11        .set_company("example company")
12        .set_category("Example spreadsheets")
13        .set_keywords("Sample, Example, Properties")
14        .set_comments("Created with Rust")
15        .set_status("example status");
16    workbook.set_properties(&properties)?;
17    // Use the default worksheet
18    let worksheet = workbook.get_worksheet_mut(1)?;
19    worksheet.set_columns_width("A:A", 70.0)?;
20    worksheet.write("A1", "Select 'Workbook Properties' to see properties.")?;
21    workbook.save_as("examples/doc_properties.xlsx")?;
22    Ok(())
23}
Source

pub fn set_status(&mut self, status: &'a str) -> &mut Self

Examples found in repository?
examples/doc_properties.rs (line 15)
3fn main() -> WorkbookResult<()> {
4    // Create a new workbook
5    let mut workbook = Workbook::new();
6    let mut properties = Properties::default();
7    properties.set_title("This is an example spreadsheet")
8        .set_subject("With document properties")
9        .set_author("pt")
10        .set_manager("example manager")
11        .set_company("example company")
12        .set_category("Example spreadsheets")
13        .set_keywords("Sample, Example, Properties")
14        .set_comments("Created with Rust")
15        .set_status("example status");
16    workbook.set_properties(&properties)?;
17    // Use the default worksheet
18    let worksheet = workbook.get_worksheet_mut(1)?;
19    worksheet.set_columns_width("A:A", 70.0)?;
20    worksheet.write("A1", "Select 'Workbook Properties' to see properties.")?;
21    workbook.save_as("examples/doc_properties.xlsx")?;
22    Ok(())
23}

Trait Implementations§

Source§

impl<'a> Default for Properties<'a>

Source§

fn default() -> Properties<'a>

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for Properties<'a>

§

impl<'a> RefUnwindSafe for Properties<'a>

§

impl<'a> Send for Properties<'a>

§

impl<'a> Sync for Properties<'a>

§

impl<'a> Unpin for Properties<'a>

§

impl<'a> UnwindSafe for Properties<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.