Struct Row

Source
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:

fieldtypemeaning
heightOption<f64>The custom height you want to update with.
outline_levelOption<u8>The outline level of a row, learn more from official documentation.
hiddenOption<u8>Whether the row is hidden or not.
collapsedOption<u8>collapse rows to group them.

Fields§

§height: Option<f64>§outline_level: Option<u8>§hidden: Option<u8>§collapsed: Option<u8>

Implementations§

Source§

impl Row

Source

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));
Source

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§

Source§

impl Clone for Row

Source§

fn clone(&self) -> Row

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Row

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Row

Source§

fn default() -> Row

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

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> 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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.