pub struct Row {
pub height: Option<f64>,
pub outline_level: Option<u8>,
pub hidden: Option<u8>,
pub collapsed: Option<u8>,
/* private fields */
}
Expand description
Row
records the fields you want to update to worksheets.
§Fields:
field | type | meaning |
---|---|---|
height | Option<f64> | The custom height you want to update with. |
outline_level | Option<u8> | The outline level of a row, learn more from official documentation. |
hidden | Option<u8> | Whether the row is hidden or not. |
collapsed | Option<u8> | collapse rows to group them. |
Fields§
§height: Option<f64>
§outline_level: Option<u8>
§collapsed: Option<u8>
Implementations§
Source§impl Row
impl Row
Sourcepub fn new(height: f64, outline_level: u8, hidden: u8, collapsed: u8) -> Row
pub fn new(height: f64, outline_level: u8, hidden: u8, collapsed: u8) -> Row
If you need to customize each field, you can use the Row::new()
method to create a Row
use edit_xlsx::Row;
let row = Row::new(15.0, 2, 1, 0);
assert_eq!(row.height, Some(15.0));
assert_eq!(row.outline_level, Some(2));
assert_eq!(row.hidden, Some(1));
assert_eq!(row.collapsed, Some(0));
Sourcepub fn new_by_worksheet(
height: f64,
outline_level: u8,
hidden: u8,
collapsed: u8,
format: &Format,
work_sheet: &mut WorkSheet,
) -> Row
pub fn new_by_worksheet( height: f64, outline_level: u8, hidden: u8, collapsed: u8, format: &Format, work_sheet: &mut WorkSheet, ) -> Row
If you want to custom the format of row, you can use Row::new_by_worksheet()
method.
NOTICE: A Row
created using the Row::new_by_worksheet()
method can only be used in incoming worksheets.
use edit_xlsx::{Workbook, WorkSheetRow, Row, Format, FormatColor};
let red = Format::default().set_background_color(FormatColor::RGB(255, 0, 0));
let mut workbook = Workbook::new();
let worksheet = workbook.get_worksheet_mut(1).unwrap();
let row = Row::new_by_worksheet(15.0, 2, 1, 0, &red, worksheet);
worksheet.set_row(1, &row).unwrap();
workbook.save_as("./examples/row_new_by_worksheet.xlsx").unwrap()
Trait Implementations§
impl Copy for Row
Auto Trait Implementations§
impl Freeze for Row
impl RefUnwindSafe for Row
impl Send for Row
impl Sync for Row
impl Unpin for Row
impl UnwindSafe for Row
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more